Authentication
Authenticates a user and returns a JWT token to be used as a bearer token in subsequent API calls.
- Credentials: Use the credentials you have received from your GeoX contact.
- Scope: The same authentication token can be used for all the API routes.
- Expiration: The authentication token expires after the duration specified in the
expiresInfield of the response body. A new login is required to obtain a fresh token.
Login Request
To obtain a token, make a POST request to the login endpoint.
POST https://us-api.geox.ai/v1/login
Example Request
- cURL
- JavaScript
- Python
curl --location 'https://us-api.geox.ai/v1/login' \
--header 'Content-Type: application/json' \
--data '{
"username": "{{username}}",
"password": "{{password}}"
}'
fetch('https://us-api.geox.ai/v1/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
username: '{{username}}',
password: '{{password}}'
})
})
.then(response => response.json())
.then(data => console.log(data));
import requests
url = "https://us-api.geox.ai/v1/login"
payload = {
"username": "{{username}}",
"password": "{{password}}"
}
headers = {
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
Example Response
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expiresIn": 3600
}
Using the Token
Once you have obtained the token, include it in the Authorization header of your subsequent API requests as a Bearer token:
Authorization: Bearer <your_token_here>