Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Table of Contents

Get a Callback

GET /companies/:company_id/config/callbacks/:callback_id

This will retrieve a Callback by its callback_id

A 404 - Not Found error will be returned if the Callback cannot be located.

Return JSON

A Callback entity

List Callback

GET /companies/:company_id/config/callbacks

This will list active and future the callbacks.

Return JSON

An Array of Callback elements will be returned.

  "callback_id": "AB3423",
  "event_type": "person_added",
  "destination": {
    "url": "http://some.url",
    "method": "POST",
    "content_type": "application/json"
  "start_date": "2010-01-01T00:00Z",
  "end_date": "2020-01-01T00:00Z",
  "url": "/companies/:id/config/callbacks/:callback_id",
  "created_at": "2012-04-05T14:30Z",
  "updated_at": "2012-05-08T19:30Z",

Create a Callback

POST /companies/:company_id/config/callbacks/

This will create a new Callback record.  

The fields callback_id, created_at, updated_at, and url are not allowed in a create. Any values will be ignored.

The fields destination_method, content_type, start_date, and end_date are optional.

Two callback registrations may not share an event type if they have overlapping active date ranges.

An HTTP 201 - Created response will be returned if the object has been successfully created.

Return JSON

A Callback entity

Delete a Callback

DELETE /companies/:company_id/config/callbacks/:callback_id

An HTTP 200 - OK will be returned if the operation completes successfully.

An HTTP 404 - Not Found will be returned if the entity does not exist.

This will set the end date of the callback to now and change it to inactive. If the start date of the callback was in the future, it will change that to now as well.

Return JSON

A Callback entity reflecting the new date ranges and active state.

Create a Test Callback Event

POST /companies/:company_id/config/callbacks/test
  "event_type": "person_added"

An HTTP 201 - Created will be returned if the callback was queued for send

  "message": "Created event for event_type 'person_added'",
  "event_id" : "AB234SDFD234"

An HTTP 404 - Not Found will be returned if an active callback does not exist

  "errors": [{
      "message": "Could not find a callback registration for event type 'person_added'"

Returned Callback

Your callback endpoint will receive an event like the one shown below. It will contain the event_id returned in the response to the test request and the details of the callback endpoint we are calling.

 "event_id" : "AB234SDFD234",
 "callback_id": "C1234",
 "event_type" : "person_added",
 "event_date" : "2013-08-01T15:42:23Z",
 "delivery_attempt" : "1",
 ...event specific test data...
  • No labels