Tariscope API
The Tariscope billing system has several options for interacting with other user information systems:
- Hotel systems. Within this interface, interaction can be performed not only with hotel systems, but also with any other using a specially designed script. The list of data that can be transmitted is determined by the capabilities of the script. Typically, information is transmitted on the current call made.
- Access to Tariscope database. The Tariscope administrator can grant other users direct access to the Tariscope database. In this case, you can provide access to the entire database, as well as to its individual parts.
- Tariscope API. This is a special Tariscope interface that allows you to receive and change some of the Tariscope database data by making HTTP calls.
In this article, we will consider the last option, namely, obtaining data using the Tariscope API.
What data can be received (sent) from (to) Tariscope using the Tariscope API?
- Subscriber parameters. [subscriber.get]
- List of subscribers of any group. [subscriber.list.department]
- List of subscribers of the communication node. [subscriber.list.node]
- Update subscriber parameters. [subscriber.update]
- Summary information on the subscriber's account for a specific period. [account.summary]
- The current version of Tariscope. [tariscope.version]
- The current version of the Tariscope database. [tariscope.database]
- Date of the current version of the Tariscope system. [tariscope.build]
- Serial number of license for Tariscope. [tariscope.serial]
- The Tariscope system edition. [tariscope.edition]
- General information about the Tariscope system. [tariscope.summary]
- List of available API methods for a specific user. [claims]
- Any system data can be obtained, modified or added using SQL commands. [sql]
How to work with Tariscope API?
In the Tariscope menu, select Integration. The corresponding page appears, an example of which is shown in Figure 1.
Figure 1
Click on the Tariscope API button. The corresponding page is displayed, an example of which is shown in Figure 2.
Figure 2
This page has two tabs.
Documentation. Links to all API methods that are supported are displayed. Clicking on each of the links allows you to get information on a specific method. An example of this for the subscriber.get method is shown in Figure 3.
Figure 3
API users. This tab allows you to create, edit or delete a Tariscope API user, give him access to specific methods, reset the password. An example of this page is shown in Figure 4.
Figure 4
To create a new user, click the Add icon. A window appears as shown in Figure 5.
Figure 5
In the User name box, enter a user name.
If necessary, you can add some comment in the Description box. This is an optional input field.
In the New password and Confirm password boxes, enter the password with which this user will connect to the Tariscope system.
Click the Save button.
To select the API methods that the user will have access to, select a user in the users table (Figure 4) and click the Method rights icon on the toolbar. The Claims setup for page appears, as shown in Figure 6.
Figure 6
Use the radio buttons to select the API methods that the user will have access to. Click the Save button.
This completes the configuration of access to API methods from the Tariscope system.
Next, you must write the code to execute the API methods. Access to the API requires authorization using JSON Web Tokens (JWT). To do this, you need to pass the username and password in the request body of the auth method. If authorization is successful, Tariscope will return a token 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. The default format is JSON. To specify a specific format, you must specify it in the request.
Example for POST request: /api/auth/xml
Example for GET request: /api/subscriber/get/xml/?id=1234