Documentation for developers

Need data and instructions for integration or data export?
Take advantage of our instructions.

Obtaining an API Key
Adding a task (number) to a dialer
Removing a task (number) from a dialer
Call Log
Adding call data
Retrieving call data
Retrieving a call recording
Summary reports by queues and users
Changing the agent’s status
Exporting contacts from CRM
Checking for the existence of a value in the list
Complete order details (SHOP module)
API for the list of dialers

API v.1

 

Obtaining an API Key

The API Key is created in your user settings.

width="600"

 

Adding a task (number) to a dialer

URL https://home.oki-toki.net/docs/api/#dialers-GETapi-v1-dialers-create_task

Method: POST or GET

*The API Key is created in your user settings, as shown in the first point of the documentation

Variable transmission:

By standard method in POST or GET request
In a non-standard way. POST or GET variable json_request must contain a json string with data for adding a task

Authorization by user api token. The request must necessarily contain a variable api_token containing the user token.

Mandatory data:

dialer_id – the dialer number to which to add a task
phones – phone numbers, maximum 5. Separated by a comma or as a json substring (if passed in json_request)

Optional data:

contact_id – the contact number from Oki-Toki CRM,
bp_id – the process number from Oki-Toki CRM,
date – the time the calls are scheduled for, in the format 21.02.2017 12:00:00,
import_id – the import number,
priority from 0 to 2,
region in the time zone format. for example Europe/Kiev (if the region is specified but is empty, then autocorrection of the zone (if enabled) will not work, the customer schedule will not work, and the call will go according to the dialer’s operating schedule),
ttl the lifetime of the task, in seconds,
user_id the user number to assign the task to,
details – a json substring with additional information, for example {“name”:”John”, “order”:”12″}
force_create – 1 or 0. If force_create=1, uniqueness is enabled in the dialer settings and the task is not added due to this very uniqueness, then when adding all existing tasks conflicting with the added by a unique key will automatically be canceled,
task_id – the task number in the dialer. if specified, phone numbers will be added to the task with the specified number, if it is in progress,

reset_task_id – the task number in the dialer. if specified – the system will try to find this task and put it into work, instead of creating a new one. If phone numbers (phones) are specified, then the system will put only those specified into work. if the task does not have any specified number – it will be added to it. if numbers are not specified – all phones in the task will be queued.
The response returns a message about successful task addition with its number, or an error message.

 

Removing a task (number) from a dialer

URL https://noname.oki-toki.net/api/v1/dialers/cancel_task

Method: POST or GET

*The API Key is created in your user settings, as shown in the first point of the documentation.

Variable transmission:

By standard method in POST or GET request.
In a non-standard way. POST or GET variable json_request must contain a json string with data for adding a task.
Authorization by user api token. The request must necessarily contain a variable api_token containing the user token.

Mandatory data:
dialer_id – the dialer number from which to remove a task (if the number = 0, then it is removed from all dialers).
Optional data:
task_id – the task number,
phone – the phone number that is in the task,
contact_id – the contact number from Oki-Toki CRM,
bp_id – the process number from Oki-Toki CRM,
details – a json substring with additional information, for example {“name”:”John”, “order”:”12″}. Tasks with the specified additional information are canceled,
cancel_phone – 1 (flag, if set, then cancels only the specified phone number),
cancel_reason – the reason for cancellation (can be one of: wrong_number).
It is possible to combine optional parameters with each other, then different tasks will be deleted. For example: you can delete all tasks with a specific phone number, or with details.

If none of the optional parameters is specified, an error will be returned.

The response returns a message about the successful cancellation of the task(s) with its(their) number(s), or an error message.

 

Call Log

URL https://noname.oki-toki.net/api/v1/reports/acd/calls-log

Method: GET

*The API Key is created in your user settings, as shown in the first point of the documentation.

Authorization by user api token. The request must necessarily contain a variable api_token, containing the user token.

Without parameters, it returns calls for the last hour.

Parameters:
date_range – the period for which to return data. Values: last_hour, today, yesterday, this_week, prev_week, this_month, prev_month,
date – the date for which to return calls,
anis – phone number or session ID,
format – the format in which to return the result. Values: default, csv, csv_2016. By default, it returns in JSON, csv – CP-1251 encoding, csv_2016 – UTF-8 encoding.
As well as all other fields used in the filter of this report. Variable names and values can be taken from the report form. You can also perform a report in the web interface with the required parameters, and copy the part of the url with parameters from the address bar, adding your api_token to it.

Examples

Replace the asterisks with your api_token

Today’s calls:
https://noname.oki-toki.net/api/v1/reports/acd/calls-log?date_range=today&api_token=****

Searching for a call with session ID 12345678, made on 29.08.2017:
https://noname.oki-toki.net/api/v1/reports/acd/calls-log?date=28.08.2017&anis=12345678&api_token=****

Calls to/from the number 380501234567, made last week:
https://noname.oki-toki.net/api/v1/reports/acd/calls-log?date_range=prev_week&anis=380501234567&api_token=****

All calls last week in CSV (“Cyrillic Windows-1251” encoding):
https://noname.oki-toki.net/api/v1/reports/acd/calls-log?date_range=this_week&format=csv&api_token=****

 

Adding call data

URL https://noname.oki-toki.net/api/v1/call/add_data

Method: POST or GET

*The API Key is created in your user settings, as shown in the first point of the documentation.

Data transmission:
By standard method in POST or GET request
In a non-standard way. POST or GET variable json_request must contain a json string with data.
Authorization by user api token. The request must necessarily contain a variable api_token containing the user token.

Mandatory data:
session_id – the unique call number in the Oki-Toki system to which data are added
Note.
If data is added repeatedly, it will be added to the previously added data.
If the value of some parameter is empty, then this parameter will be removed from the dataset.
The response returns a message about successful data addition with the call number, or an error message.

 

Retrieving call data

URL https://noname.oki-toki.net/api/v1/call/get_data

Method: POST or GET

*The API Key is created in your user settings, as shown in the first point of the documentation.

Data transmission:
By standard method in POST or GET request
In a non-standard way. POST or GET variable json_request must contain a json string with data.
Authorization by user api token. The request must necessarily contain a variable api_token containing the user token.

Mandatory data:
session_id – the unique call number in the Oki-Toki system to which data are added,
date – the call date in the format DD.MM.YYYY.
The response returns a message with call data, or an error message.

 

Retrieving a call recording

URL https://noname.oki-toki.net/api/v1/record/{session_id}

Method: GET

*The API Key is created in your user settings, as shown in the first point of the documentation.

Authorization by user api token. The request must necessarily contain a variable api_token, containing the user token.

Parameters:
date – the call date. If not specified, searches for the last three months
Example:
https://noname.oki-toki.net/api/v1/record/1234567?date=26.09.2017&api_token=****

Summary report on calls

URL https://noname.oki-toki.net/api/v1/reports/acd/calls-summary

Method: GET

*The API Key is created in your user settings, as shown in the first point of the documentation.

Authorization by the user’s api token. The request must necessarily contain a variable api_token, containing the user token.

Without parameters, it returns calls for the last hour.

Parameters:
date_range – the period for which to return data. Values: last_hour, today, yesterday, this_week, prev_week, this_month, prev_month.
As well as all other fields used in the filter of this report. Variable names and values can be taken from the form of the report. You can also perform a report in the web interface with the required parameters, and copy the part of the url with parameters from the address bar, adding your api_token to it.

 

Summary reports by queues and users

URL https://noname.oki-toki.net/api/v1/reports/sec/queue-status-summary (queues)

and https://noname.oki-toki.net/api/v1/reports/sec/user-status-summary (users)

Method: GET

*The API Key is created in your user settings, as shown in the first point of the documentation.

Authorization by user api token. The request must necessarily contain a variable api_token, containing the user token.

Without parameters, it returns statuses for the last hour without breakdown.

Parameters:
date_range – the period for which to return data. Values: last_hour, today, yesterday, this_week, prev_week, this_month, prev_month.
split_by – split by queues or users. Values: queue, user.

As well as all other fields used in the filter of this report. Variable names and values can be taken from the report form. You can also perform a report in the web interface with the required parameters, and copy the part of the url with parameters from the address bar, adding your api_token to it.

Changing the agent’s status

URL https://noname.oki-toki.net/api/v1/user/set_status

Method: POST or GET

*The API Key is created in your user settings, as shown in the first point of the documentation.

Variable transmission:
By standard method in POST or GET request
In a non-standard way. POST or GET variable json_request must contain a json string with data for changing the status
Authorization by user api token. The request must necessarily contain a variable api_token containing the user token.

Mandatory data:
user_id – the user number
status_id – status number (see here https://noname.oki-toki.net/company/statuses)

Optional data:
away_status_id – an additional status number (see here https://noname.oki-toki.net/company/statuses),
status_comment – comment to the status.
The response returns a message about successful status change, or an error message.

 

Exporting contacts from CRM

URL https://noname.oki-toki.net/api/v1/contacts

Method: GET

*The API Key is created in your user settings, as shown in the first point of the documentation.

Variable transmission:

By standard method in GET request

Authorization by user api token. The request must necessarily contain a variable api_token containing the user token.

Contact selection filter:
contact_field1=value1&contact_field2=value2&contact_field3=*value3&
contact_field4=*value4*

contact_field – The name of the contact field, as it appears in the contact.
=value – exact match with the specified value,
=*value* – contains the specified value
=*value – the specified value is at the end of the field,
=value* – the specified value is at the beginning of the field,

value may be a list in the format of a list [1,2,3,4]. Then, a contact will be found whose value of the specified field is in the list.

The response returns a json array containing the found contacts. The number of contacts is limited to 1000.

Checking for the existence of a value in the list

URL https://noname.oki-toki.net/api/v1/lists/check

Method: GET

*The API Key is created in your user settings, as shown in the first point of the documentation.

Variable transmission:

By standard method in GET request

Authorization by user api token. The request must necessarily contain a variable api_token containing the user token.

Mandatory data:
list_id – the list number for checking

Checking parameters:
value – the value

The response returns 1 if in the list. 0 – if not.

 

Complete order details (SHOP module)

URL https://noname.oki-toki.net/api/v1/shop/order/$id

Method: GET

*The API Key is created in your user settings, as shown in the first point of the documentation.

Variable transmission:

By standard method in GET request

Authorization by user api token. The request must necessarily contain a variable api_token containing the user token.

Mandatory data:

$id – the order number

The response returns full order details including its contents.

 

API for the list of dialers

URL https://noname.oki-toki.net/api/v1/dialers/stat

Method: GET

*The API Key is created in your user settings, as shown in the first point of the documentation.

Variable transmission:
By standard method in GET request

Authorization by user api token. The request must necessarily contain a variable api_token containing the user token.

Optional data:
$dialer_id – the dialer number

The response returns data on all non-archive dialers, or if $dialer_id is specified – only about one.

Submit your request and receive a detailed consultation from a specialist.


    Data Processing Agreement