Tariscope 4.6.Tariscope API guide
Example of using Tariscope API
Before executing any API requests to Tariscope, you must first obtain a token, which will be used to authorize in Tariscope when executing API methods.
Obtaining a token is performed using the api.auth method. The token is valid for 6 hours. After that, you must obtain a new token.
An example of executing a request to Tariscope using the Tariscope API will be demonstrated using the Postman program.
Getting a token
To execute any API methods, you must be authorized in the system. To do this, execute the /api/auth method.
Select the Post method and enter a request to connect to the computer where Tariscope is installed (Figure 1).
Figure 1
Example query:
http://localhost:7000/api/auth
localhost is used only when the application making the API request is on the same server as the Tariscope software. Otherwise, use the IP address of the Tariscope server.
7000 in this example is the IP port that Tariscope is running on. By default, when installing Tariscope, the suggested IP port is 8085.
/api/auth is a method for authorization in the system.
Before sending a request in the (Body)of the request, you should select row, set the JSON format and enter the API user name (username) and his password (password) in this format.
After that, click on the Send button. If all the parameters are set correctly, you will receive a response in JSON format, from where you should copy the token (Figure 2). You should copy only the value of the “token” parameter.
Figure 2
To perform all other Tariscope API methods, this token must be inserted into the Authorization tab in the Token position.