Creating new Webhook to receive product updates
Webhooks allows Jasper PIM to call an API under your control to notify about updates on some entities like products and categories.
A webhook for products will hit the configured callback URL whenever a product is created, updated or deleted. This is usefull when you want to coordinate tasks with other softwares / services that your company uses in reaction to some new product information or status.
To create a new webhook you will have to use Jasper API (https://api.jasperpim.com/#introduction )
Here is a detailed descriptions of the properties you have to send to our API in order to create a webhook to receive product updates:
“name”: The name of the webhook. It’s always best to try to come up with a self-explanatory name.
“callback_url“: The URL Jasper PIM will request in order to delivery the webhook payload, usually an endpoint in an API under your control.
“entity_type“: The entity you want to watch. (product, category, brand, concrete_entity)
“include_entity_data”: true or false, whether the webhook payload will contain the product data or not.
“headers“: a JSON in the format of {“header“: “value”} that you want Jasper’s webhooks to send alongside the payload when calling the “callback_url”.
“retry_policy“: If the callback url responds with an error, what is the policy to retry. Can be one of the following
“no_retry”: We will not retry at all.
“linear”: Each retry will be executed after a set amount of time.
“exponential”: Each retry will take longer to be executed than the last failed one.
“minimum_retry_interval”: How many seconds to wait between each webhook retry.
“retry_limit”: How many times should Jasper PIM retry a failed webhook.
Here’s an example of a product webhook creation request:
{
"name": "Product Updates Webhook",
"callback_url": "https://myapi.com/callbacks/products",
"entity_type": "product",
"include_entity_data": true,
"headers": {
"My-Custom-Header": "abc123"
},
"retry_policy": "linear",
"minimum_retry_interval": 300,
"retry_limit": 5
}
When your webhook is created you will receive a “signing_secret” on the response payload, we will always send this secret on our webhooks so that you can know that it is comming from Jasper, take good care of it.
Check our API to get instructions on how to setup a new webhook for more information: https://api.jasperpim.com/#create-a-webhook