RESTful API

This documentation helps you implement the RESTful MyOperator API. This API uses a JSON format for output. The API is stateless – all requests are validated against an API token. The API token can be obtained manually from the MyOperator app.

It is very simple to get an authentication token. Login to your MyOperator panel. Go to Manage -> API integration -> Public API token

The API uses a straight-forward URL naming convention. Each request must be made to the API endpoint (https://developers.myoperator.co). API token must be provided as part of the query string for all requests, using the 'token' variable, e.g. https://developers.myoperator.co?token=tS5adsXC6V2nH991

Each response sent from the API made in json format contains the 'status' and status response parameters.

When the 'status' is 'success', the status response parameters contain the 'code' and an array of data, if request is POST or GET. The status response parameter contains the success message if it is a PUT request.

In case the 'status' is 'error', the response always contains the error 'code' and 'message' in the status response parameter.

The API description and live testing

   Get the list of your logs. You can query, search & filter to get appropriate logs.

Parameters

Name Value Description Type Required
token

Unique MyOperator API token issued to the user who is accessing API.

string Yes
from

Date from when you would like to access logs. Date should be in UTC format(unix timestamp).

string No
to

Date upto when you would like to access logs. Date should be in UTC format(unix timestamp).

string No
log_from

From which the logs need to be fetched, defaults to 0 (used for pagination)

string No
page_size

Number of logs you want to access(defaults to 20). Max request limit is 100.

string No
search_key

Words you want to search for (accepts: Name, Email, Phone number, Comments, Unique id, Caller name)

string No
filters

Filter IDs (from filters API) related with logical operators (AND, OR)

string No

Example for framing filters :

If you need to filter for all incoming missed calls,

Step 1 : Get List of filter from filters API.

Step 2 : fetch appropriate ids for the filter names (incoming - 5, missed - 13, call - 8)

Step 3 : Relate ids with logical operators (AND, OR only) - ‘5 AND 13 AND 8’

Step 4 : Place it against filters key in input - filters = ‘5 AND 13 AND 8’

   Get the list of keywords used to filter your logs.

Parameters

Name Value Description Type Required
token

Unique MyOperator API token issued to the user who is accessing API.

string Yes

Note

  • parent_id = 0, denotes that it is a type of filter but the filter itself (please find the picture)

  • In the below Image (replicates the filters response array), Source of Logs, Event of Logs & Type of Logs are embedded in the array and given with parent_id = 0.

  • In order to pass the filters to access logs, you need to pick filters which are only with parent is not equals to 0.

  • From below image, if you try to select filters incoming & outgoing, you need to relate them with OR operator (as parent id is same for those filters, use OR)

  • From below image, if you try to select Mobile & incoming, you need to relate them with AND operator (as parent id is different for those filters, use AND)


   List of users with search functionality

Parameters

Name Value Description Required type
token Unique MyOperator API token issued to the user who is accessing API. Yes string
keyword Words you want to search for (accepts: Name, Email, Phone number). No string
page Number of pages (defaults to 1). No number
page-size Results per page (defaults to 20, maximum 100). No number
_all Set this parameter to 1 if you require the list of all Users. No boolean

Note
  • 1  -  SuperAdmin
  • 2  -  Admin
  • 4  -  Manager
  • 8  -  Basic
   Fetch list of users
   List of users with search functionality
   Add a User to the panel using this API.

Parameters

Name Located in Description Required Schema
token Unique MyOperator API token issued to the user who is accessing API. Yes string
name User's name. Yes string
contact_number Primary contact number of the user (without leading country code). Yes string
country_code Country code of the primary contact number of the User(do not mistake it for state code) Yes string
extension Extension number for the user (usually between 11 to 99, should be a number not assigned as an extension to another User). Yes number
email Email of the user. No string
alternate_contact_number Alternate contact number of the user if available (without leading country code). No number
alternate_cc Country code for alternate number (required only if alternate contact number exists). No string
panel_access 1: User will be able to access MyOperator panel and view his/her logs.
2: User will not be able to login. (defaults to 1)
No number
receive_calls 1: User will receive IVR calls on contact_number.
2: User will not receive any calls. (defaults to 1)
No number
contact_type Mobile / SIP / Landline. (defaults to mobile) No string

Note :

  • User will be able to add other users based on the permissions defined on his role. SuperAdmin (id = 1) & Admin (id = 2) will be able to add users by default.

  • Extension should be a unique integer value

  • Contact number should be unique in your company. How ever it can be assigned as an alternate number of other users and a verification will be triggered from MyOperator.

  • alternate_cc is a required field only with alternate_contact_number

   Update a User to the panel using this API.

Parameters

Name Located in Description Required Schema
token Unique MyOperator API token issued to the user who is accessing API. Yes string
uuid User unique id Yes string
name User's name No string
contact_number Primary contact number of the user (without leading country code). No string
country_code Country code of the primary contact number of the User(do not mistake it for state code) No string
extension Extension number for the user (usually between 11 to 99, should be a number not assigned as an extension to another User). No number
email Email of the user. No string
alternate_contact_number Alternate contact number of the user if available (without leading country code). No number
alternate_cc Country code for alternate number (required only if alternate contact number exists). No string
panel_access 1 - will be able to access Myoperator panel and view his/her logs, 2 - will not be able to login, defaults to 1 No number
receive_calls 1 - will receive call on contact_number, 2 - will not receive any calls, defaults to 1 No number
contact_type mobile / sip / landline, defaults to mobile No string
   Links for the call recordings. Note that recording links will be valid for only 24 hours.

Parameters