Webhooks
Less than to read
How to use the API Webhooks
Our API Webhooks functionality will allow you to receive automatic updates on events that occur while using Sage People e.g when a new Employee is created, deleted or updated, you will be able to set up a Webhook which can notify you of which Employee the event has occurred on. To use the API Webhooks, you will first need to create a Named Credential inside your Salesforce org. A Named Credential is a Salesforce object which holds the endpoint you would like the updates to be sent to. To create a Named Credential:
- Navigate to Setup.
- Search for Named Credentials in the Quick Find box (under security section).
- Select on New Named Credential.
- Give your Named Credential a Label (this will be used in List views and reports).
- Give a Name for this Named Credential.
- In the URL section, give the URL of the endpoint you would like the updates to be sent to.
-
Save the Named Credential.
Once you have created a Named Credential, you will need to create an instance of the Webhook Object which will hold a reference to the Named Credential you have just created. This is a Custom Metadata Type we have created to allow flexibility when creating and configuring Webhooks.
- Navigate to Setup.
- Search for Custom Metadata Types.
- Select on Manage Records on the Api Change Event Webhook Metadata type.
- Select on New.
- Enter the Label and Name for this Webhook.
- On the Named Credential Name box, give the exact Name of the Named Credential which holds the endpoint for this Webhook.
- Tick the checkbox of the Object you would like to receive updates on e.g Employee.
- You also have the option to make this Webhook active or not active by ticking the Active checkbox.
-
Select Save.
At the moment, we only provide Webhooks to Employee Changes, when a new Employee is created or updated then the Id of the Employee is sent to the specified endpoint. The content body of the Webhook will look like the following:
{
"id": "a2G7E000000LlIDUA0"
}