Telecommunication platform Webitel provides an opportunity for external developers  to manage settings and calls using software. One way to do this is to use the REST API.

What is REST API

The REST API defines a set of functions to which developers can make requests and receive responses. The interaction takes place via HTTP. The advantage of this approach is the wide distribution of the HTTP protocol, so the REST API can be used from nearly any programming language.

Request Authorization

To execute a REST API request, you need to send an X-Access-Token to the Header and, optionally, an X-Key for requests on behalf of users.

To get an access token, you can execute the command login using the login and password of any Webitel user:

POST /login HTTP/1.1
Content-Type: application/json

{
  "username": "[email protected]",
  "password": "secret"
}

In the answer get X-Access-Token and X-Key. All further requests using X-Access-Token and X-Key data will be executed with the rights and on behalf of this user.

Another variant - Domain Token:

You can set on your own the role and the validity of such a key. In requests it is necessary to place only X-Access-Token with the value of this key in the Header.

Examples of popular queries

Below is a list of popular queries using Domain Token.

You can also read Webitel Client source code, the functionality of which is fully implemented using the Webitel REST API.

  • No labels