API (eng. version)
Содержание 3
The API (Application Programming Interface) is an interface for creating applications. You might say it is an index of ready-code that simplifies the work of the software developer.
As an interface, the API allows developers to use pre-written lines of code to create their applications. In regard to web applications, the API is an alternative method of delivering data to standard HTML.
We currently support two methods of integrating applications. WebSocket API allows you to create web applications for directing calls in real-time. HTTP API is used for receiving and processing statistical information.
OnlinePBX also has webhooks. They confirmed third-party services about changes in the PBX.
Mail for your questions: support@onlinepbx.ru.
If your account is disabled, API requests for the auth.json and mongo_history/search.json handles will continue to work for another seven days. Afterwards they will be disabled until the license is renewed.
The cache on the date the domain was disabled is ten minutes (after the account is disabled, the API is disabled within ten minutes. Also relevant for enabling).
Contents
In WebSockets API 3.0.0, the link has the format: https://[domain name]:3342/documentation/index.html. Instead of «domain name» you must specify the name of a specific account.
What will happen to WebSockets API 2.0?
We no longer support this version.
Frequent queries
The most common problems and their solutions.
Why is the call not uploaded?
Calls may not be uploaded due to various factors:
- Check which database the request was sent to. The old version of the API is not supported. Use the new API: OnlinePBX HTTP API - https://api2.onlinepbx.ru/documentation.
- Check the correctness of the submitted request.
- The request is missing the download=1 parameter.
- Check for a call in the control panel and verify the UUID.
For diagnostics, send the full request body to our technical support email: support@onlinepbx.ru .
How to get call history?
The call history can be obtained using a POST request https://api2.onlinepbx.ru/domain.onpbx.ru/mongo_history/search.json. Instead of domain.onpbx.ru, specify the name of your domain (it looks like example.onpbx.ru). The request requires at least one parameter.
When requesting calls with accountcode=missed, calls with accountcode=inbound will be returned. This is because missed calls are incoming calls without a conversation. Missed calls are stored in the database as incoming calls.
The maximum interval for which you can receive calls in one request (except for requests with uuid) is one week. That is, the difference between start_stamp_to and start_stamp_from, or end_stamp_to and end_stamp_from, must not exceed the maximum interval in seconds. If the interval exceeds the maximum, then calls for the last maximum interval from this interval will be returned. If none of these parameters is specified: start_stamp_to, start_stamp_from, end_stamp_to, end_stamp_from, then calls for the current day (GMT-0) will be returned.
How to receive information about calls?
For real-time call information, use the WebSockets API and Webhooks.
If you need a simple call history, then we recommend using the HTTP API, the method https://api2.onlinepbx.ru/domain.onpbx.ru/mongo_history/search.json. Instead of domain.onpbx.ru, specify the name of your domain (it looks like example.onpbx.ru). Depending on how you need to get the history (for a certain period, by number, by domain, etc.), use the required parameter. More details in the documentation.
Why are requests taking a long time to process?
Long request processing can be associated with a high load on the server, as well as a large volume of the request being sent.
You did not find the answer to your question?
Contact our technical support:
+7 (495) 669-67-21
+7 (343) 302-01-37
+7 (343) 646-51-40
Email — support@onlinepbx.ru
Telegram — techpbx_bot