The Analytics API gives you the same call statistics as Dstny Analytics, as data you can load into your own reports, a data warehouse or a logging tool. It is built on the Meridix reporting platform. Dstny Analytics also has ready-made connectors for Power BI, Qlik and Excel, so check whether one of them covers your need before you build an integration.
Access
You need Dstny Analytics. An administrator creates an API ticket in reports.dstny.se.
-
Sign in at reports.dstny.se.
-
Create an API ticket.
-
Choose who it belongs to: a specific statistics user, or the whole organization.
-
Copy the token and the secret.
Choose organization level when you can. The ticket then keeps working if a user is deleted, and all times in the responses are in UTC. A ticket on a user returns times in that user's time zone.
Authenticate
Send the token and secret to the sign-in address and receive a JWT. Use the JWT as a bearer token.
The address depends on your site. Sköndal is the default: https://soluno-sko.meridix.se. For Gothenburg use https://dstny-gbg.meridix.se.
POST {analytics-address}/api/auth/jwt
Content-Type: application/json
{"token": "{token}", "secret": "{secret}"}
Authorization: Bearer {jwt}
JWT login needs Meridix version 3.9.0.5130 or later. All requests and responses use JSON.
Older integrations may use signed requests with a nonce, a timestamp and an HMAC signature in the query string. Each signature works once and is valid for 10 minutes. Use the JWT method for new work.
Build a request from a report
-
Build the report you want in the Dstny Analytics web interface.
-
Choose the option to download the HTTP request API JSON parameter for the current report.
-
Send that JSON in your API request. The result matches what you see in the report.
Reports can be generated synchronously or asynchronously, and exported as base64 or as a binary file. The response contains grouped statistics. Set IncludeSpecificationLists to true in the request to also receive a specifications.calls list with each individual call.
Number masking
Phone numbers are masked by default. The last three digits are replaced with asterisks, in the web interface and in the API. Dstny support can remove the masking on request. You then take responsibility for handling the full numbers under your data protection rules.
Good to know
-
Programming examples exist in C#, F#, Node.js, PHP, Java, Ruby and Python 3. A .NET client package also exists.
-
Normal outbound HTTPS (port 443) to the Analytics address is enough. No special firewall rules are needed.
-
Administrators can open the API documentation by signing in at reports.dstny.se and going to Administration, API Client code generator, API documentation.