Webhook GET

URI

https://{DATACENTER}.brightpearlconnect.com/public-api/{ACCOUNT}
/integration-service/webhook/{ID-SET}

Refer to our documentation on URI syntax for more information on how to construct URIs.

Description

This message allows you to retrieve previously registered webhooks. See the documentation on Webhook POST for details of expected fields and lengths.

Note The ID Set is the request URI is optional and if not supplied all existing webhooks will be returned.

Example 1

GET all previously registered webhooks.

Request URI

/webhook

Response

{
	"response": [
		{
			"id": 2,
			"subscribeTo": "goods-out-note",
			"httpMethod": "POST",
			"uriTemplate": "http://www.example.com/callback",
			"bodyTemplate": "{\"accountCode\": \"${account-code}\", \"resourceType\": \"${resource-type}\", \"id\": \"${resource-id}\", \"lifecycleEvent\": \"${lifecycle-event}\", \"fullEvent\": \"${full-event}\" }",
			"contentType": "application/json",
			"idSetAccepted": true,
			"qualityOfService": 1
		},
		{
			"id": 3,
			"subscribeTo": "product.deleted",
			"httpMethod": "GET",
			"uriTemplate": "http://www.example.com/callback/${account-code}/${resource-type}/${resource-id}/${lifecycle-event}",
			"idSetAccepted": true,
			"qualityOfService": 1
		},
		{
			"id": 4,
			"subscribeTo": "product",
			"httpMethod": "POST",
			"uriTemplate": "http://www.example.com/callback",
			"bodyTemplate": "{\"accountCode\": \"${account-code}\", \"resourceType\": \"${resource-type}\", \"id\": \"${resource-id}\", \"lifecycleEvent\": \"${lifecycle-event}\" }",
			"contentType": "application/json",
			"idSetAccepted": true,
			"qualityOfService": 0
		}
	]
}

Example 2

Requesting webhook using id set

Request URI

/webhook/2,4

Response

{
	"response": [
		{
			"id": 2,
			"subscribeTo": "goods-out-note",
			"httpMethod": "POST",
			"uriTemplate": "http://www.example.com/callback",
			"bodyTemplate": "{ \"accountCode\": \"${account-code}\", \"resourceType\": \"${resource-type}\", \"id\": \"${resource-id}\", \"lifecycleEvent\": \"${lifecycle-event}\" }",
			"contentType": "application/json",
			"idSetAccepted": true,
			"qualityOfService": 1
		},
		{
			"id": 4,
			"subscribeTo": "product",
			"httpMethod": "POST",
			"uriTemplate": "http://www.example.com/callback",
			"bodyTemplate": "{ \"accountCode\": \"${account-code}\", \"resourceType\": \"${resource-type}\", \"id\": \"${resource-id}\", \"lifecycleEvent\": \"${lifecycle-event}\" }",
			"contentType": "application/json",
			"idSetAccepted": true,
			"qualityOfService": 0
		}
	]
}