Google Passes Only

Operations that apply only to Google Wallet passes.

View as Markdown

Add message to Google Pass

Add messages to Google Wallet passes.

Jump to examples ↓

POST /pass/{passId}/message

Security:

Request headers:

  • Api-Revision stringREQUIRED
    The particular API revision you want to use. In general, this is 1.2.

    Possible values:

    • 1.2

Path parameters:

  • passId stringREQUIRED
    The Id of the Google Pass you want to apply messages to.

Request body:

A valid request contains one message for the pass.

  • Content-Type: application/json

    OBJECT PROPERTIES
    • body string

      The message body text.

    • endTime object

      The date-time when the notification will end. If you do not set an end time, the notification displays indefinitely.

      OBJECT PROPERTIES
      • date string

        Format: date-time

    • header string

      The header text for the message

    • messageType string

      Use expirationNotification to warn users of expiring messages, and text for all other notifications. expirationNotification is based on the start value in the displayInterval; the maximum display interval is 30 days from now. If the expiration start date is more than 30 days from now, the message will not appear until the 30-day mark.

      Possible values:

      • expirationNotification
      • text
    • startTime object

      The date-time when the notification will begin appearing to users.

      OBJECT PROPERTIES
      • date string

        Format: date-time

Responses

  • 200

    A successful response returns details for the added message.

    • Content-Type: application/json

      Information about messages associated with specified Google Wallet passes.

      OBJECT PROPERTIES
      • body string

        The body of the message.

      • createdAt string

        The date and time when the item was created.

        Format: date-time

        Read only: true

      • header string

        The header for the message.

      • messageType string

        The type of message.

        Possible values:

        • expirationNotification
        • text
      • updatedAt string

        The date and time when the item was last updated.

        Format: date-time

        Read only: true

  • 404

    The pass ID does not exist.

Examples

Example request

POST /v1/pass/mypass/message HTTP/1.1
Authorization: Basic <authorization string>
Content-Type: application/json

{
   "body":"wallet object expires soon",
   "header":"expires",
   "startTime": "2018-06-03T21:10:00.000Z",
   "endTime": "2018-06-05T21:50:00.000Z",
   "messageType":"expirationNotification"
}

Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
   "header": "expires",
   "body": "wallet object expires soon",
   "startTime": "2018-06-03T21:10:00.000Z",
   "endTime": "2018-06-05T21:50:00.000Z",
   "createdAt": "2021-08-18T23:25:05.075Z",
   "updatedAt": "2021-08-18T23:25:05.075Z",
   "messageType": "expirationNotification"
}

Add message to Google Pass with external ID

Add messages to Google Wallet passes.

Jump to examples ↓

POST /pass/template/{templateId}/id/{passExternalId}/message

Security:

Request headers:

  • Api-Revision stringREQUIRED
    The particular API revision you want to use. In general, this is 1.2.

    Possible values:

    • 1.2

Path parameters:

  • templateId stringREQUIRED
    The template of the Google Pass that you want to apply messages to.
  • passExternalId stringREQUIRED
    The external ID of the Google Pass you want to apply messages to.

Request body:

A valid request contains one message for the pass.

  • Content-Type: application/json

    OBJECT PROPERTIES
    • body string

      The message body text.

    • endTime object

      The date-time when the notification will end. If you do not set an end time, the notification displays indefinitely.

      OBJECT PROPERTIES
      • date string

        Format: date-time

    • header string

      The header text for the message

    • messageType string

      Use expirationNotification to warn users of expiring messages, and text for all other notifications. expirationNotification is based on the start value in the displayInterval; the maximum display interval is 30 days from now. If the expiration start date is more than 30 days from now, the message will not appear until the 30-day mark.

      Possible values:

      • expirationNotification
      • text
    • startTime object

      The date-time when the notification will begin appearing to users.

      OBJECT PROPERTIES
      • date string

        Format: date-time

Responses

  • 200

    A successful response returns details for the added message.

    • Content-Type: application/json

      Information about messages associated with specified Google Wallet passes.

      OBJECT PROPERTIES
      • body string

        The body of the message.

      • createdAt string

        The date and time when the item was created.

        Format: date-time

        Read only: true

      • header string

        The header for the message.

      • messageType string

        The type of message.

        Possible values:

        • expirationNotification
        • text
      • updatedAt string

        The date and time when the item was last updated.

        Format: date-time

        Read only: true

  • 404

    The pass or template ID does not exist.

Examples

Example request

POST /v1/pass/template/123/id/mypass/message HTTP/1.1
Authorization: Basic <authorization string>
Content-Type: application/json

{
   "body":"wallet object expires soon",
   "header":"expires",
   "startTime": "2018-06-03T21:10:00.000Z",
   "endTime": "2018-06-05T21:50:00.000Z",
   "messageType":"expirationNotification"
}

Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
   "header": "expires",
   "body": "wallet object expires soon",
   "startTime": "2018-06-03T21:10:00.000Z",
   "endTime": "2018-06-05T21:50:00.000Z",
   "createdAt": "2021-08-18T23:25:05.075Z",
   "updatedAt": "2021-08-18T23:25:05.075Z",
   "messageType": "expirationNotification"
}

Auto link passes to existing Google Pass

Link additional passes to a user’s Google Wallet pass, identified by its Airship pass ID. Linked passes appear automatically in the user’s wallet. See Google Wallet Auto Linked Passes.

Jump to examples ↓

POST /pass/{passId}/linkedPasses

Security:

Request headers:

  • Api-Revision stringREQUIRED
    The particular API revision you want to use. In general, this is 1.2.

    Possible values:

    • 1.2

Path parameters:

  • passId stringREQUIRED
    The id of the pass you want to link additional passes to.

Request body:

Auto Linked Passes

  • Content-Type: application/json

    An object containing a passURIs array of passes to link.

Responses

  • 200

    The response contains a ticketId that you can use to look up the operation.

    • Content-Type: application/json
      OBJECT PROPERTIES
      • ticketId integer

        An identifier for this operation.

  • 400

    The request was malformed.

  • 404

    The pass does not exist.

Examples

Example request

POST /v1/pass/12345/linkedPasses HTTP/1.1
Authorization: Basic <authorization string>
Content-Type: application/json

{
   "passURIs" : ["v1/pass/adaptive/fqsl9UyW3O7", "v1/pass/adaptive/Xzq5O7lf262"]
}

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "ticketId": 12345
}

Auto link passes to Google Pass with external ID

Link additional passes to a user’s Google Wallet pass, identified by template ID and external pass ID. Linked passes appear automatically in the user’s wallet. See Google Wallet Auto Linked Passes.

Jump to examples ↓

POST /pass/template/{templateId}/id/{passExternalId}/linkedPasses

Security:

Request headers:

  • Api-Revision stringREQUIRED
    The particular API revision you want to use. In general, this is 1.2.

    Possible values:

    • 1.2

Path parameters:

  • templateId stringREQUIRED
    The id of the pass template.
  • passExternalId stringREQUIRED
    The external ID of the pass you want to link additional passes to.

Request body:

Auto Linked Passes

  • Content-Type: application/json

    An object containing a passURIs array of passes to link.

Responses

  • 200

    The response contains a ticketId that you can use to look up the operation.

    • Content-Type: application/json
      OBJECT PROPERTIES
      • ticketId integer

        An identifier for this operation.

  • 400

    The request was malformed.

  • 404

    The pass does not exist.

Examples

Example request

POST /v1/pass/template/12345/id/test_custom_pass_id/linkedPasses HTTP/1.1
Authorization: Basic <authorization string>
Content-Type: application/json

{
   "passURIs" : ["v1/pass/adaptive/gqsl9UyW3O8", "v1/pass/adaptive/Yzq5O7lf263"]
}

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "ticketId": 12346
}

Auto link passes to Google Pass with external template ID

Link additional passes to a user’s Google Wallet pass, identified by external template ID and external pass ID. Linked passes appear automatically in the user’s wallet. See Google Wallet Auto Linked Passes.

Jump to examples ↓

POST /pass/template/id/{templateExternalId}/id/{passExternalId}/linkedPasses

Security:

Request headers:

  • Api-Revision stringREQUIRED
    The particular API revision you want to use. In general, this is 1.2.

    Possible values:

    • 1.2

Path parameters:

  • templateExternalId stringREQUIRED
    The external ID of the pass template.
  • passExternalId stringREQUIRED
    The external ID of the pass you want to link additional passes to.

Request body:

Auto Linked Passes

  • Content-Type: application/json

    An object containing a passURIs array of passes to link.

Responses

  • 200

    The response contains a ticketId that you can use to look up the operation.

    • Content-Type: application/json
      OBJECT PROPERTIES
      • ticketId integer

        An identifier for this operation.

  • 400

    The request was malformed.

  • 404

    The pass does not exist.

Examples

Example request

POST /v1/pass/template/id/custom_test_template_id/id/custom_test_pass_id/linkedPasses HTTP/1.1
Authorization: Basic <authorization string>
Content-Type: application/json

{
   "passURIs" : ["v1/pass/adaptive/gqsl9UyW3O8", "v1/pass/adaptive/Zzq5O7lf263"]
}

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "ticketId": 12347
}

Get messages for Google Pass

Returns an array of messages associated with the specified pass.

Jump to examples ↓

GET /pass/{passId}/message

Security:

Request headers:

  • Api-Revision stringREQUIRED
    The particular API revision you want to use. In general, this is 1.2.

    Possible values:

    • 1.2

Path parameters:

  • passId stringREQUIRED
    The Id of the Google Pass you want to get messages from.

Responses

  • 200

    A successful response returns details for the added messages.

    • Content-Type: application/json
      OBJECT PROPERTIES
      • messages array[object]

        An array of messages associated with the pass.

  • 404

    The pass ID does not exist.

Examples

Example request

GET /v1/pass/mypass/message HTTP/1.1
Authorization: Basic <Base64 key>
Api-Revision: 1.2

Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
   "messages": [
      {
         "header": "expires",
         "body": "wallet object expiring soon",
         "createdAt": "2019-03-05T23:11:29.000Z",
         "updatedAt": "2019-03-05T23:11:29.000Z",
         "messageType": "expirationNotification"
      }
   ]
}

Get messages for Google Pass with external ID

Returns an array of messages associated with the specified pass.

Jump to examples ↓

GET /pass/template/{templateId}/id/{passExternalId}/message

Security:

Request headers:

  • Api-Revision stringREQUIRED
    The particular API revision you want to use. In general, this is 1.2.

    Possible values:

    • 1.2

Path parameters:

  • templateId stringREQUIRED
    The template of the Google Pass that you want to get messages from.
  • passExternalId stringREQUIRED
    The external ID of the Google Pass you want to get messages for.

Responses

  • 200

    A successful response returns details for the added messages.

    • Content-Type: application/json
      OBJECT PROPERTIES
      • messages array[object]

        An array of messages associated with the pass.

  • 404

    The pass or template ID does not exist.

Examples

Example request

GET /v1/pass/template/123/id/mypass/message HTTP/1.1
Authorization: Basic <Base64 key>
Api-Revision: 1.2

Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
   "messages": [
      {
         "header": "expires",
         "body": "wallet object expiring soon",
         "createdAt": "2019-03-05T23:11:29.000Z",
         "updatedAt": "2019-03-05T23:11:29.000Z",
         "messageType": "expirationNotification"
      }
   ]
}

Save to Google Wallet

Creates a pass from the specified template and returns code for a “Save to Google Wallet” button. Clicking or tapping this button installs the pass.

Jump to examples ↓

POST /pass/{templateId}/saveToWallet

Security:

Request headers:

  • Api-Revision stringREQUIRED
    The particular API revision you want to use. In general, this is 1.2.

    Possible values:

    • 1.2

Path parameters:

  • templateId stringREQUIRED
    The id of the template you want to generate a “Save to Google Wallet” button for.

Request body:

The request is much like creating a pass with the addition of functions to perform upon success or failure.

  • Content-Type: application/json

    OBJECT PROPERTIES
    • externalId string

      An external identifier for the pass that you might want to use to update the pass in the future.

    • fields object
    • onFail string

      A javascript function that you want to be called when a user

    • onSuccess string

      A javascript function that you want to be called when a user successfully adds the pass to Google Wallet.

    • tag string

      A single tag you want to add to the pass.

Responses

  • 200

    A response includes the javascript for a “Save to Google Wallet” button.

Examples

Example request

POST /v1/pass/123/saveToWallet HTTP/1.1
Content-Type: application/json
Authorization: Basic <Base64 key>
Api-Revision: 1.2

 {
    "fields": {
       "Points": {
       "value": "600"
       }
    },
    "tag": "abc",
    "externalId": "UserName",
    "onSuccess": "mySuccessFunc()",
    "onFail": "myFailureFunc()"
 }

Response

<script src="https://apis.google.com/js/plusone.js" type="text/javascript"></script>
<script type="text/javascript">
function urban_airship_callback(path) {
   var script = document.createElement('script');
   script.src = path
   document.getElementsByTagName('head')[0].appendChild(script);
}
var successHandler = function (params) {
   urban_airship_callback('https://wallet-api.urbanairship.com/v1/card/register/2931580989855247863.31885_34ab7304-0148-407f-9e4a-69ae30c1efd1')
}
var failureHandler = function (params) {
   urban_airship_callback('https://wallet-api.urbanairship.com/v1/card/register/2931580989855247863.31885_34ab7304-0148-407f-9e4a-69ae30c1efd1')
}
</script>
<g:savetowallet
   jwt="eyJhbGciOiJSUzI1NiJ9..."
   onsuccess="mySuccessFunc()"
   onfailure="myFailureFunc()" size="small" theme="gray">
</g:savetowallet>