# Webhooks
#Available from v.3.11.0 Webhooks are used to notify external systems of changes within Struct PIM through a web request
GET /webhooks Get all configured webhooks
[
{
"Uid": "155824ec-7788-4c16-a46b-bd89c7614517",
"Title": "Website integration",
"Url": "https://someeventhub.com/triggerme",
"Active": true,
"EnabledEvents": [
"variants:created",
"variants:updated",
"variants:deleted"
],
"AdvancedSettings": {
"variants:updated": {
"ConditionalTriggering": true,
"TriggerOnProductIdUpdates": false,
"TriggerOnVariantGroupIdUpdates": false,
"TriggerOnSortOrderUpdates": false,
"TriggerOnVariantGroupSortOrderUpdates": false,
"TriggerOnArchivingUpdates": false,
"TriggerOnAttributeUpdates": 2,
"DataModelType": 2
}
}
},
{
"Uid": "50136e24-22fb-44e6-8124-0280421a899c",
"Title": "Website integration",
"Url": "https://integrations.com/productupdate",
"Active": true,
"EnabledEvents": [
"products:created",
"products:updated"
]
}
]
Response status OK (200)
Property name | Data type | Description |
---|---|---|
Uid | string |
Unique id of webhook |
Title | string |
Title of webhook |
Url | string |
Url for the webhook to request when triggered |
Active | boolean |
Activate / deactivate webhook |
EnabledEvents | array |
Events this webhook shall act on |
AdvancedSettings | object |
Advanced settings for events supporting this |
RequestHeaders | array : RequestHeader |
Request headers to be added to webhook requests |
Property name | Data type | Description |
---|---|---|
Name | string | |
Value | string |
PUT /webhooks Update a webhook
{
"Uid": "fd6466b0-56f1-4105-a8a3-328cf341bf89",
"Title": "Website integration",
"Url": "https://someeventhub.com/triggerme",
"Active": true,
"EnabledEvents": [
"variants:created",
"variants:updated",
"variants:deleted"
],
"AdvancedSettings": {
"variants:updated": {
"ConditionalTriggering": true,
"TriggerOnProductIdUpdates": false,
"TriggerOnVariantGroupIdUpdates": false,
"TriggerOnSortOrderUpdates": false,
"TriggerOnVariantGroupSortOrderUpdates": false,
"TriggerOnArchivingUpdates": false,
"TriggerOnAttributeUpdates": 2,
"DataModelType": 2
}
}
}
Request parameters
Property name | Parameter type | Data type | Description |
---|---|---|---|
webhook | body | object : WebhookModel |
Webhook to update |
Property name | Data type | Description |
---|---|---|
Uid | string |
Unique id of webhook |
Title | string |
Title of webhook |
Url | string |
Url for the webhook to request when triggered |
Active | boolean |
Activate / deactivate webhook |
EnabledEvents | array |
Events this webhook shall act on |
AdvancedSettings | object |
Advanced settings for events supporting this |
RequestHeaders | array : RequestHeader |
Request headers to be added to webhook requests |
Property name | Data type | Description |
---|---|---|
Name | string | |
Value | string |
Response status OK (200)
POST /webhooks Create a new webhook
{
"Uid": "ab4b7eeb-6f7e-4df6-bd64-7cb1e6a96e4f",
"Title": "Website integration",
"Url": "https://someeventhub.com/triggerme",
"Active": true,
"EnabledEvents": [
"variants:created",
"variants:updated",
"variants:deleted"
],
"AdvancedSettings": {
"variants:updated": {
"ConditionalTriggering": true,
"TriggerOnProductIdUpdates": false,
"TriggerOnVariantGroupIdUpdates": false,
"TriggerOnSortOrderUpdates": false,
"TriggerOnVariantGroupSortOrderUpdates": false,
"TriggerOnArchivingUpdates": false,
"TriggerOnAttributeUpdates": 2,
"DataModelType": 2
}
}
}
Request parameters
Property name | Parameter type | Data type | Description |
---|---|---|---|
webhook | body | object : WebhookModel |
Webhook to create |
Property name | Data type | Description |
---|---|---|
Uid | string |
Unique id of webhook |
Title | string |
Title of webhook |
Url | string |
Url for the webhook to request when triggered |
Active | boolean |
Activate / deactivate webhook |
EnabledEvents | array |
Events this webhook shall act on |
AdvancedSettings | object |
Advanced settings for events supporting this |
RequestHeaders | array : RequestHeader |
Request headers to be added to webhook requests |
Property name | Data type | Description |
---|---|---|
Name | string | |
Value | string |
Response status OK (200)
GET /webhooks/{uid} Get a webhook
#Available from v.3.11.0
{
"Uid": "930f703a-afcb-4670-80f3-f9deae5bbd9d",
"Title": "Website integration",
"Url": "https://someeventhub.com/triggerme",
"Active": true,
"EnabledEvents": [
"variants:created",
"variants:updated",
"variants:deleted"
],
"AdvancedSettings": {
"variants:updated": {
"ConditionalTriggering": true,
"TriggerOnProductIdUpdates": false,
"TriggerOnVariantGroupIdUpdates": false,
"TriggerOnSortOrderUpdates": false,
"TriggerOnVariantGroupSortOrderUpdates": false,
"TriggerOnArchivingUpdates": false,
"TriggerOnAttributeUpdates": 2,
"DataModelType": 2
}
}
}
Request parameters
Property name | Parameter type | Data type | Description |
---|---|---|---|
uid | path | string |
Uid of webhook |
Response status OK (200)
Property name | Data type | Description |
---|---|---|
Uid | string |
Unique id of webhook |
Title | string |
Title of webhook |
Url | string |
Url for the webhook to request when triggered |
Active | boolean |
Activate / deactivate webhook |
EnabledEvents | array |
Events this webhook shall act on |
AdvancedSettings | object |
Advanced settings for events supporting this |
RequestHeaders | array : RequestHeader |
Request headers to be added to webhook requests |
Property name | Data type | Description |
---|---|---|
Name | string | |
Value | string |
DELETE /webhooks/{uid} Delete a webhook
Request parameters
Property name | Parameter type | Data type | Description |
---|---|---|---|
uid | path | string |
Uid of webhook to delete |
Response status OK (200)
GET /webhooks/{webhookUid}/requests Get requests made from a webhook. Note that webhook requests are only stored for 14 days
{
"WebhookRequests": [
{
"Uid": "715782e7-e7a6-4b81-859b-ba796959e702",
"WebhookUid": "578f4c10-0994-4c59-8bc1-39d0305ad94f",
"WebhookUrl": "https://structintegration.com/pimevent",
"EventKey": "products:updated",
"EventTimestamp": "2024-01-17T22:33:27.2512281+01:00",
"RequestTimestamp": "2024-01-17T22:33:27.2612281+01:00",
"RequestHeaders": {
"X-Event-Key": "products:updated",
"X-User": "[email protected]",
"X-Hook-UID": "578f4c10-0994-4c59-8bc1-39d0305ad94f",
"X-Request-UID": "715782e7-e7a6-4b81-859b-ba796959e702"
},
"RequestBody": "{\"ProductIds\":[2385147],\"TransactionUid\":\"40239249-8feb-4e22-b854-fd693ce1d8a7\"}",
"ElapsedMilliseconds": 57,
"ResponseCode": 200,
"ResponseHeaders": {
"Pragma": "no-cache",
"Cache-Control": "no-cache",
"Date": "Fri, 03 Feb 2023 13:07:40 GMT"
},
"IsRetry": false
}
],
"Page": 1,
"TotalHits": 1
}
Request parameters
Property name | Parameter type | Data type | Description |
---|---|---|---|
webhookUid | path | string |
Uid of webhook |
since | query | string |
return webhook requests newer than this timestamp |
onlyFailed | query | boolean |
Only return failed webhook requests |
page | query | integer |
Page to get (1 is first page) |
Response status OK (200)
Property name | Data type | Description |
---|---|---|
WebhookRequests | array : WebhookRequestModel |
Webhook requests that matched the criteria |
Page | integer |
Page of the search request |
TotalHits | integer |
Total number of hits in the search |
Property name | Data type | Description |
---|---|---|
Uid | string |
Unique id of this webhook request (Passed in the X-Request-UID header of the request) |
WebhookUid | string |
Unique id of the webhook that triggered the request (Passed in the X-Hook-UID header of the request) |
WebhookUrl | string |
Url that was called |
EventKey | string |
The key of the event that triggered the event (Passed in the X-Event-Key header of the request) |
EventTimestamp | string |
Timestamp of the event that triggered the webhook request |
RequestTimestamp | string |
Timestamp of when the webhook request was made |
RequestHeaders | object |
The request headers sent in the webhook request |
RequestBody | string |
The request body sent in the webhook request |
ElapsedMilliseconds | integer |
The time in ms it took to get a response from the recipient of the request |
ResponseCode | integer |
The response code of the webhook request |
ResponseHeaders | object |
The response headers received from the request |
ParentWebhookRequestUid | string |
Uid of parent webhook request (only has value, if this is a retry of a failed webhook requeest) |
IsRetry | boolean |
Indicates whether this request is a retry of a previously failed request |
GET /webhooks/{webhookUid}/requests/{requestUid} Get a specific request made from a webhook. Note that webhook requests are only stored for 14 days
{
"Uid": "715782e7-e7a6-4b81-859b-ba796959e702",
"WebhookUid": "578f4c10-0994-4c59-8bc1-39d0305ad94f",
"WebhookUrl": "https://structintegration.com/pimevent",
"EventKey": "products:updated",
"EventTimestamp": "2024-01-17T22:33:27.2522257+01:00",
"RequestTimestamp": "2024-01-17T22:33:27.2622257+01:00",
"RequestHeaders": {
"X-Event-Key": "products:updated",
"X-User": "[email protected]",
"X-Hook-UID": "578f4c10-0994-4c59-8bc1-39d0305ad94f",
"X-Request-UID": "715782e7-e7a6-4b81-859b-ba796959e702"
},
"RequestBody": "{\"ProductIds\":[2385147],\"TransactionUid\":\"40239249-8feb-4e22-b854-fd693ce1d8a7\"}",
"ElapsedMilliseconds": 57,
"ResponseCode": 200,
"ResponseHeaders": {
"Pragma": "no-cache",
"Cache-Control": "no-cache",
"Date": "Fri, 03 Feb 2023 13:07:40 GMT"
},
"IsRetry": false
}
Request parameters
Property name | Parameter type | Data type | Description |
---|---|---|---|
webhookUid | path | string |
Uid of webhook |
requestUid | path | string |
Uid of webhook request |
Response status OK (200)
Property name | Data type | Description |
---|---|---|
Uid | string |
Unique id of this webhook request (Passed in the X-Request-UID header of the request) |
WebhookUid | string |
Unique id of the webhook that triggered the request (Passed in the X-Hook-UID header of the request) |
WebhookUrl | string |
Url that was called |
EventKey | string |
The key of the event that triggered the event (Passed in the X-Event-Key header of the request) |
EventTimestamp | string |
Timestamp of the event that triggered the webhook request |
RequestTimestamp | string |
Timestamp of when the webhook request was made |
RequestHeaders | object |
The request headers sent in the webhook request |
RequestBody | string |
The request body sent in the webhook request |
ElapsedMilliseconds | integer |
The time in ms it took to get a response from the recipient of the request |
ResponseCode | integer |
The response code of the webhook request |
ResponseHeaders | object |
The response headers received from the request |
ParentWebhookRequestUid | string |
Uid of parent webhook request (only has value, if this is a retry of a failed webhook requeest) |
IsRetry | boolean |
Indicates whether this request is a retry of a previously failed request |