Payload
When you subscribe to the Content viewed webhook, your URL is sent a JSON payload with details of the event.Request headers
Headers sent to your URL
X-Zapnito-Hostnameis the hostname of the Zapnito community that sent the event.Authorizationis only sent if you set anauthorization_tokenwhen you created the subscription.
Example payload
Create a subscription
The URL you want Zapnito to notify when a piece of content is viewed on your community.
A token that Zapnito sends in the
Authorization header of each request to your URL, in the format Token token=YOUR_ENDPOINT_TOKEN.Create a subscription
POST https://your-community.zapnito.com/api/v1/rest_hooks/content_viewed/subscriptions
201 Created: the subscription was created. The response body is{"id": "27"}. Keep theidso you can delete the subscription later.
Delete a subscription
Remove a previously registered URL for the Content viewed webhook.Delete a subscription
DELETE https://your-community.zapnito.com/api/v1/rest_hooks/content_viewed/subscriptions/:id
204 No Content: the subscription was deleted.404 Not Found: no subscription matches the provided ID.

