Skip to main content
Subscribe a URL of your choosing to be notified when a user downloads a document on your community. Before you start, read the webhooks overview for how subscriptions and authentication work.

Payload

When you subscribe to the Document downloaded webhook, your URL is sent a JSON payload with details of the event.

Request headers

Headers sent to your URL
  • X-Zapnito-Hostname is the hostname of the Zapnito community that sent the event.
  • Authorization is only sent if you set an authorization_token when you created the subscription.

Example payload

Create a subscription

string
required
Your API token in the format Token token=YOUR_API_TOKEN.
string
required
The URL you want Zapnito to notify when a user downloads a document on your community.
string
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/document_downloaded/subscriptions
  • 201 Created: the subscription was created. The response body is {"id": "27"}. Keep the id so you can delete the subscription later.

Delete a subscription

Remove a previously registered URL for the Document downloaded webhook.
string
required
Your API token in the format Token token=YOUR_API_TOKEN.
integer
required
The ID of the subscription that was returned when you created it.
Delete a subscription
DELETE https://your-community.zapnito.com/api/v1/rest_hooks/document_downloaded/subscriptions/:id
  • 204 No Content: the subscription was deleted.
  • 404 Not Found: no subscription matches the provided ID.