All Hours lets you import, export and modify data via API calls. To get access, first create an API key.
Open Settings > Advanced and expand the API section.
Click Create API key, enter a name, select the authorization role and confirm.
The system generates a Client ID and Client Secret. Store them in a secure place, as you will not be able to view them again.
The key is then listed in the API section. Delete a key to revoke access; you can create several keys for different applications.
Note: All supported API calls are described on the API4 website.
API Access and Example Use Case
All Hours uses a REST API (JSON) at https://api4.allhours.com, where you will also find the documentation (Swagger) describing the data structures and queries.
Authentication uses the OAuth2 protocol. Obtain a token at https://login.spica.com/connect/token (grant type client_credentials, scope api) using your Client ID and Client Secret.
Example Use Case: Retrieving Annual Leave Information
Retrieve the absence ID.
The ID is shown in the URL of the absence page in Settings > Event Definitions, or it can be retrieved with an API query.
Run an API call that returns:
Absence status codes
The absence status field has the following values:
0 – automatically approved (no approval workflow)
1 – pending approval
2 – approved
3 – rejected
4 – automatically approved, other approvers receive a notification of the automatic approval









