Last updated

Authentication

Authenticate the session using the endpoints below. If user management is enabled, authentication is required for most API calls; do this initially to include the token in other requests.

Authenticate

Send username and password to authenticate the session. Put the returned token in the authorization header of all other API requests.

Authorization: Bearer <token>

post/api/v2/authenticate
curl 'http://{{your_prep_ip_address}}/api/v2/authenticate' \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --data '{
  "username": "string",
  "password": "string"
}'
Response
The login was successful

Check authentication

Use this endpoint to check if the authentication is valid. A 200 response means the token is valid.

get/api/v2/authenticate/check-authentication
curl 'http://{{your_prep_ip_address}}/api/v2/authenticate/check-authentication' \
  --header 'Authorization: Bearer <token>'
Response
A valid token exists

Renew authentication

Use this endpoint to renew the authentication token.

post/api/v2/authenticate/renew-token
curl 'http://{{your_prep_ip_address}}/api/v2/authenticate/renew-token' \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --data '{
  "username": "string",
  "password": "string"
}'
Response
The token was renewed successfully

Logout

Use this endpoint to end a session and invalidate the token.

delete/api/v2/authenticate
curl 'http://{{your_prep_ip_address}}/api/v2/authenticate' \
  --request DELETE \
  --header 'Authorization: Bearer <token>'
Response
The user was logged out successfully