Skip to content

Authentication

Total endpoints: 2 Example base URL: https://<ROBOT_IP>/rest Required access for this section: PUBLIC for /auth/, authenticated bearer token for /auth/refresh/

Authenticate Client

  • Endpoint: /api/v2/auth/
  • Function: Authenticate client.
  • Method: GET
  • Parameters:
  • username (query, str | None). Default: None
  • Shell Command:
curl -L "https://<ROBOT_IP>/rest/api/v2/auth/?username=example"
  • Python Command:
import requests

url = "https://<ROBOT_IP>/rest/api/v2/auth/"
headers = {}
params = {'username': 'example'}
response = requests.get(url, headers=headers, params=params, timeout=10)

print(response.status_code)
print(response.json())
  • Response Example (200):
{
  "client_id": "ab12cd34",
  "access_level": "USER",
  "token": "<jwt_token>"
}

Refresh Token

  • Endpoint: /api/v2/auth/refresh/
  • Function: Refresh token.
  • Method: GET
  • Parameters: none
  • Shell Command:
curl -L "https://<ROBOT_IP>/rest/api/v2/auth/refresh/" \
  -H "Authorization: Bearer <token>" \
  -i
  • Python Command:
import requests

url = "https://<ROBOT_IP>/rest/api/v2/auth/refresh/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers, timeout=10)

print(response.status_code)
print(response.headers.get("Authorization"))
print(response.json())
  • Response Example (200):
{
  "client_id": "ab12cd34",
  "access_level": "USER"
}

The refreshed JWT is returned in the Authorization response header.