How to get an API token and authorization in REST

This guide shows how to login to an application using REST and get an API token to authenticate yourself in the following requests.

Requisites

Getting the token

To get the token, we will use GpsGate helper tool. 

It is also possible to obtain the token using 3rd party tools, but this is not covered in this guide.

1. Go to https://<your server>/comGpsGate/api/v.1/test  where <your server> is your server URL. Note that you might have to enter HTTP or HTTPS at the beginning of the URL depending on your server configuration.

2. Go to the Tokens resources part and click on it to expand.

mceclip0.png

3. Enter the applicationID, username and password and click on Execute.

mceclip1.png

You will now see your authorization token in the results.

mceclip2.png

4. Copy/save this authorization key for later use.

Login using the token

1. Go to the top of the URL https://<your server>/comGpsGate/api/v.1/test

2. Click on the top-right button Authorize

mceclip1.png

3. Paste the token ID generated above and click in Authorize

mceclip2.png

You will get a confirmation message

 mceclip3.png

Now you're logged into the system and can start using the rest of the resources available.