Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Contents

Table of Contents
maxLevel3
minLevel2
exclude.*

...

Contents.*

Get a Callback

Code Block

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

...

Return JSON

A Callback entity

List Callback

Code Block

GET /companies/:company_id/config/callbacks

...

An Array of Callback elements will be returned.

Code Block

[
   {
      "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

Code Block

POST /companies/:company_id/config/callbacks/

...

Return JSON

A Callback entity

Delete a Callback

Code Block

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

...

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

Create a Test Callback Event

Code Block

POST /companies/:company_id/config/callback_events/test
Code Block

{
  "event_type": "person_added"
}
Code Block

{
   "event_type":"subscription_added",
   "subscription":{
      "subscription_list":{
         "id":"my_list"
      }
   }
}
Code Block

{
   "event_type":"ack_participant_added",
   "participant":{
      "acquisition_campaign":{
         "id":"my_campaign"
      }
   }
}

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

Code Block

{
   "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

Code Block

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

...

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.

Code Block

{
   "event_id":"AB234SDFD234",
   "callback_id":"C1234",
   "event_type":"person_added",
   "event_date":"2013-08-01T15:42:23Z",
   "delivery_attempt":"1",
   "person":...
}

...