Test Your Webhook URL

1 minute read

To receive events from us, you need to configure a webhook target URL. A target URL is usually a special URL where a server is waiting to interpret a JSON payload and run custom logic when a certain event happens.

After you create a webhook and the event mentioned in it happens, you will receive a notification to your webhook URL. However, this will happen only if the URL you provided is correct and the server is properly configured.

To be on the safe side, test your URL by sending this POST request.

POST /test/webhooks/notifications

Header Value
Content-Type application/json
Parameter Parameter type Example value
request Body See below

Example request:

POST https://sb2api.servicechannel.com/v3/test/webhooks/notifications HTTP/1.1
Authorization: Bearer {access_token}
Content-Type: application/json

{
   "Url": "yourCompany.com/webhook-target-URL"
}

Response code: HTTP/1.1 201 Created

If the POST succeeds, you should receive a test JSON payload to your target URL. If the request fails, you will see an error message with more details on the failure.

Test event:

Sign-Type: HMACSHA256
Sign-Data: NmU8bbuG/FT/fOQqUBXTMcZgQj1EZ4SIaC1Lmg8XuNg=
Content-Type: application/json; charset=utf-8
Content-Length: 576

{
   "Object": {
      "Id": 84409626,
      "Number": "84409626",
      "PurchaseNumber": "84409626",
      "SubscriberId": 2000001305,
      "ProviderId": 2000077517,
      "LocationId": 1200016330,
      "Status": {
         "Primary": "OPEN"
      },
      "CreatedBy": "TestUserName",
      "CallDate": "2018-02-14T10:44:16.0067109Z",
      "Priority": "Normal",
      "Trade": "DOORS",
      "ScheduledDate": "2018-03-14T10:44:16.0067109Z",
      "ExpirationDate": "2018-03-14T10:44:16.0067109Z",
      "Description": "The door of room 25 shuts with a weird grinding noise.",
      "Category": "REPAIR",
      "CurrencyAlphabeticalCode": "USD",
      "ProblemCode": "Noisy",
      "Source": "WebhookTest"
   },
   "EventType": "WorkOrderCreated"
}

For more information about receiving notifications from SC, see Receive Events and Respond.