Callbacks

Wallet callbacks provide a pass event notification, e.g., pass install or uninstall, using webhooks.

Create callback specification

Register a callback specification, which includes the remote URL and any HTTP headers required by the remote URL.

Your callback server should expect to receive callbacks at up to three endpoints:

  • {baseUrl}/v1/pass/install — Receives a callback when your audience installs passes.
  • {baseUrl}/v1/pass/uninstall — Receives a callback when your audience uninstalls passes.
  • {baseUrl}/v1/pass/{passId}/personalize — Receives a callback with a personalization object when your audience personalizes a Loyalty pass. You must add personalization requirements to Apple templates before users can personalize passes created from them.

See Wallet callbacks for more information.

Jump to examples ↓

POST /project/{projectId}/settings/callback

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:

  • projectId stringREQUIRED
    The ID of the project.

Request body:

  • Content-Type: application/json

    Callback Specification

    Used for both requests and responses to /callback endpoints.

    OBJECT PROPERTIES
    • baseUrl string

      The URL of your webhook/callback server.

    • headers object

      Contains headers required by your webhook/callback server, including authorization, content-type, etc.

      By default, Airship appends content-type: application/json and sends a JSON payload.

Responses

  • 200

    A successful call returns the callback specification.

    • Content-Type: application/json

      Used for both requests and responses to /callback endpoints.

      OBJECT PROPERTIES
      • baseUrl string

        The URL of your webhook/callback server.

      • headers object

        Contains headers required by your webhook/callback server, including authorization, content-type, etc.

        By default, Airship appends content-type: application/json and sends a JSON payload.

Examples

Example request

POST /v1/project/12345/settings/callback HTTP/1.1
Authorization: Basic <Base64 key>
Content-Type: application/json

{
   "baseUrl": "https://www.remotehost.example.com/callbacks",
   "headers": {
      "Authorization": "Basic dGVzdEB0ZXN0LmNvbTp0ZXN0",
      "Content-Type": "application/json"
   }
}

Response

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

{
   "baseUrl": "https://www.remotehost.example.com/callbacks",
   "headers": {
      "Authorization": "Basic dGVzdEB0ZXN0LmNvbTp0ZXN0",
      "Content-Type": "application/json"
   }
}

Delete callback specification

Delete a registered callback specification. Because a project only uses a single callback specification, you specify the projectId only.

Jump to examples ↓

DELETE /project/{projectId}/settings/callback

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:

  • projectId stringREQUIRED
    The ID of the project.

Responses

  • 204

    A successful request returns no content.

Examples

Example request

DELETE /v1/project/12345/settings/callback HTTP/1.1
Authorization: Basic <Base64 key>

Response

HTTP/1.1 204 No Content

Get callback specification

Return the callback specification for a project.

Jump to examples ↓

GET /project/{projectId}/settings/callback

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:

  • projectId stringREQUIRED
    The ID of the project.

Responses

  • 200

    A successful call returns the callback specification.

    • Content-Type: application/json

      Used for both requests and responses to /callback endpoints.

      OBJECT PROPERTIES
      • baseUrl string

        The URL of your webhook/callback server.

      • headers object

        Contains headers required by your webhook/callback server, including authorization, content-type, etc.

        By default, Airship appends content-type: application/json and sends a JSON payload.

Examples

Example request

GET /v1/project/12345/settings/callback HTTP/1.1
Authorization: Basic <Base64 key>

Response

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

{
   "baseUrl": "https://www.remotehost.example.com/callbacks",
   "headers": {
      "Authorization": "Basic dGVzdEB0ZXN0LmNvbTp0ZXN0",
      "Content-Type": "application/json"
   }
}

Update callback specification

Update a callback specification. The payload to update a callback is identical to the payload to create a callback.

Jump to examples ↓

PUT /project/{projectId}/settings/callback

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:

  • projectId stringREQUIRED
    The ID of the project.

Request body:

  • Content-Type: application/json

    Callback Specification

    Used for both requests and responses to /callback endpoints.

    OBJECT PROPERTIES
    • baseUrl string

      The URL of your webhook/callback server.

    • headers object

      Contains headers required by your webhook/callback server, including authorization, content-type, etc.

      By default, Airship appends content-type: application/json and sends a JSON payload.

Responses

  • 200

    A successful call returns the callback specification.

    • Content-Type: application/json

      Used for both requests and responses to /callback endpoints.

      OBJECT PROPERTIES
      • baseUrl string

        The URL of your webhook/callback server.

      • headers object

        Contains headers required by your webhook/callback server, including authorization, content-type, etc.

        By default, Airship appends content-type: application/json and sends a JSON payload.

Examples

Example request

PUT /v1/project/12345/settings/callback HTTP/1.1
Authorization: Basic <Base64 key>
Content-Type: application/json

{
   "baseUrl": "https://www.remotehost.example.com/callbacks",
   "headers": {
      "Authorization": "Basic dGVzdEB0ZXN0LmNvbTp0ZXN0",
      "Content-Type": "application/json"
   }
}

Response

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

{
   "baseUrl": "https://www.remotehost.example.com/callbacks",
   "headers": {
      "Authorization": "Basic dGVzdEB0ZXN0LmNvbTp0ZXN0",
      "Content-Type": "application/json"
   }
}