The MyWorkPal platform provides a RESTful API which can enable external applications to interface with the platform. To be able to make use of the API, an API client needs to be set up. An API client has the credentials and permissions for an external application to connect to the API. You are able to create API clients in the MyWorkPal admin portal (if your admin account has the necessary permissions). To do this, select the BackOffice > Users > API Clients menu:
You will be directed to the API Clients page where you will able to add, delete or update API clients.
To add a new API client, click the 'Add API Client' button. You will be presented with the following page:
You will be required to enter the following details:
Client ID | The ID of the API client - effectively the username. This will be used by an external app along with secret to identify the API client they will be using when connecting to the API. |
Client name | The name of the API Client, for display in the admin screens only. |
Client secret | The secret/password of the API client. This will be used by an external app to authenticate the API client |
Admin User | This will be the account that is impersonated by the API client. This account will need the necessary permissions for API end points to be accessible to the API client. IMPORTANT: This admin account should be set up with the least necessary privileges required by the API client. Remember that you could potentially give an external app full privileges to the platform so be mindful of the security risk. See How to create admin users to view how to set this account up with the relevant roles and permissions. |
Custom throttling | This sets whether custom throttling will be implemented for this API client. If enabled, you are able to limit the number of requests an API Client can make to the API. You are able to limit request by second, minute, hour, day or week. Setting a value of 0 means unlimited. |
Enabled | This sets if an API client is enabled or not. Only enabled API clients can be used to connect to the API. |
Click the 'Save API client' button to save the API client details. You will be returned to the API Clients list page.
You are able to add new API clients or edit/delete existing API Clients from this page.
Any enabled API clients will be available for use immediately.
Custom throttling
The default throttling policy for API clients is 1 request per sec, 5 requests per min. This means that you can at most, post 1 request every second to a max of 5 requests per minute. At the moment, your API client does not have custom throttling enabled so the default is being used. You are fully in control of how the throttling is set up for the API client.
E.g: this would enable you to make 5 requests per second, to a max of 200 requests per minute
Using the example above, if you sent more than 5 requests every second, you would start hitting 429 quote exceeded responses. If you keep to 5 requests per second, and send every second, you would start hitting 429 quote exceeded responses after 41 seconds because the 200 request per minute would have been reached.
You don't have to set throttling values for each box. You could just set requests per minute to 300 and leave everything else blank (blank meaning unlimited).