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 38 Current »


Last Updated: Wednesday, December 19, 2018



Get Wallet Messages

The following retrieves an array of all the previous Wallet messages on the campaign.

GET /companies/:company_id/campaigns/wallet/:wallet_id/messages

A maximum of the 50 most recent records will be returned.

Notes:

  • A 404 - Not Found object will be returned if the specified Mobile Wallet :wallet_id does not exist.
  • Android devices can only receive location notifications; they cannot receive scheduled notifications.
  • The wallet_id is the SmartLink token for a campaign.

Return JSON

[
   {
      "wallet_message_id":"abcdef23SDF2",
      "message":{
         "template":"This is the updated message I would like to send.",
         "header":"Header, for Android Pay only.",
         "image_url":"http://www.google.com/wallet.jpg"
      },
      "campaign_ref":{
         "id":"abCDefGHij",
         "type":"Loyalty",
         "url":"/companies/:company_id/campaigns/wallet/abCDefGHij"
      },
      "filters":[
         {
            "name":"group_code",
            "selector":"starts_with",
            "value":"DEA"
         },
         {
            "name":"expiration_date",
            "selector":"between",
            "value":["2018-02-28T10:20:30-06:00", "2018-03-04T10:20:30-06:00"]
         }, 
		 {
            "name":"providers",
            "selector":"any",
            "value":[
               "Passbook"
            ]
         }
      ],
      "url":"/companies/:company_id/campaigns/wallet/abCDefGHij/messages/abcdef23SDF2",
      "created_at":"2017-01-15T14:30Z",
      "updated_at":"2017-02-18T19:30Z"
   },
   {
      "wallet_message_id":"abcde123",
      "message":{
         "template":"This is another message.",
         "header":"Header, for Android Pay only.",
         "image_url":"http://www.google.com/wallet.jpg"
      },
      "campaign_ref":{
         "id":"abCDefGHij",
         "type":"Loyalty",
         "url":"/companies/:company_id/campaigns/wallet/abCDefGHij"
      },
      "filters":[
         {
            "name":"group_code",
            "selector":"starts_with",
            "value":"DEA"
         },
         {
            "name":"expiration_date",
            "selector":"between",
            "value":["2018-02-28T10:20:30-06:00", "2018-03-04T10:20:30-06:00"]
         },
         {
            "name":"providers",
            "selector":"any",
            "value":[
               "Passbook"
            ]
         }
      ],
      "url":"/companies/:company_id/campaigns/wallet/abCDefGHij/messages/abcde123",
      "created_at":"2017-01-15T14:30Z",
      "updated_at":"2017-02-18T19:30Z"
   }
]

Get Wallet Message

The following retrieves a specific Wallet message identified by the :wallet_message_id.

GET /companies/:company_id/campaigns/wallet/:wallet_id/messages/:wallet_message_id

Note:

  • A 404 - Not Found object will be returned if the specified Mobile Wallet Campaign or Wallet message does not exist.
  • The wallet_id is the SmartLink token for a campaign.

Return JSON

{
   "wallet_message_id":"abcdef23SDF2",
   "message":{
      "template":"This is the updated message I would like to send.",
      "header":"Header, for Android Pay only.",
      "image_url":"http://www.google.com/wallet.jpg"
   },
   "campaign_ref":{
      "id":"abCDefGHij",
      "type":"Loyalty",
      "url":"/companies/:company_id/campaigns/wallet/abCDefGHij"
   },
   "filters":[
      {
         "name":"group_code",
         "selector":"starts_with",
         "value":"DEA"
      },
      {
         "name":"expiration_date",
         "selector":"between",
         "value":["2018-02-28T10:20:30-06:00", "2018-03-04T10:20:30-06:00"]
      },
      {
         "name":"providers",
         "selector":"any",
         "value":[
            "Passbook"
         ]
      }
   ],
   "url":"/companies/:company_id/campaigns/wallet/abCDefGHij/messages/abcdef23SDF2",
   "created_at":"2017-01-15T14:30Z",
   "updated_at":"2017-02-18T19:30Z"
}

Create Mobile Wallet Message

The following will create a new Wallet message and immediately begin sending it out to the targeted Wallet items.

POST /companies/:company_id/campaigns/wallet/:wallet_id/messages

Notes: The wallet_id is the SmartLink token for a campaign.

The created_at, updated_at, url, and wallet_message_id fields are system generated. Any values specified in the request will be ignored.


Notes:

  • Messages based on location (Latitude/Longitude) can be sent for Apple and Android, but time-based notifications can only be sent for Apple.
  • An HTTP 200 status code means that an OK result will be returned if the operation completes successfully.
  • An HTTP 404 - Not Found error will be returned if the specified Mobile Wallet :wallet_id does not exist.


Request JSON

{
   "message":{
      "template":"This is the updated message I would like to send.",
      "header":"Header, for Android Pay only.",
      "image_url":"http://www.google.com/wallet.jpg"
   },
   "campaign_ref":{
      "id":"abCDefGHij",
      "type":"Loyalty",
      "url":"/companies/:company_id/campaigns/wallet/abCDefGHij"
   },
   "filters":[
      {
         "name":"group_code",
         "selector":"starts_with",
         "value":"DEA"
      },
	  {
         "name":"expiration_date",
         "selector":"between",
         "value":["2018-02-28T10:20:30-06:00", "2018-03-04T10:20:30-06:00"]
      },
      {
         "name":"providers",
         "selector":"any",
         "value":[
            "Passbook"
         ]
      }
   ]
}

Return JSON

A Wallet message entity reflecting the message created.

Expiration Date Filter

SelectorValueExample
beforeString. Date in ISO8601 format with offset.
{"name": "expiration_date", "selector": "before", "value": "2017-10-25T10:20:30-06:00"}
afterString. Date in ISO8601 format with offset.
{"name": "expiration_date", "selector": "after", "value": "2017-10-25T10:20:30-06:00"}
betweenArray. 2 dates in ISO8601 format with offset.
{"name": "expiration_date", "selector": "between", "value": ["2017-10-24T10:20:30-06:00", "2017-10-25T10:20:30-06:00"]}
onString. Date in ISO8601 with offset
{"name": "expiration_date", "selector": "on", "value": "2017-10-25T10:20:30-06:00"}


Notes:

  • ISO8601 format is required. The filter expects an expiration date with a date, time and offset information. Any offset can be used.
  • "on" selector is equivalent to between: [expiration_date (beginning of day), expiration_date (end of day)].
  • No labels