Subscriptions – Zapier

Last modified on September 11, 2023 at 6:17 pm

Resource URL

https://api.digitalchalk.com/api/zapier/subscription

Overview

The DigitalChalk application for Zapier uses the RestHooks standard where possible for subscribe / unsubscribe requests to Zapier triggers.  Subscriptions are made to DigitalChalk “event names” which map to Zapier trigger names.

Events

These are the events to which a Zapier user can subscribe (via creating the matching Zapier Trigger).  Each event has filters which can be applied and selected on the Zapier Trigger configuration page.  Click on the event name for a full description of the event and available filters.

  • user_created – Called when a new user is created.  If the event is a match, calls Zapier trigger Create User (dc_user_created).
  • offering_registered – Called when a student successfully registers to an offering.  If the event is a match, calls Zapier trigger Offering Registered (dc_offering_registered).
  • offering_completed – Called when a student completes an offering.  If the event is a match, calls Zapier trigger Offering Completed (dc_offering_completed).
  • element_completed – Called when a student completes one element of an offering.  If the event is a match, calls Zapier trigger Element Completed (dc_element_completed).

Use Cases

GET REQUEST

OperationCallDescription
Available offerings for registrationGET /api/zapier/subscription/{{event_name}}Get a sample event response, often used in Zapier’s perform function.

GET PARAMETERS

  • event_name – A valid event name (see above for list of valid event names)

GET RESPONSE EXAMPLE

See specific Event page (from Events above) for example of response.

POST REQUEST

OperationCallDescription
Subscribe to an eventPOST /api/zapier/subscription/{{event_name}}Subscribe to a valid event

POST PARAMETERS

  • event_name – A valid event name (see above for list of valid event names)

POST BODY

{
    "hookUrl" : "[hookUrl as provided by Zapier]",
    "filter1" : "filter1 value",
    "filter2" : "filter2 value",.....
}
  • hookUrl – The callback URL for the event as provided by Zapier (required)
  • filter1, filter2…. – Event specific filters and their values, used to match which events to send or not. Filters can be specified on the trigger configuration page.  See individual Event pages for available filters. (Optional)

POST RESPONSE EXAMPLE

Post returns status code 201 (Created) if subscription was successful.  It also returns an non-null but empty JSON object on success.  On failure, failure reason is stored in the status code reason.

DELETE REQUEST

OperationCallDescription
Unsubscribe from an eventDELETE /api/zapier/subscription/{{event_name}}Unsubscribe from an event

DELETE PARAMETERS

  • event_name – A valid event name (see above for list of valid event names)

DELETE RESPONSE EXAMPLE

Delete returns status code 204 (No Content) on successful unsubscribe.  On failure, failure reason is stored in the status code reason.