Skip to end of metadata
Go to start of metadata

Last Updated: Friday, September 11, 2020



The following methods describe how and why Person Added and Person Updated callback events are used, including examples.

Person Added Callback

The Person Added callback event is triggered when a new Person record is added to your Mobile Database. The Person object represents the new state of the Person added.

Callback Body


NoteMDN formats in callback events are determined by the API version used when creating and altering the callbacks. If Version 2 is used, MDNs will be represented in the E.164 international format. Otherwise, MDNs will be represented without a country code.


{
   "event_id":"AB234SDFD234",
   "event_type":"person_added",
   "event_date":"2017-03-15T15:42:23Z",
   "delivery_attempt":"1",
   "person":{
      "person_id": "12344566",
      "external_person_id":"542342",
      "mobile_phone":{
         "mdn":"+12995551234",
         "carrier_code":"104"
      },
      "timezone": "US/Central",
      "timezone_source: "area_code",
      "custom_fields":{
         "first_name":"Steve",
         "birthdate":"1950-12-01T00:00:00Z",
         "rewards_id":"543557654",
         "favorite_stores":[
            {
               "id":"4",
               "name":"My Hardware Store",
               "option_key":"my_hardware_store"
            },
            {
               "id":"12",
               "name":"Local Grocery",
               "option_key":"local_grocery"
            }
         ]
      },
      "created_at":"2017-01-15T14:30Z",
      "updated_at":"2017-02-18T19:30Z",
      "url":"/companies/:company_key/mobiledb/persons/:person_id"
   }
}

Person Updated Callback

The Person Updated callback event is triggered when an existing Person record has been modified in your Mobile Database. This includes scenarios where a Person was requested to be added, but an existing Person was located and matched because they already interacted with the platform (either by MDN or external_person_id).

The Person object represents the complete updated state of the Person.

Callback Body


NoteMDN formats in callback events are determined by the API version used when creating and altering the callbacks. If Version 2 is used, MDNs will be represented in the E.164 international format. Otherwise, MDNs will be represented without a country code.


{
   "event_id":"AB234SDFD234",
   "event_type":"person_updated",
   "event_date":"2017-03-15T15:42:23Z",
   "delivery_attempt":"1",
   "person":{
      "person_id": "12344566",
      "external_person_id":"542342",
      "mobile_phone":{
         "mdn":"+12995551234",
         "carrier_code":"104"
      },
      "timezone": "US/Central",
      "timezone_source: "area_code",
      "custom_fields":{
         "first_name":"Steve",
         "birthdate":"1950-12-01T00:00:00Z",
         "rewards_id":"543557654",
         "favorite_stores":[
            {
               "id":"4",
               "name":"My Hardware Store"
            },
            {
               "id":"12",
               "name":"Local Grocery",
               "option_key":"local_grocery"
            }
         ]
      },
      "created_at":"2017-01-15T14:30Z",
      "updated_at":"2017-02-18T19:30Z",
      "url":"/companies/:company_key/mobiledb/persons/:person_id"
   }
}

Additional Resources

  • No labels

1 Comment

  1. Removed for now

     

    Person MDN Changed Callback (Future)

    The MDN callback callback event is fired whenever a person record had their associated MDN changed.

    The Person object represents the complete updated state of the Person.
    The original_mdn is the old MDN prior to the change.

    Callback Body

    {
       "event_id":"AB234SDFD234",
       "event_type":"person_updated",
       "event_date":"2013-08-01T15:42:23Z",
       "delivery_attempt":"1",
       "original_mdn":"2998675309",
       "person":{
          "person_id":"AB3423",
          "external_person_id":"542342",
          "mobile_phone":{
             "mdn":"2995551234",
             "carrier_code":"104"
          },
          "custom_fields":{
             "first_name":"Steve",
             "birthdate":"1950-12-01T00:00:00Z",
             "rewards_id":"543557654",
             "favorite_stores":[
                {
                   "id":"4",
                   "name":"My Hardware Store"
                },
                {
                   "id":"12",
                   "name":"Local Grocery",
                   "option_key":"local_grocery"
                }
             ]
          },
          "created_at":"2012-04-05T14:30Z",
          "updated_at":"2012-05-08T19:30Z",
          "url":"/companies/:id/mobiledb/persons/:person_id"
       }
    }
    

    Person Merged Callback (Future)

    This callback event is fired whenever two distinct person records are later determined to be the same person record (usually related to MDN updates or changes).

    TBD - How do we want to handle redirects on the original person_id? Redirects, allow it, fail them? Only redirect gets and fail others?