authenticate
Overview
This method authenticates an API user and returns an access token. The access token must be passed in the Authorization header of every other API call.
Run this API first. No other API will run without a valid access token.
Permissions
No API permission is required to run this method. The username and password supplied must belong to a Catch-e user whose role is enabled for API access.
API access is enabled on a role when [gb_roles]api_access_flag is set to 'yes'. The 'Web Services' role is enabled to run APIs by default.
HTTP Method
Use the HTTP Method 'POST' for consuming this web service.
URL Examples
https://api.demo.catch-e.com/authenticate https://api.{{environment}}.catch-e.com/authenticate https://api.test.catch-e.com/authenticateInput Fields (Header)
Input Fields (Form Data)
The request body is sent as form data (application/x-www-form-urlencoded), not JSON.
Example
POST /authenticate Client-Id: [CLIENT-ID] Content-Type: application/x-www-form-urlencoded username=api.user%40example.com&password=[PASSWORD]&token_timeout=3600Response Details
Success
201 - Created
json
{ "access_token": "[ACCESS-TOKEN]", "expires_in": 3600, "token_type": "bearer" }Using the access token
Pass the token in the Authorization header of every other API request, using this syntax:
Authorization: Bearer [ACCESS-TOKEN]To get a new token before the current one expires without supplying the username and password again, use the renew API.
Error Response Details
{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unauthorized", "status": 401, "detail": "Unauthorized" }{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unauthorized", "status": 401, "detail": "Authentication Failed - Invalid Username and/or Password. Password is case sensitive." }{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unauthorized", "status": 401, "detail": "Authentication Failed - Login suspended" }{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unauthorized", "status": 401, "detail": "Authentication Failed - Login locked" }{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Not Acceptable", "status": 406, "detail": "Not Acceptable" }{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Conflict", "status": 409, "detail": "Two factor authentication code must be specified" }{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unsupported Media Type", "status": 415, "detail": "Not Acceptable" }{ "validation_messages": { "username": { "isEmpty": "Value is required and can't be empty" } }, "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unprocessable Entity", "status": 422, "detail": "Failed Validation" }{ "validation_messages": { "username": { "invalidUserFormat": "Invalid username format" } }, "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unprocessable Entity", "status": 422, "detail": "Failed Validation" }{ "validation_messages": { "password": { "isEmpty": "Value is required and can't be empty" } }, "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unprocessable Entity", "status": 422, "detail": "Failed Validation" }{ "validation_messages": { "2fa_code": { "invalidFormat": "2fa_code must be 6 digits" } }, "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unprocessable Entity", "status": 422, "detail": "Failed Validation" }{ "validation_messages": { "token_timeout": { "notDigits": "The input must contain only digits" } }, "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unprocessable Entity", "status": 422, "detail": "Failed Validation" }{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "string", "status": 599, "detail": "string" }{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "string", "status": 599, "detail": "string" }