Getting started with the API

The following diagram shows the steps needed to use the API.

Use this endpoint to get authorization token (access_token):

Request URL: https://webapi.rhpro.com/admin/authentication/login
Request Method: POST
Content-type Header: application/x-www-form-urlencoded
Body Payload: username=[username]&password=[password]&grant_type=password

Parameter description
username: username.
password: password.
grant_type: Use the fixed value 'password'

Use this endpoint to get the logged-in user tenants:

Request URL: https://webapi.rhpro.com/admin/account/tenants
Request Method: GET

Headers
Authorization: Bearer [access_token] (example value: Bearer 5YpAc8D1.....NAKTA)

Once you obtain the token (first step) and the tenant (second step) you can call any bussiness endpoint. As example, we show the endpoint to get the list of employees:

Request URL: https://webapi.rhpro.com/webapi/employees
Request Method: GET

Headers
Authorization: Bearer [access_token] (example value: Bearer 5YpAc8D1.....NAKTA)
X-RAET-Tenant-Id: Tenant Id (example value: 909)