Version: 1.0.0

Advanced - Webhooks

Content created in a Potion project can send Webhooks to a defined URL. It's especially useful when it is content not directly created by you (like Activities or Notifications)

Webhook definition

A Webhook is a JSON call made to a previously defined URL as a callback of some events like notification creation, status update, comment deletion, etc.

Activate and use Webhooks

In your administration interface, you can find the Webhooks section under the Configuration category. You can configure one webhook for each of the data type available by adding the URL that will receive the data and activate the switch to start collecting calls.

Here is all the data types that could send webhooks :

  • Statuses
  • Articles
  • Comments
  • Events
  • Gamification
  • Notifications
  • Likes
  • Users

Webhook format

A Webhook is triggered when there is an action made on a data type. You can figure what happened about the data sent under the webhook_type parameter. It could be a creation, an update or a deletion (respectively create, update and destroy values).

You will also get a JSON representation of the element concerned by that action under the data parameter.

This is a partial classic webhook query sent for a Status creation :

"webhook_type": "create",
"data": {
"id": "0hf9a28647384196b6db238603cf24ve",
"message": "I will be sent anywhere you want ! ",
"created_at": "2000-12-27T10:58:38.000+01:00",
"updated_at": "2000-12-27T10:58:38.000+01:00",
"owner": {
"slug": "john-doe",
"id": "7897f877a6eded28a6166340b191a896c9d67dbf",
"nickname": "John",
"name": "John Doe",
"picture_url": "/media_files/42",
"recommendations_count": "0",
"views": "0",
"comments_count": "0",