Reach 360: Webhooks API

Article Last Updated

This article applies to:

What This API Endpoint Does

With the Webhooks API you create or delete webhooks from available webhook events. Whoever has access to the app where the webhook is sending the information sees course completion, course submission for publication, user and group enrollment in courses and learning paths, or when a user is added to your Reach 360 account.

You can also use this endpoint to get a list of webhooks or details of a specific webhook.


Endpoints

  • POST /webhooks - create a new webhook
  • GET /webhooks - list webhooks
  • GET /webhooks/{webhookId} - get details of a webhook by webhook id
  • DELETE /webhooks/{webhookId} - delete a webhook by webhook id

Objects

  • id (string) - the unique identifier of the webhook
  • targetUrl (string) - the URL of the webhook endpoint on your server
  • sharedSecret (string) - a secret used to generate a signature for each request. Only returned when creating a webhook
  • events (list of webhook events) - the list of webhook events enabled for this webhook
  • apiVersion (string) - API Version used when sending the webhook event

Create Webhook

POST /webhooks

Request Parameters (JSON)

  • targetUrl (string, required)
  • events (list of webhook events, required)
  • sharedSecret (string, optional)
  • apiVersion (string, optional) - API Version to use for the webhook event. If not provided, will default to the API-Version header sent in the request, or, if that's not specified, the initial API Version, 2023-04-04

Example response

{
  "id": "example-webhook-id",
  "targetUrl": "<https://example.com>",
  "events": ["course.completed", "user.created"],
  "sharedSecret": "the shared secret",
  "apiVersion": "2023-05-04",
  "url": "<https://api.reach360.com/webhooks/example-webhook-id>",
}

Endpoint-specific error codes:

  • duplicate_target_url - cannot create webhook because the targetUrl is already in use by another webhook. A 409 response will be returned in this case

List Webhooks

GET /webhooks

Request Parameters (Query String)

  • limit (integer, optional) - the maximum number of results to return in a single response (see Pagination); must be between 1 and 2000 (defaults to 50)

Example response

{
  "webhooks": [
    {
      "id": "example-webhook-id",
      "targetUrl**":** "<https://example.com>",
      "events": ["course.completed", "user.created"],
      "apiVersion": "2023-05-04",
      "url": "<https://api.reach360.com/webhooks/example-webhook-id>"
    ****}, ...
  ],
  "nextUrl": "<https://url-for-next-page-of-results>"
}

Retrieve Webhook by ID

GET /webhooks/{webhookId}

Example response

{
  "id": "example-webhook-id",
  "targetUrl": "<https://example.com>",
  "events": ["course.completed", "user.created"],
  "apiVersion": "2023-05-04",
  "url": "<https://api.reach360.com/webhooks/example-webhook-id>"
****}

Endpoint-specific error codes:

  • webhook_not_found - cannot retrieve webhook because the webhook doesn't exist

Delete Webhook by ID

DELETE /webhooks/{webhookId}

Success response

204 "No Content"

Endpoint-specific error codes:

  • webhook_not_found - cannot delete webhook because the webhook doesn't exist