Authorization in the interactive API browser
To make API requests through an interactive browser, you need a registered trusted application.
View file |
---|
name | %D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%20%D0%BE%D1%82%202016-06-29%2012_44_11.png_version=1&modificationDate=1467192396791&cacheVersion=1&api=v2&width=517&height=400 |
---|
|
Image AddedIn the authentication section, in the client_id and client_secret fields you must enter the Application ID and Application Secret values obtained during application registration, respectively. Next, click on the "Try it out!". If the application data is correct, the response returns an access token (access_token), which can be used to make requests through the interactive browser on behalf of your application.
View file |
---|
name | %D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%20%D0%BE%D1%82%202016-06-29%2012_44_59.png_version=1&modificationDate=1467192396508&cacheVersion=1&api=v2&width=428&height=400 |
---|
|
Image AddedThe resulting access token should be entered in the "Access Token Field" at the top of the page and saved by clicking the "Set Token" button.
View file |
---|
name | %D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%20%D0%BE%D1%82%202016-06-29%2012_46_22.png_version=1&modificationDate=1467192396213&cacheVersion=1&api=v2&width=255&height=250 |
---|
|
Image AddedAfter saving the token via the interactive browser, you can make requests to the REST API.
Working in the interactive API browser
The screenshot below shows an example of a request to get a list of internal numbers of an authorized client:
View file |
---|
name | %D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%20%D0%BE%D1%82%202016-06-29%2012_47_06.png_version=1&modificationDate=1467192395857&cacheVersion=1&api=v2&width=399&height=400 |
---|
|
Image AddedExample of a request to get a list of conversation records of the current client:
View file |
---|
name | %D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%20%D0%BE%D1%82%202016-06-29%2012_47_48.png_version=2&modificationDate=1467192488904&cacheVersion=1&api=v2&width=413&height=400 |
---|
|
In case of errors in writing a request from the code, it is a good practice to use an interactive browser for self-checking. For example, if it is not clear what exactly was passed incorrectly in the request body, you need to use the interactive browser for self-checking as follows:
View file |
---|
name | image2019-11-18_13-56-33.png_version=1&modificationDate=1574074594441&cacheVersion=1&api=v2&width=703&height=250 |
---|
|
When you click on the Model Schema array, the request body is automatically generated. You will only need to remove the extra query parameters and fill in the necessary parameters with values (the last parameter excludes enumeration and should not end with a comma).
← Creating and authorizing applications Getting files Authorizing PBX ApplicationsGetting Files via HTTP basic authentication Basic Authentication →