All pages
Powered by GitBook
1 of 1

Loading...

Authenticate employee

Here, you can learn how to make an API call to authenticate an employee. Once you execute the call successfully, you will receive a JSON web token that permits you to make authorised API calls to other Tuum API endpoints.

Sample API call

To authenticate an employee, make the following API call.

Sample request

Below is an example request body of the API call for authentication of an employee.

{
"username": "employee_username",
"password": "employee_password"
}
curl -X POST 'https://auth-api.sandbox.tuumplatform.com/api/v1/employees/authorise' \
-H 'Content-Type: application/json' \
--data-raw '{
"username": "employee_username",
"password": "employee_password"
}'

Please make sure to input the username and password of the particular employee when submitting your request.

Sample response

Below you find an example response body to the API call above.

Response
{
    "errors": null,
    "validationErrors": null,
    "data": {
        "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHBpcnlEVGltZSI6IjIwMjMtMDMtMDhUMDg6NDg6NDkiLCJyb2xlcyI6WyJBRE1JTiJdLCJuYW1lIjoiSm9obiBPZmZpY2VyIiwiZW1wbG95ZWVJZCI6IjEiLCJ0ZW5hbnRDb2RlIjoiTUIiLCJleHAiOjE2NzgyNjUzMjl9.G7rqNTJbeyMdMy1ZGwu1G7JRSvwAg084IiBYhOEz4I8"
    }
}

Result

An employee is authenticated, and a JSON Web Token is returned in the response.

In order to make authorised API calls, the JSON Web Token that was received must be used as a parameter value for the x-auth-token header parameter.

https://auth-api.sandbox.tuumplatform.com/api/v1/employees/authorise

Learn more about the endpoint in the Tuum developer portal.

authenticate employee