Parameter | Required | Description |
x-api-key | True | Key for accessing API resource |
Secret Token | True | Secret for
accessing API, unique for each account |
Public IVR ID | True | ID referencing a unique campaign, multiple IVRs can be used in an account |
Company ID | True | Unique ID of
an account |
Region | False | When using
Dedicated DID, choose a region for call |
Group | False | When using
Dedicated DID, choose group of a region |
Caller_id | False. | When using
Dedicated DID, choose a dedicated number to make call |
Shell
curl --request POST 'https://obd-api.myoperator.co/obd-api-v1' \ --header 'x-api-key: {{x-api-key}}' \ --header 'Content-Type: application/json' \ --data-raw '{ "company_id": "{{Company ID}}", "secret_token": "{{Secret Token}}", "type": "1", #1 for peer to peer "user_id": "{{User ID}}", "number": "<country_code><number>", #e.g. +919212992129 "public_ivr_id": "{{Public IVR ID}}", "reference_id": "<client request id>", #e.g. abd9238dh21ss "region": <region of a call>, "caller_id": <caller id number of a call>, "group": <group of a dedicated number> }' |
import requests import json url = "https://obd-api.myoperator.co/obd-api-v1" payload = { "company_id": "{{Company ID}}", "secret_token": "{{Secret Token}}", "type": "1", #1 for peer to peer "user_id": "{{User ID}}", "number": "<country_code><number>", #e.g. +919212992129 "public_ivr_id": "{{Public IVR ID}}", "reference_id": "<client request id>", #e.g. abd9238dh21ss "region": "<region of a call>", "caller_id": "<caller id number of a call>", "group": "<group of a dedicated number>" } payload = json.dumps(payload) headers = { 'x-api-key': '{{x-api-key}}', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data = payload) print(response.text.encode('utf8')) |
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://obd-api.myoperator.co/obd-api-v1", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS =>'{ "company_id": "{{Company ID}}", "secret_token": "{{Secret Token}}", "type": "1", //1 for peer to peer "user_id": "{{User ID}}", "number": "<country_code><number>", //e.g. +919212992129 "public_ivr_id": "{{Public IVR ID}}", "reference_id": "<client request id>", //e.g. abd9238dh21ss "region": "<region of a call>", "caller_id": "<caller id number of a call>", "group": "<group of a dedicated number>" }', CURLOPT_HTTPHEADER => array( "x-api-key: {{x-api-key}}", "Content-Type: application/json" ), )); $response = curl_exec($curl); curl_close($curl); echo $response; |
var request = require('request'); var body = { "company_id": "{{Company ID}}", "secret_token": "{{Secret Token}}", "type": "1", //1 for peer to peer "user_id": "{{User ID}}", "number": "<country_code><number>", //e.g. +919212992129 "public_ivr_id": "{{Public IVR ID}}", "reference_id": "<client request id>", //e.g. abd9238dh21ss "region": "<region of a call>", "caller_id": "<caller id number of a call>", "group": "<group of a dedicated number>" }; var options = { 'method': 'POST', 'url': 'https://obd-api.myoperator.co/obd-api-v1', 'headers': { 'x-api-key': '{{x-api-key}}', 'Content-Type': 'application/json' }, body: JSON.stringify(body) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); |
POST https://obd-api.myoperator.co/obd-api-v1 |
curl --request POST 'https://obd-api.myoperator.co/obd-api-v1' \ --header 'x-api-key: {{x-api-key}}' \ --header 'Content-Type: application/json' \ --data-raw '{ "company_id": "{{Company ID}}", "secret_token": "{{Secret Token}}", "type": "1", #1 for peer to peer "number": "<country_code><number>", "number_2": "<country_code><number>", #e.g. +919212992129 "public_ivr_id": "{{Public IVR ID}}", "reference_id": "<client request id>", #e.g. abd9238dh21ss "region": "<region of a call>", "caller_id": "<caller id number of a call>", "group": "<group of a dedicated number>" }' |
import requests import json url = "https://obd-api.myoperator.co/obd-api-v1" payload = { "company_id": "{{Company ID}}", "secret_token": "{{Secret Token}}", "type": "1", #1 for peer to peer "number": "<country_code><number>", #e.g. +919212992129 "number_2": "<country_code><number>", #e.g. +919999999999 "public_ivr_id": "{{Public IVR ID}}", "reference_id": "<client request id>", #e.g. abd9238dh21ss "region": "<region of a call>", "caller_id": "<caller id number of a call>", "group": "<group of a dedicated number>" } payload = json.dumps(payload) headers = { 'x-api-key': '{{x-api-key}}', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data = payload) print(response.text.encode('utf8')) |
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://obd-api.myoperator.co/obd-api-v1", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS =>'{ "company_id": "{{Company ID}}", "secret_token": "{{Secret Token}}", "type": "1", //1 for peer to peer "number": "<country_code><number>", //e.g. +919212992129 "number_2": "<country_code><number>", //e.g. +919999999999 "public_ivr_id": "{{Public IVR ID}}", "reference_id": "<client request id>", //e.g. abd9238dh21ss "region": "<region of a call>", "caller_id": "<caller id number of a call>", "group": "<group of a dedicated number>" }', CURLOPT_HTTPHEADER => array( "x-api-key: {{x-api-key}}", "Content-Type: application/json" ), )); $response = curl_exec($curl); curl_close($curl); echo $response; |
var request = require('request'); var body = { "company_id": "{{Company ID}}", "secret_token": "{{Secret Token}}", "type": "1", //1 for peer to peer "number": "<country_code><number>", //e.g. +919212992129 "number_2": "<country_code><number>", //e.g. +919999999999 "public_ivr_id": "{{Public IVR ID}}", "reference_id": "<client request id>", //e.g. abd9238dh21ss "region": "<region of a call>", "caller_id": "<caller id number of a call>", "group": "<group of a dedicated number>" }; var options = { 'method': 'POST', 'url': 'https://obd-api.myoperator.co/obd-api-v1', 'headers': { 'x-api-key': '{{x-api-key}}', 'Content-Type': 'application/json' }, body: JSON.stringify(body) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); |
POST https://obd-api.myoperator.co/obd-api-v1 |
curl --request POST 'https://obd-api.myoperator.co/obd-api-v1' \ --header 'x-api-key: {{x-api-key}}' \ --header 'Content-Type: application/json' \ --data-raw '{ "company_id": "{{Company ID}}", "secret_token": "{{Secret Token}}", "type": "2", "number": "<country_code><number>", #e.g. +919212992129 "public_ivr_id": "{{Public IVR ID}}", "reference_id": "<client request id>", #e.g. abd9238dh21ss "region": "<region of a call>", "caller_id": "<caller id number of a call>", "group": "<group of a dedicated number>" }' |
import requests import json url = "https://obd-api.myoperator.co/obd-api-v1" payload = { "company_id": "{{Company ID}}", "secret_token": "{{Secret Token}}", "type": "2", #2 forIVR "number": "<country_code><number>", #e.g. +919212992129 "public_ivr_id": "{{Public IVR ID}}", "reference_id": "<client request id>", #e.g. abd9238dh21ss "region": "<region of a call>", "caller_id": "<caller id number of a call>", "group": "<group of a dedicated number>" } payload = json.dumps(payload) headers = { 'x-api-key': '{{x-api-key}}', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data = payload) print(response.text.encode('utf8')) |
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://obd-api.myoperator.co/obd-api-v1", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS =>'{ "company_id": "{{Company ID}}", "secret_token": "{{Secret Token}}", "type": "2", //2 for IVR "number": "<country_code><number>", //e.g. +919212992129 "public_ivr_id": "{{Public IVR ID}}", "reference_id": "<client request id>", //e.g. abd9238dh21ss "region": "<region of a call>", "caller_id": "<caller id number of a call>", "group": "<group of a dedicated number>" }', CURLOPT_HTTPHEADER => array( "x-api-key: {{x-api-key}}", "Content-Type: application/json" ), )); $response = curl_exec($curl); curl_close($curl); echo $response; |
var request = require('request'); var body = { "company_id": "{{Company ID}}", "secret_token": "{{Secret Token}}", "type": "2", //2 for IVR "number": "<country_code><number>", //e.g. +919212992129 "public_ivr_id": "{{Public IVR ID}}", "reference_id": "<client request id>", //e.g. abd9238dh21ss "region": "<region of a call>", "caller_id": "<caller id number of a call>", "group": "<group of a dedicated number>" }; var options = { 'method': 'POST', 'url': 'https://obd-api.myoperator.co/obd-api-v1', 'headers': { 'x-api-key': '{{x-api-key}}', 'Content-Type': 'application/json' }, body: JSON.stringify(body) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); |
Region | Group | DID |
Delhi | gr1 | 011609821 |
Delhi | gr1 | 011609822 |
Delhi | gr2 | 011709821 |
Delhi | gr2 | 011709822 |
Noida | gr3 | 0122666661 |
Noida | gr3 | 0122666662 |
Noida | gr4 | 0122766661 |
Noida | gr4 | 0122766662 |
Case | Params | Process |
Only Region | region: "Delhi" | MyOperator will select a random group from avaiable groups (gr1 , gr2) in region and selects a random DID from selected group. So MyOperator can randomly call from any DID in Delhi region |
Only Group | group: "gr1" | MyOperator will select a random DID from gr1 |
Only DID | caller_id: "011609822" | MyOperator will call using DID 011609822 |
All params | region:"Delhi", group:"gr1", caller_id:"011609822" | MyOperator checks the params with priority caller_id, group, region. If higher priority param is found then rest params will be ignored. So, in this case since caller_id is passed, MyOperator will use caller_id parameter directly, other params (group and region) will be ignored. |
{ "details": "Request accepted successfully", "status": "success", "code": "200", "unique_id": "<unique_generated_request_id>", "reference_id": "<optional param will be present if provided in request_body>" } |
Parameter |
Description |
details |
parameter gives the detailed message of the status of request. |
status |
status of request,
could be either success or error
|
code |
http status code of the request, different error codes are defined in errors section |
unique_id |
this is a unique id generated by MyOperator for a request |
reference_id |
if reference id is present in the API request, same will be
returned |
{ "message": "Forbidden", "type": "INVALID_API_KEY", "code": "403", "status": "error", "stage": "prod", "resourcePath": "/obd-api-v1", "details": "" } |
{ "details": "{msg}", "status": "error", "code": "<code>", "unique_id": "<unique_generated_request_id>", "reference_id": "<optional param will be present if provided in request_body>" } |
Error Code |
Meaning |
400 |
Bad Request -- Your request is invalid. check for missing parameter, request method etc. |
403 |
Forbidden -- may cause due to billing issue, too many requests for same number, or invalid IP etc. |
404 |
Not Found -- The specified resource could not be found. Check requested URL. |
500 |
Internal Error -- We had a problem
with our server.
Try again later
after some time or generate support ticket. |
Error Code |
Message |
Description |
400 |
Provide valid Number in string format |
|
400 |
Provide valid Agent Number in string format |
|
400 |
Provide valid type in string format |
type parameter is invalid, please check documentation |
400 |
Provide only one a Valid user_id or number_2 in string format |
|
400 |
Provide either a Valid user_id or number_2 in string format |
|
400 |
Provide valid secret_token in string format |
|
403 |
Your IP is unauthorized access denied |
Requester IP is not in Valid IP list, conteact support |
403 |
Your annonymous feature is not enabled |
contact support team |
403 |
User_id or number_2(agent_number) not allowed for this type |
|
403 |
Kindly choose any other reference ID, it has been already taken. Reference ID remaining_ttl x seconds |
duplicate reference ID is not allowed for a certain time, please contact support team to change setting |
403 |
Your billing usage has been Expired. |
Billing issue please contact support team |
403 |
Maximum number of requests for this number have exceeded. |
Call on same number is allowed only few times in a day, please contact support to change setting. |
404 |
Provide valid public_ivr_id in string format |
|
500 |
We are unable to process your request due to incomplete company_details |
Configuration Issue, pleae contact support team |