I denne artikel:
Dstny provides a powerfull REST API for call statistics, analytics and CDR.
Where to find the API documentation
The documentation can be found here:
https://meridix.atlassian.net/wiki/spaces/MS36MEN/pages/5046278/HTTP+WebAPI
Furthermore, each API endpoint is documented here:
https://statistics.connect.ipvision.dk/api/doc
The latter requires a login, which can be provided by Dstny DK.
API authentication
To access the API, an API token must be created. This can be created on a specific statistics user or on organisation level. We recommend using a token on organisation level to avoid issue if the associated user is deleted in the future.
Note: When using an organisation token, all timestamps in the API will be in UTC. When using a token on a user, the timestamps will be following the timezone of that user.
After obtaining the API token, each API uses bearer authentication. The logic to build a signed request is described here: https://meridix.atlassian.net/wiki/spaces/MS36MEN/pages/5046278/HTTP+WebAPI
(this page also includes examples in common programming languages to getting started)
When the signed request is made, the token must be used in an Authorization header having the value: "Bearer <token>".
Using the API
The base URL for the API is: https://statistics.connect.ipvision.dk/
When using the report API, a lot of parameters can be used to adjust the content. To getting started, we recommend using the web GUI (at https://statistics.connect.ipvision.dk) to generate a report containing all the data you want to fetch via the API and then download the JSON payload for the API request. This way, the API returns all the data used to generate what you see in the web GUI.
To get the JSON payload, click on the "About the report" tab:
And then click on the button "Download HTTP Request API JSON parameter for current report":
The downloaded JSON contains the payload to send to the API to get the exact same data as used to generate the web GUI view.
Call specifications
When fetching data from the report API, you'll always get a list of groupings, which are used by the web GUI to present the data and graphs. These groupings are a more statistics like dataset containing accumulated data about calls in certain timeframes, etc.
But in some cases you need a dataset for each call that has been used to generate the groupings.
To get them, set the boolean parameter "IncludeSpecificationLists" to "true" in the JSON payload. Now the API response will also include an JSON object called "specifications" and a nested object called "calls", which contains all the calls, and their data, from the report.
Number masking
Per default, all phone numbers are masked, by replacing the 3 last digits with asterisks. This is due to data security. The masking can be removed by Dstny DK, on the customers own responsibility. The change will affect all phone number in both the web GUI and API.
Comments
0 comments
Article is closed for comments.