How to get a GpsGate API token and authorization in REST with Python

This guide shows how to log in to an application using REST and get an API token to authenticate yourself in Python. 


Once you get the token as upper guide, we could put it on a variable for example tk. 

Authorizing use of the token

To send an authorization request to GpsGate REST API, you need to select the GET method with an authorization key (the token obtained previously), as in the sample code below.

Sample of loading a user list with REST:

url1 = ""

headers = {
"accept" : "application/json",
"Authorization": str(tk)

resp = requests.get(url1, headers=headers)

if resp.status_code != 200:
print('error: ' + str(resp.status_code))
print('User List Loaded Successfully')