Skip to end of metadata
Go to start of metadata

Addon API is a programming interface for working with browser extension for integrations with external services. For integrations, it is necessary to designate the link by which the POST request will be made from our server in the API module settings.

(warning) The link must be entered without the http:// prefix.

Addon API is still in its beta stage and will likely be updated and modified. Please direct all question and comments to 000@onlinepbx.ru.

(warning) Mail for your questions: support@onlinepbx.ru.


 


 

Test request

Table of parameters:

ParameterNoteDescription
action Request type
status 1 - Successful, 0 - Unsuccessful
Request

POST /api/ HTTP/1.1
Host: custom_crm.onlinepbx.ru
Accept: */*
Content-Length: 11
Content-Type: application/x-www-form-urlencoded

action=test

Response

HTTP/1.1 200 OK
Date: Tue, 18 Oct 2016 09:31:41 GMT
Server: Apache
Content-Length: 14
Content-Type: application/json

{"status":"1"}


 

Card search by number

Table of parameters for requests:

ParameterNoteDescription
action Request type
phone This a telephone number with any format on our end, sent exactly as it was given by the phone company or user. For example: +1(502)555-5555, +15025555555, 15025555555, 1 502 555 5555, 5555555 etc. It is important to keep in mind that these numbers may all belong to a single person. The optimal search method is to use only the digits at starting at the end of the number.
Request

POST /api/ HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 49
Host: custom_crm.onlinepbx.ru
Connection: close

action=contact_info&data[phone]=0123456789&trunk=

Response table of parameters:

ParameterNoteDescription
status

For contact parameter

1 - successful, 0 - unsuccessful
commentFor contact parameterNotification or error message
idFor contact parameterContact identifier
urlFor contact parameterAddress of contact card
nameFor contact parameterContact name and surname
emailFor contact parameterContact email
photoFor contact parameterAddress of contact photo
idFor company parameterCompany identifier
urlFor company parameterAddress of company card
titleFor company parameterCompany name
emailFor company parameterCompany email
logoFor company parameterAddress of company logo
idFor lead parameterCompany identifier
urlFor lead parameterAddress of lead card
titleFor lead parameterName of lead
emailFor lead parameterCompany email
idFor lead parameterTransaction identifier
urlFor lead parameterAddress of lead card
titleFor lead parameterTransaction name
Response

HTTP/1.1 200 OK
Date: Tue, 18 Oct 2016 09:47:42 GMT
Server: Apache
Content-Length: 905
Connection: close
Content-Type: application/json

{"status":"1","comment":"","data":{"contact":{"id":"1665","url":"http:\/\/192.168.0.10\/crm\/contact.php?id=1665","name":"\u0418\u0432\u0430\u043d \u0418\u0432\u0430\u043d\u043e\u0432","email":"ivan@example.com","photo":"http:\/\/192.168.0.10\/crm\/contact_foto.png?id=1665"},"company":{"id":"1587","url":"http:\/\/192.168.0.10\/crm\/company.php?id=1587","title":"\u0420\u043e\u0433\u0430 \u0438 \u043a\u043e\u043f\u044b\u0442\u0430","email":"info@example.com","logo":"http:\/\/192.168.0.10\/crm\/company_logo.png?id=1587"},"lead":{"id":"111","url":"http:\/\/192.168.0.10\/crm\/lead.php?id=111","title":"\u0417\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u0432\u0438\u043d\u043d\u0443\u044e \u0433\u0440\u0443\u0434\u043a\u0443","email":"info@example.com"},"deal":{"id":"243","url":"http:\/\/192.168.0.10\/crm\/deal.php?id=243","title":"35 \u0413\u043e\u043b\u043e\u0432 \u0431\u044b\u043a\u0430"}}}

(warning) Only the first request is processed. It is saved in the browser’s memory.


 

Downloading calls

(warning) To deal with the large volume of requests, calls are saved using a separate database. Otherwise, we collect data in this base. Therefore, the list will be more complete and might differ from the history listed in the control panel. The list of calls is available using the API at: https://panel2.onlinepbx.ru/calls.php

Request table of parameters:

ParameterNoteDescription
action Request type
data Call data array
id Call identifier in database
uuid Call UUID (to receive recording and search via the API)
caller Caller number
callee Additional number of call recipient
trunk Trunk number
start_stamp Timestamp for start of call
duration Total length of call in seconds
billsec Length of conversation in seconds
type Call type: inbound/outbound/local

Response table of parameters:

ParameterNoteDescription
status 1 - successful, 0 - unsuccessful
comment Notification or error message
data Data array with result of process
id Call and request identifier
call_id Call identifier in database or “false”
lead_id Lead identifier if created or “false”
contact_id Contact identifier if created or “false”
Request

POST /api/ HTTP/1.1
Host: custom_crm.onlinepbx.ru
Accept: */*
Content-Length: 882
Content-Type: application/x-www-form-urlencoded

action=call_upload&data%5B0%5D%5Bid%5D=23&data%5B0%5D%5Buuid%5D=544aa79c-da7e-4c59-bebf-f289dc6ccd20&data%5B0%5D%5Bcaller%5D=100&data%5B0%5D%5Bcallee%5D=9197&data%5B0%5D%5Bstart_stamp%5D=1476789142&data%5B0%5D%5Bduration%5D=10&data%5B0%5D%5Bbillsec%5D=10&data%5B0%5D%5Btype%5D=local&data%5B0%5D%5Btrunk%5D=&data%5B1%5D%5Bid%5D=24&data%5B1%5D%5Buuid%5D=e53817e3-57b7-457b-94a9-ef319223e4a9&data%5B1%5D%5Bcaller%5D=100&data%5B1%5D%5Bcallee%5D=5300&data%5B1%5D%5Bstart_stamp%5D=1476789156&data%5B1%5D%5Bduration%5D=12&data%5B1%5D%5Bbillsec%5D=12&data%5B1%5D%5Btype%5D=local&data%5B1%5D%5Btrunk%5D=&data%5B2%5D%5Bid%5D=25&data%5B2%5D%5Buuid%5D=5e38b27b-2b0e-4247-aae2-0db88d1857e8&data%5B2%5D%5Bcaller%5D=100&data%5B2%5D%5Bcallee%5D=9196&data%5B2%5D%5Bstart_stamp%5D=1476789173&data%5B2%5D%5Bduration%5D=13&data%5B2%5D%5Bbillsec%5D=13&data%5B2%5D%5Btype%5D=local&data%5B2%5D%5Btrunk%5D=

(warning) Call download requests are performed every 5 minutes.

(warning) The maximum quantity of calls for a single request is 30.

(warning) Requests will be sent until a response is returned that the call has been successfully received.

Response

HTTP/1.1 200 OK
Date: Tue, 18 Oct 2016 11:15:13 GMT
Server: Apache
Content-Length: 231
Content-Type: application/json

{"status":"1","comment":"","data":[{"id":"23","call_id":5968148,"lead_id":71026,"contact_id":74507},{"id":"24","call_id":1768776,"lead_id":92923,"contact_id":91800},{"id":"25","call_id":4516404,"lead_id":46212,"contact_id":34759}]}

 

 

 

 

To contents


 

Creating a contact

Request table of parameters:

ParameterNoteDescription
action Request type
data Contact information
name  
phone Phone number
comment Notes for contact
company_name 

Contact company name. If none exists, one must be created

Response table of parameters:

ParameterNoteDescription
status 1 - successful, 0 - unsuccessful
comment Notification or error message
data Result of process
contact_id Contact identifier or “false”
company_id Company identifier or “false”
Request

POST /api/ HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 200
Host: custom_crm.onlinepbx.ru
Connection: close

action=create_contact&data[name]=%D0%98%D0%B2%D0%B0%D0%BD%20%D0%98%D0%B2%D0%B0%D0%BD%D0%BE%D0%B2&data[phone]=0123456789&data[comment]=%D0%BA%D0%BE%D0%BC%D0%BC%D0%B5%D0%BD%D1%82%D0%B0%D1%80%D0%B8%D0%B9

Response

HTTP/1.1 200 OK
Date: Tue, 18 Oct 2016 09:53:55 GMT
Server: Apache
Content-Length: 73
Connection: close
Content-Type: application/json

{"status":"1","comment":"","data":{"contact_id":12543,"company_id":6582}}

To contents


 

Creating a lead

Request table of parameters:

ParameterNoteDescription
action Request type
data Lead information
name Contact name
phone Phone number
comment Notes
user_id User identifier associated with lead

Response table of parameters:

ParameterNoteDescription
status 1 - successful, 0 - unsuccessful
comment Notification or error message
data Result of process
lead_id Lead identifier or “false”
Request

POST /api/ HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 219
Host: custom_crm.onlinepbx.ru
Connection: close

action=create_lead&data[name]=%D0%98%D0%B2%D0%B0%D0%BD%20%D0%98%D0%B2%D0%B0%D0%BD%D0%BE%D0%B2&data[phone]=0123456789&data[comment]=%D0%BA%D0%BE%D0%BC%D0%BC%D0%B5%D0%BD%D1%82%D0%B0%D1%80%D0%B8%D0%B9&data[user_id]=5648527

Response

HTTP/1.1 200 OK
Date: Tue, 18 Oct 2016 10:01:28 GMT
Server: Apache
Content-Length: 52
Connection: close
Content-Type: application/json

{"status":"1","comment":"","data":{"lead_id":53317}}

To contents


 

Show user list

Request table of parameters:

ParameterNoteDescription
action Request type
Request

POST /api/ HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 17
Host: custom_crm.onlinepbx.ru
Connection: close

action=list_users

Response table of parameters:

ParameterNoteDescription
status 1 - successful, 0 - unsuccessful
comment Notification or error message
data Data array with user list
id User identifier
name User name
phone Additional number of user
photo Link to photo
Response

HTTP/1.1 200 OK
Date: Tue, 18 Oct 2016 10:52:30 GMT
Server: Apache
Content-Length: 385
Connection: close
Content-Type: application/json

{"status":"1","comment":"","data":[{"id":"68554","name":"\u0418\u0432\u0430\u043d \u0418\u0432\u0430\u043d\u043e\u0432","phone":"01234568","photo":"http:\/\/192.168.0.10\/crm\/contact_foto.png?id=1665"},{"id":"26854","name":"\u041f\u0451\u0442\u0440 \u041f\u0435\u0442\u0440\u043e\u0432\u0438\u0447","phone":"987654321","photo":"http:\/\/192.168.0.10\/crm\/contact_foto.png?id=1571"}]}

To contents


 

Add notes to calls

Request table of parameters:

ParameterNoteDescription
action Request type
call_id Call identifier in database
text Text of note

Response table of parameters:

ParameterNoteDescription
status 1 - successful, 0 - unsuccessful
comment 

Notification or error message

Request

POST /api/ HTTP/1.1
Host: custom_crm.onlinepbx.ru
Accept: */*
Content-Length: 127
Content-Type: application/x-www-form-urlencoded

action=comment_call&0%5Bcall_id%5D=8.0500058E+14&0%5Btext%5D=%D0%BA%D0%BE%D0%BC%D0%BC%D0%B5%D0%BD%D1%82%D0%B0%D1%80%D0%B8%D0%B9

Response

HTTP/1.1 200 OK
Date: Tue, 18 Oct 2016 11:30:30 GMT
Server: Apache
Content-Length: 27
Content-Type: application/json

{"status":"1","comment":""}

 

 

To contents

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.