Versions Compared

Key

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

...

First you will need to create a new callback record. 

POST /companies/:company_key/config/callbacks/


Then you will need to post the following information using information from the wallet campaign that you wish to establish callbacks for, as well as the desired destination url for the callbacks. 


Code Block
{   
  "callback_type": "wallet_item_install",
  "event_type": "wallet_item_install", //deprecated
  "wallet_item_install": {
    "campaign_token": "YOUR_WALLET_CAMPAIGN_TOKEN"
  },
  "destination":{
     "url":"https://YOUR.DESTINATION.URL",
     "method":"POST",
     "content_type":"application/json"
  }
}

The The wallet_item_remove callback event is triggered when a wallet pass is removed by an end user.

To register an endpoint to receive the wallet_item_remove callback, you use the same instructions as the wallet_item_install, however you will want to change the event_type to "wallet_item_remove". 

Code Block
{
  "callback_type": "wallet_item_remove",
  "event_type": "wallet_item_remove",  //deprecated
  "wallet_item_install": {
    "campaign_token": "YOUR_WALLET_CAMPAIGN_TOKEN"
  },
  "destination":{
     "url":"https://YOUR.DESTINATION.URL",
     "method":"POST",
     "content_type":"application/json"
  }
}

...

If

...

successful, you will receive the following callback body indicating the start date, created at date, as well as the callback_id.

...

Callback Body


Code Block
 {
        "callback_id": 11887,
        "callback_type": "wallet_item_install",
        "event_type": "wallet_item_install", //deprecated
        "wallet_item_install": {
            "campaign_token": "r3zhm8"
        },
        "destination": {
            "url": "http://destination.url",
            "method": "POST",
            "content_type": "application/json"
        },
        "start_date": "2018-04-25T20:00:00Z",
        "url": "/companies/ba9bcNKc/config/callbacks/11887",
        "created_at": "2018-04-27T21:37:09Z",
        "updated_at": "2018-04-27T21:37:09Z"
    }

Wallet Item Install Callback Event

...

This callback event is triggered when a new Wallet item has been removed for a given campaign. 


js
Code Block
language
{
  {
  "event_id": "5725c57e-f4bf-47e3-8b1f-6b47e532157a",
  "callback_type": "wallet_item_remove",
  "event_type": "wallet_item_remove", //deprecated
  "event_date": "2018-05-07T15:27:33.664Z",
  "delivery_attempt":"1",
  "wallet_instance": {
    "registered_at": "2017-01-14T14:30Z",
    "unregistered_at": "2018-01-14T14:30Z",
    "wallet_instance_uid": "ec5035b8-349d-47e4-aef1-21bef2220c26",
    "provider": "google"
  },
  "wallet_item": {
    "uuid": "item-uuid",
    "wallet_object_uid": "j8hddfgu65-349d-47e4-aef1-5ujdf2220c26",
    "expiration_date": "2017-01-14T14:30Z",
    "tokens": {
      "first_name": "Calrissian"
    },
    "url": "/companies/bi3bwNRk/campaigns/wallet/r3zhm8/items/item-uuid"
  },
  "wallet_campaign": {
    "wallet_campaign_uid": "cc2ba6ca-557f-4335-9df0-ee5d3c541d0a",
    "token": "r3zhm8",
    "url": "/companies/bi3bwNRk/campaigns/wallet/r3zhm8/"
  }
}

...

For information on how to register your endpoint to receive callbacks, see Callback Configuration

Additional Resources