Creating Webhooks
User requirements
To be able to create and configure webhooks a user in Caspeco is needed. This user should have the “Manage Webhooks”-permission to be able to create, view and edit the webhook configurations. In order for the user to successfully initialize the employees via webhooks, the user must have the permission to fetch all the employees in the system. An example of such a permission is “Salary administrator”.
Setting up your Webhooks
To set up a webhook, go to SYSTEM SETTINGS > Integrations in the sidebar navigation menu and then press the Webhooks tab.
From there, select an event to subscribe to in the drop-down menu and enter your endpoint URL in the right field. This is the URL your payload is sent to. Click on the Add-button to create the new webhook.
At the same page, all webhooks that are active for your system are listed. You may change the event type or endpoint URL by editing corresponding fields and press Save. To delete an active webhook press Remove.
Securing Your Webhooks (Recommended)
If you wish to secure your webhooks, head to this article: https://caspeco.atlassian.net/wiki/spaces/DD/pages/3320709227
Events
When an event is triggered you will receive a JSON payload containing the event, the system for which the event was triggered, and any additional content. See Example payloads for payload structure and content for different types of event triggers.
Event
Triggered by
employee.created
Approving an employee
employee.updated
Updating
First name of an employee
Last name of an employee
Email address of an employee
Profession of an employee
Station of an employee
Adding a new employment for an employee
employment.ended
Employment reaching its end date
Employment is removed
employee.deleted
Deleting an employee
employee.enabled
An employee is set to hidden/visible