5.2 Manage content removals via the content decommission webhook

Get notified when Go1 content has been flagged for decommissioning, so you can notify Administrators and Learners, and remove content from your application.

Overview

The Content Decommission Webhook fires near real-time notifications anytime content has been flagged for removal from your Go1 library.

These decommission events can then be reflected in your application, to ensure Administrators and Learners are given as much notice as possible before the content becomes unavailable, and then removed altogether before it does.

Content flagged for decommission will be accessible to learners until the remove_time specified in the webhook itself. The content will then be removed from Go1 and will no longer be accessible to users within your application.

How it works

There are three steps to successfully set up and utilise the Content Decommission Webhook:

  1. Create a Content Decommission Webhook
  2. Receive webhooks for Content Decommission events
  3. Action the Content Decommission in your application

These steps are detailed below.

1. Create an Content Decommission webhook

Create your Content Decommission Webhook in Go1’s API.

Before creating a webhook, ensure you have an Endpoint URL to which you wish Go1 to send event notifications. It must be a valid URL.

Create a webhook using Go1's API (V3)

The Content Decommission Webhook can be configured only on the newest version of Go1’s API (V3).

See our Go1 API Reference (V3) for further details.

Sample Request

curl --location --request POST 'https://gateway.go1.com/webhooks' \
--header "Content-Type: application/json" \
--header "Authorization: {access_token}" \
--header "Api-Version: 2022-07-01" \
--data-raw '{
    "name": "My webhook for decommissioning content",
    "url": "https://webhook-consumer.com",
    "secret_key": "MyS3cretK#y",
    "event_types": ["content.decommission"],
}'

The Header

When sending a V3 API request, you are required to explicitly set the API version by sending an Api-Version header with your request (see line 4 below).

This is an example of header included in a POST request to V3 of Go1’s API:

curl --location --request POST 'https://gateway.go1.com/webhooks' \
--header "Content-Type: application/json" \
--header "Authorization: {access_token}" \
--header "Api-Version: 2022-07-01" \

The access_token sent in the Authorization parameter determines the Go1 portal for which you’ll receive webhook events.

For partners, provide your partner portal access token to receive events from child portals

See Authentication and Authorization for details on generating access tokens.

The Body

The following POST request creates an Content Decommission Webhook:

{
    "name": "My webhook for decommissioning content",
    "url": "https://webhook-consumer.com",
    "secret_key": "MyS3cretK#y",
    "event_types": ["content.decommission"],
}

The name and secret_key parameters are optional.

2. Receive webhooks for Content Decommission events

When Go1 course is flagged for decommission the content.decommission event will fire a payload.

{
  "id": "hg4JWUDbT55B",
  "event_type": "content.decommission",
  "webhook_version": "3.0.0",
  "sent": "2022-03-29T01:29:36.676Z",
  "attempt_number": 1,
  "url": "https://your.webhook.endpoint.com",
  "webhook_id": "auto generated uuid will be here",
  "data": {
    "id": "3511433",
    "portal_id": "36184809",
    "event_time": "2022-11-24T22:42:20.000Z",
    "remove_time": "2023-02-24T22:42:20.000Z"
  }
}

See Webhook Events for further details on the included attributes and the webhook event object itself.

3. Action the Content Decommission in your application

When you receive a Content Decommission Webhook for a decommission event in Go1, there are a number of actions you should take in your own application to ensure:

  1. Administrators are notified of the upcoming removal, and can prompt learners to complete the course before it becomes unavailable.
  2. Enrolled learners are properly notified of any upcoming removals
  3. Decommissioned content is removed from your system on or before the date specified by the remove_time in the webhook itself.

See our Recommended Decommission Flow for a prototype of how this might look in your application.