Webhooks

4.0 Webhook Format

All of the StaffCircle webhooks are sent using a HTTP POST method with a body ‘content-type’ of ‘application/json’. All requests are in the following schema.

Webhook Template

{

  "subjectType": "example",

  "changeType": "example",

  "timeStamp": "2000-10-10T00:00:00Z",

  "data": {}

  "differerences": {} // Present when changeType is ‘Updated’

}

 

Difference Template

{

     "path": "<location>", // Object graph dot notation location in the data JSON.

     "oldValue": "<oldValue>",

     "newValue": "<newValue>"

}

SubjectType Values

Comment, Article, Award, Comment, Feedback Objective, Person, Review, Survey, Task

ChangeType

Values

Created, Updated, Deleted

Below is a simple example of a change event for a comment.

{

  "subjectType": "Comment",

  "changeType": "Updated",

  "timeStamp": "2020-08-11T15:00:01.8066492Z",

  "data": {

    "id": 4882,

    "relatedItemId": 2008,

    "itemType": "article",

    "comment": "That's Great! Well done!",

    "comments": [],

    "attachedDocumentIds": [],

    "likesPersonIds": [],

    "createdAt": "2020-08-11T14:46:03.56",

    "createdByPersonId": 4522,

    "modifiedAt": "2020-08-11T15:00:01.767",

    "modifiedByPersonId": 4522

  },

  "differences": [

    {

      "path": "comment",

      "oldValue": "That's Great!",

      "newValue": "That's Great! Well done!"

    },

    {

      "path": "modifiedAt",

      "oldValue": "",

      "newValue": "2020-08-11T15:00:01.767"

    },

    {

      "path": "modifiedByPersonId",

      "oldValue": "",

      "newValue": "4522"

    }

  ]

}

The data object is unique based on the subject type and can be viewed individually in section 5.0.

5.0 Data JSON Schemas