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>
- Mock server
http://{{your_prep_ip_address}}/api/v1/authenticate
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'http://{{your_prep_ip_address}}/api/v1/authenticate' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json-patch+json' \
-d '{
"username": "string",
"password": "string"
}'{ "userName": "_userName1_", "userId": "1142c805484f4ffb9f1b92a66b47ef71", "token": "Z5UmVtb3RlU2V0dGluZ3MiLCJNb2RpZnlCYXNlU2V0dGluZ3MiLCJNb2RpZnlUZWNobmljYWxTZXR0aW5ncyIsIkV4ZWN1dGVWYWxpZGF0ZWRJdGVtcyIsIkV4ZWN1dGVOb25WYWxpZGF0ZWRJdGVtcyIsIkVkaXRTY2hlZHVsZSIsIlZpZXdGdW5jdGlvbnMiLCJWaWV3VXNlcnMiLCJWaWV3Um9sZXMiLCJNb2RpZnlQcmludFNldHRpbmdzIiwiQ3JlYXRlVXNlckRvY3VtZW50cyIsIyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiIzMTQyOGM4ZmQ0Yzk0MzljYmI3NTAzYzdiMGViOTU0MCIsImdpdmVuX25hbWUiOiJfX21scHJlcF9fIiwicm9sZSI6WyJDaGFuZ2VBY3RpdmVTeXN0ZW1Db25maWd1cmF0aW9uIiwiTW9kaWZ5Um9sZXMiLCJNb2RpZnlVc2VycyIsIk1vZGlmeUxhYm9yYXRvcnlTZXR0aW5ncyIsIk1vZGlmeVYmTVNldHRpbmdzIiwiTW9k", "inactiveLogout": 60, "logoutCountdown": 10, "expiresIn": 5, "passwordExpiresInDays": 0, "notifyPasswordExpiresSoon": false }
Check authentication
Use this endpoint to check if the authentication is valid. A 200 response means the token is valid.
- Mock server
http://{{your_prep_ip_address}}/api/v1/authenticate/check-authentication
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'http://{{your_prep_ip_address}}/api/v1/authenticate/check-authentication' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'No contentRenew authentication
Use this endpoint to renew the authentication token.
- Mock server
http://{{your_prep_ip_address}}/api/v1/authenticate/renew-token
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'http://{{your_prep_ip_address}}/api/v1/authenticate/renew-token' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json-patch+json' \
-d '{
"username": "string",
"password": "string"
}'{ "userName": "_userName1_", "userId": "1142c805484f4ffb9f1b92a66b47ef71", "token": "Z5UmVtb3RlU2V0dGluZ3MiLCJNb2RpZnlCYXNlU2V0dGluZ3MiLCJNb2RpZnlUZWNobmljYWxTZXR0aW5ncyIsIkV4ZWN1dGVWYWxpZGF0ZWRJdGVtcyIsIkV4ZWN1dGVOb25WYWxpZGF0ZWRJdGVtcyIsIkVkaXRTY2hlZHVsZSIsIlZpZXdGdW5jdGlvbnMiLCJWaWV3VXNlcnMiLCJWaWV3Um9sZXMiLCJNb2RpZnlQcmludFNldHRpbmdzIiwiQ3JlYXRlVXNlckRvY3VtZW50cyIsIyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiIzMTQyOGM4ZmQ0Yzk0MzljYmI3NTAzYzdiMGViOTU0MCIsImdpdmVuX25hbWUiOiJfX21scHJlcF9fIiwicm9sZSI6WyJDaGFuZ2VBY3RpdmVTeXN0ZW1Db25maWd1cmF0aW9uIiwiTW9kaWZ5Um9sZXMiLCJNb2RpZnlVc2VycyIsIk1vZGlmeUxhYm9yYXRvcnlTZXR0aW5ncyIsIk1vZGlmeVYmTVNldHRpbmdzIiwiTW9k", "inactiveLogout": 60, "logoutCountdown": 10, "expiresIn": 5, "passwordExpiresInDays": 0, "notifyPasswordExpiresSoon": false }
Logout
Use this endpoint to end a session and invalidate the token.
- Mock server
http://{{your_prep_ip_address}}/api/v1/authenticate
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
'http://{{your_prep_ip_address}}/api/v1/authenticate' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'