Tariscope 4.6.Tariscope API guide
How to work with Tariscope API?
First, you need to create a user in the Tariscope system to work with the API and grant him access to the API methods that he is allowed to use.
To do this, in the Tariscope menu, select Additional options -> Integration. A page will appear, an example of which is shown in Figure 1.
Figure 1
Click on the Tariscope API button. A page will be displayed, an example of which is shown in Figure 2.
Figure 2
This page has two links: API Users and More Methods.
API Users
A tab opens that allows you to create, edit, or delete a Tariscope API user, grant them access to specific API methods, and reset their password. An example of this page is shown in Figure 3.
Figure 3
To create a new user, click the Add icon. The window shown in Figure 4 will appear.
Figure 4
In the Username field, enter a name.
If necessary, you can add any comment in the Description field. This is an optional field to enter.
In the New Password and Confirm Password fields, enter the password that this user will use to connect to the Tariscope system.
Click the Save button.
To select the API methods that the user will have access to, select the user in the users table (Figure 3), and click the Method Rights icon on the toolbar. The Rights Settings page will appear, an example of which is shown in Figure 5.
Figure 5
Use the radio buttons to select the API methods the user will have access to. Click the Save button.
This completes the setup of access to API methods from the Tariscope system.
Next, you must write code to execute API methods. To access the API, you must authenticate using JSON Web Tokens (JWT). To do this, you must pass the username and password in the body of the auth method request. If the authorization is successful, Tariscope will return a token that is tied to the IP address from which the request was made. This token is valid for 6 hours.
When making API requests, JSON or XML formats are supported. JSON format is used by default. To specify a specific format, you must specify it in the request.
Example, for a POST request: /api/auth/xml
Example for a GET request: /api/subscriber/get/xml/?id=1234
The More Methods link (Figure 2) displays a window asking you to suggest new methods that we can implement over time.