# Adaptive Links

A link that detects the platform of a recipient and installs the correct pass.
You can send adaptive links to both Apple and Google platform users; When a
user on either platform taps the link, Airship detects the user's device
platform and returns the correct pass.


To send an adaptive link to both Google and Apple platforms, you must have configured templates for both platforms. You can send an adaptive link to an individual platform, and define the behavior for the unsupported platform.


## Create Adaptive Link {#createadaptivelink}

If a template for a device type is not provided, the adaptive link will not be able to create passes for that device. Visiting the adaptive link URL associated with an unsupported device will redirect to the landingPageUrl, if present.

Templates can be provided either implicitly as part of Dynamic Link objects or explicitly with IDs. So either one or both of iosPassLinkId and androidPassLinkId must be present, or payload must be present along with one or both of iosTemplateId and androidTemplateId.

[Jump to examples ↓](#createadaptivelink-examples)

### `POST /links/adaptive`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wadl

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Request body**

**Content-Type:** `application/json`

[Adaptive Link request]({{< ref "/developer/rest-api/wallet/schemas/adaptive-links/" >}}#adaptivelinkrequest)

**Responses**

**`200`** A successful request results in an adaptive link.

Response body:

**Content-Type:** `application/json`

[Adaptive Link response]({{< ref "/developer/rest-api/wallet/schemas/adaptive-links/" >}}#adaptivelinkresponse)

**`404`** Could not find template(s), or could not find or create Dynamic Link object(s).               


**Examples**

*Example request*

```http
POST /v1/links/adaptive HTTP/1.1
Authorization: Basic <authorization string>
Content-Type: application/json

{
   "iosTemplateId": 12345,
   "androidTemplateId": 154321,
   "isPersonalized": "true",
   "iosPassLinkId": "44e128a5-ac7a-4c9a-be4c-224b6bf81b20",
   "androidPassLinkId": "19d128a6-ac7a-3c6c-2a4d-214b6bf81b21",
   "landingPageUrl": "https://example.com/landing.html",
   "availablePasses": 100000,
   "payload": {}
}

```

*Example request with expiration date*

```http
POST /v1/links/adaptive HTTP/1.1
Authorization: Basic <authorization string>
Content-Type: application/json

{
   "iosTemplateId": 12345,
   "androidTemplateId": 154321,
   "isPersonalized": "true",
   "iosPassLinkId": "44e128a5-ac7a-4c9a-be4c-224b6bf81b20",
   "androidPassLinkId": "19d128a6-ac7a-3c6c-2a4d-214b6bf81b21",
   "landingPageUrl": "https://example.com/landing.html",
   "expirationDate": "2022-10-01",
   "availablePasses": 100000,
   "ttlInDays": 730,
   "payload": {}
}

```

*Example request with payload*

```http
POST /v1/links/adaptive HTTP/1.1
Authorization: Basic <authorization string>
Content-Type: application/json

{
  "iosTemplateId": 12345,
  "androidTemplateId": 154321,
  "isPersonalized": "true",
  "payload": {"fields": {"tier": {"value": "gold"}}}
}

```

*Example request with locations*

```http
POST /v1/links/adaptive HTTP/1.1
Authorization: Basic <authorization string>
Content-Type: application/json

{
  "iosTemplateId": 12345,
  "androidTemplateId": 154321,
  "isPersonalized": "true",
  "iosPassLinkId": "44e128a5-ac7a-4c9a-be4c-224b6bf81b20",
  "androidPassLinkId": "19d128a6-ac7a-3c6c-2a4d-214b6bf81b21",
  "landingPageUrl": "https://example.com/landing.html",
  "availablePasses": 100000,
  "ttlInDays": 30,
  "parameterEncoding": "base64",
  "locationRadius": 10,
  "maxResultLocations": 5,
  "payload": {},
  "locations": [
      {
         "latitude": 45.5898,
         "longitude": -122.5951,
         "city": "Portland",
         "country": "US",
         "region": "OR",
         "regionCode": "97218",
         "relevantText": "Welcome to Portland... Voodoo Donuts is only 11 miles away",
         "streetAddress1": "7000 NE Airport Way"
      },
      {
         "latitude": 45.525492,
         "longitude": -122.686092,
         "city": "San Francisco",
         "country": "US",
         "region": "CA",
         "regionCode": "94140",
         "relevantText": "Welcome to the Ship!",
         "streetAddress1": "548 Market St. Suite 698370",
         "streetAddress2": ""
      },
      {
         "latitude": 45.5205,
         "longitude": -122.6788,
         "relevantText": "See you at dinner tonight...or did you already fill up on donuts?"
      }
]
}

```

*Response*

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

{
  "adaptiveLinkId": "abchd345678",
  "url": "https://wallet-api.urbanairship.com/v1/pass/adaptive/abchd345678",
  "iosUrl": "https://wallet-api.urbanairship.com/v1/pass/adaptive/abchd345678/ios",
  "androidUrl": "https://wallet-api.urbanairship.com/v1/pass/adaptive/abchd345678/android",
  "landingPageUrl": "https://example.com/landing.html",
  "isPersonalized": "true",
  "isExpired": false,
  "availablePasses": 100000,
  "ttlInDays": 30
}

```

---

## Create boarding pass or event ticket Adaptive Links {#createboardingpassoreventticketadaptivelinks}

Create boarding pass or event ticket adaptive links. Creating boarding passes
or event tickets is similar to other adaptive links, with a few additional
items in the request and response payloads.


[Jump to examples ↓](#createboardingpassoreventticketadaptivelinks-examples)

### `POST /links/adaptive/multiple/project/{projectId}`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wadl

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | `string` | Required | The project you want to create the boarding pass in. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Request body**

An adaptive link request where the `fields` object can
include an array of flights or events, each with an array of `passengers`
or `attendees`, respectively.


**Content-Type:** `application/json`

**One of:**

- [Event ticket Adaptive Link request]({{< ref "/developer/rest-api/wallet/schemas/event-tickets/" >}}#eventticketrequest)

  An event ticket requires similar information to other adaptive
link types, but does not support some of the same fields, and requires event and attendee information.


Like other adaptive links, you must provide the `id` or `externalId` of an iOS or Android template. You can create the event within this request or specify an event by `eventId` or `eventExternalId`. In either case, you must also provide an array of attendees for the event.


- [Boarding pass Adaptive Link request]({{< ref "/developer/rest-api/wallet/schemas/flights-and-boarding-passes/" >}}#boardingpassrequest)

  A boarding pass adaptive link requires similar information to other adaptive
link types, but the payload includes flight information and an array of passengers for each flight.


Like other adaptive links, you must provide the `id` or `externalId` of an
iOS or Android template.



**Responses**

**`200`** A successful request returns an array of adaptive links. Each object in
the array represents an individual passenger or attendee in the request
payload. Passes in the response appear in same order as objects in
in the `flights` or `events` array.


Response body:

**Content-Type:** `application/json`

- **`links`** `array`

  An array of adaptive links.

  **One of:**

  - [Boarding pass Adaptive Link response]({{< ref "/developer/rest-api/wallet/schemas/flights-and-boarding-passes/" >}}#boardingpassresponse)

    The boarding pass operations return responses like other adaptive links, with the addition of the identifier of the event and an HTTP status for each individual adaptive link.


Like other adaptive links, you must provide the `id` or `externalId` of an
iOS or Android template.


  - [Event ticket Adaptive Link response]({{< ref "/developer/rest-api/wallet/schemas/event-tickets/" >}}#eventticketresponse)

    The response for event ticket operations is much like any other adaptive link, with the addition of the identifier of the event and an HTTP status for each individual adaptive link.


**Examples**

*Example boarding pass request*

```http
POST /v1/links/adaptive/multiple/project/12345 HTTP/1.1
Authorization: Basic <authorization string>
Content-Type: application/json

{
  "iosTemplateExternalId": "ios123ExtId",
  "androidTemplateExternalId": "android123ExtId",
  "payload": {
    "flights": [
      {
        "flightExternalId": "flight123ExtId",
        "fields": {
          "flightNumber": { "value": "815" },
          "airlineCode": { "value": "OA" },
          "airlineName": { "value": "Sabine Airlines" },
          "departureAirport": {
            "label": "San Francisco",
            "value": "SFO"
          },
          "departureGate": {
            "label": "Gate #",
            "value": "25"
          },
          "boardingTime": { "value": "2018-07-30T08:35:00" },
          "departureTime": { "value": "2018-07-30T09:00:00" },
          "arrivalAirport": {
            "label": "Portland",
            "value": "PDX"
          },
          "arrivalTime": { "value": "2018-07-30T11:00:00" },
          "flightStatus": { "value": "scheduled" }
        },
        "passengers": [
          {
            "adaptiveLinkExternalId": "abch3ExtId1",
            "fields": {
              "seatNumber": { "value": "13A" },
              "confirmationCode": { "value": "E4583B" },
              "passengerName": { "value": "SMITH/JOE" },
              "specialAssistance": { "label": "Special Assistance", "value": "Wheelchair" },
              "barcode_value": { "value": "12345" },
              "barcodeAltText": { "value": "12345" }
            }
          },
          {
            "adaptiveLinkExternalId": "abch3ExtId2",
            "fields": {
              "seatNumber": { "value": "13B" },
              "confirmationCode": { "value": "E4583B" },
              "passengerName": { "value": "SMITH/SALLY" },
              "barcode_value": { "value": "12346" },
              "barcodeAltText": { "value": "12346" }
            }
          },
          {
            "adaptiveLinkExternalId": "abch3ExtId2",
            "fields": {
              "seatNumber": { "value": "13C" },
              "confirmationCode": { "value": "E4583B" },
              "passengerName": { "value": "SMITH/SAM" },
              "barcode_value": { "value": "12347" },
              "barcodeAltText": { "value": "12347" }
            }
          }
        ],
        "passGroups": ["sfo-pdx-20180730"]
      }
    ]
  }
}

```

*Response*

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

{
  "links": [
    {
      "status": 200,
      "adaptiveLinkId": "abchd345678",
      "adaptiveLinkExternalId": "abch3ExtId1",
      "iosTemplateId": 12345,
      "iosTemplateExternalId": "ios123ExtId",
      "androidTemplateId": 154321,
      "androidTemplateExternalId": "android123ExtId",
      "url": "https://wallet-api.urbanairship.com/v1/pass/adaptive/abchd345678",
      "iosUrl": "https://wallet-api.urbanairship.com/v1/pass/adaptive/abchd345678/ios",
      "androidUrl": "https://wallet-api.urbanairship.com/v1/pass/adaptive/abchd345678/android",
      "createdAt": "2018-07-05T09:12:32Z",
      "updatedAt": "2018-07-05T09:12:32Z",
      "isPersonalized": "false",
      "isExpired": false,
      "availablePasses": 1000000,
      "ttlInDays": 30,
      "flightId": 465,
      "flightExternalId": "flight123ExtId",
      "iosPassLinkId": "eb94e8e0-4353-4e0b-bfe9-cfd21c52a540",
      "androidPassLinkId": "41c1ea48-f469-4968-b610-a98629ea19bc"
    },
    {
      "status": 200,
      "adaptiveLinkId": "abchd345Id2",
      "adaptiveLinkExternalId": "abch3ExtId2",
      "iosTemplateId": 12345,
      "iosTemplateExternalId": "ios123ExtId",
      "androidTemplateId": 154321,
      "androidTemplateExternalId": "android123ExtId",
      "url": "https://wallet-api.urbanairship.com/v1/pass/adaptive/abchd345Id2",
      "iosUrl": "https://wallet-api.urbanairship.com/v1/pass/adaptive/abchd345Id2/ios",
      "androidUrl": "https://wallet-api.urbanairship.com/v1/pass/adaptive/abchd345Id2/android",
      "createdAt": "2018-07-05T09:12:32Z",
      "updatedAt": "2018-07-05T09:12:32Z",
      "isPersonalized": "false",
      "isExpired": false,
      "availablePasses": 1000000,
      "ttlInDays": 30,
      "flightId": 465,
      "flightExternalId": "flight123ExtId",
      "iosPassLinkId": "5d370e0d-0aa9-45c3-b7ab-eff0a3d4995b",
      "androidPassLinkId": "c60bd6c0-8f1e-4419-abb0-9f6fcb8a6fab"
    },
    {
      "status": 200,
      "adaptiveLinkId": "abchd345Id2",
      "adaptiveLinkExternalId": "abch3ExtId2",
      "iosTemplateId": 12345,
      "iosTemplateExternalId": "ios123ExtId",
      "androidTemplateId": 154321,
      "androidTemplateExternalId": "android123ExtId",
      "url": "https://wallet-api.urbanairship.com/v1/pass/adaptive/abchd345Id2",
      "iosUrl": "https://wallet-api.urbanairship.com/v1/pass/adaptive/abchd345Id2/ios",
      "androidUrl": "https://wallet-api.urbanairship.com/v1/pass/adaptive/abchd345Id2/android",
      "createdAt": "2018-07-05T09:12:32Z",
      "updatedAt": "2018-07-05T09:12:32Z",
      "isPersonalized": "false",
      "isExpired": false,
      "availablePasses": 1000000,
      "ttlInDays": 30,
      "flightId": 465,
      "flightExternalId": "flight123ExtId",
      "iosPassLinkId": "5d370e0d-0aa9-45c3-b7ab-eff0a3d4995b",
      "androidPassLinkId": "c60bd6c0-8f1e-4419-abb0-9f6fcb8a6fab"
    },
  ]
}

```

---

## Delete Adaptive Link {#deleteadaptivelink}

Deletes an adaptive link.

[Jump to examples ↓](#deleteadaptivelink-examples)

### `DELETE /links/adaptive/{adaptiveLinkId}`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wadl

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `adaptiveLinkId` | `string` | Required | The ID of the adaptive link. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Responses**

**`200`** The adaptive link was successfully deleted. A successful operation returns no content.

**`404`** Could not find an entry with specified `adaptiveLinkId`.    


**Examples**

*Example request*

```http
DELETE /v1/links/adaptive/rthBWAWDaAA HTTP/1.1
Authorization: Basic <authorization string>
Api-Revision: 1.2

```

*Response*

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

{}

```

---

## Generate multiple passes from a single Adaptive Link {#generatemultipassfromadaptivelink}

Generates a multi-pass bundle from an Adaptive Link.


[Jump to examples ↓](#generatemultipassfromadaptivelink-examples)

### `GET /pass/adaptive`

**Query parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `ids` | `string` | Required | Comma-separated Adaptive Link IDs to bundle. |
| `deviceType` | `string` | Required | The device type the user needs to install. Only required when targeting a specific platform, otherwise, if a device type is not specified in the query, Airship detects the device type from the request headers. If the device type cannot be detected, Airship redirects the request to a landing page URL provided by the client as part of the Adaptive Link metadata. In your landing page, provide buttons that link to the explicit device-specific URLs for iOS and Android pass generation. For example, `/pass/adaptive?ids={comma_separated_adaptive_link_ids}&deviceType=ios`.  Possible values: `ios`, `android`, `web` |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Responses**

**`200`** Requests for iOS passes return a .pkpass file. Requests for Android passes redirect to a Google Pay URL containing the Google pass JSON Web Token (JWT). Requests for `web` devices or without a device type specified return the landing page URL that a user can access to manually select a device type and install the pass.

Response body:

**Content-Type:** `application/json`

Type: `object`

**Content-Type:** `application/vnd.apple.pkpass`

Type: `object`

**`404`** Could not find an entry with specified `adaptiveLinkId`.


**Examples**

*Example iOS request*

```http
GET /v1/pass/adaptive?ids=rthBWAWDaAA,Y0E6EXuTx5i&deviceType=ios HTTP/1.1

```

*iOS response*

```http
HTTP/1.1 200 OK
Content-Type: application/vnd.apple.pkpass

[.pkpass]

```

*Example Android request*

```http
GET /v1/pass/adaptive?ids=rthBWAWDaAA,Y0E6EXuTx5i&deviceType=android HTTP/1.1

```

*Android response*

```http
HTTP/1.1 301 Redirect

```

---

## Generate pass from Adaptive Link {#generatepassfromadaptivelink}

Generates a pass from an adaptive link.


When generating passes this way, you can append request parameters mapping to pass fields to the URL to add or update values to the pass at creation time. While this document lists reserved parameters, you can provide the `fieldName=value` for any field contained in the adaptive link.


If you configured your adaptive link object with the `isPersonalized` flag set to false (or the flag is absent), the first request will create a pass, and subsequent requests will create new instances of this same pass. If the `isPersonalized` flag is true, every request will create a new pass. If a request includes url-encoded parameters, the `isPersonalized` flag is considered true and Airship will always create a new pass for every request (instead of a pass instance).


[Jump to examples ↓](#generatepassfromadaptivelink-examples)

### `GET /pass/adaptive/{adaptiveLinkId}/{deviceType}`

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `adaptiveLinkId` | `string` | Required | The identifier of the adaptive link you want to create a pass from. |
| `deviceType` | `string` | Required | The device type the user needs to install. Only required when targeting a specific platform, otherwise, if a device type is not specified in the path, Airship detects the device type from the request headers. If the device type cannot be detected, Airship redirects the request to a landing page URL provided by the client as part of the adaptive link metadata. In this landing page, provide buttons that link to the explicit device-specific URLs for iOS and Android pass generation. For example, `/pass/adaptive/{adaptiveLinkId}/{ios}`.  Possible values: `ios`, `android`, `web` |

**Query parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `barcode` | `string` |  | Sets the barcode value for the new pass. |
| `barcodeAltText` | `string` |  | The alternative text for the barcode on the pass. If unspecified, the barcode value is used as the barcodeAltText. |
| `tags` | `string` |  | Tags you want to associate with the pass. Multiple tags may be separated by `~`, e.g., `&tags=tag1~tag2~tag3`. |
| `exid` | `string` |  | The external_id you want to set for this pass. |
| `lat` | `string` |  | The latitude of the device installing the pass, used to calculate distance to locations specified in the adaptive link. |
| `long` | `string` |  | The longitude of the device installing the pass, used to calculate distance to locations specified in the adaptive link. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Responses**

**`200`** Requests for iOS passes return a .pkpass file. Requests for Android passes redirect to a Google Pay URL containing the Google pass JSON Web Token (JWT). Requests for `web` devices or without a device type specified return the landing page URL that a user can access to manually select a device type and install the pass.

Response body:

**Content-Type:** `application/json`

Type: `object`

**Content-Type:** `application/vnd.apple.pkpass`

Type: `object`

**`404`** Could not find an entry with specified `adaptiveLinkId`.


**Examples**

*Example iOS request*

```http
GET /v1/pass/adaptive/rthBWAWDaAA/ios HTTP/1.1
Authorization: Basic <authorization string>
Api-Revision: 1.2

```

*iOS response*

```http
HTTP/1.1 200 OK
Content-Type: application/vnd.apple.pkpass

[.pkpass]

```

*Example Android request*

```http
GET /v1/pass/adaptive/rthBWAWDaAA/android HTTP/1.1
Authorization: Basic <authorization string>
Api-Revision: 1.2

```

*Android response*

```http
HTTP/1.1 301 Redirect

```

---

## Get Adaptive Link {#getadaptivelink}

Returns information about a single adaptive link.

[Jump to examples ↓](#getadaptivelink-examples)

### `GET /links/adaptive/{adaptiveLinkId}`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wadl

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `adaptiveLinkId` | `string` | Required | The ID of the adaptive link. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Responses**

**`200`** Lists urls and available passes for an individual link.

Response body:

**Content-Type:** `application/json`

[Adaptive Link response]({{< ref "/developer/rest-api/wallet/schemas/adaptive-links/" >}}#adaptivelinkresponse)

**`404`** Could not find an entry with specified `adaptiveLinkId`.


**Examples**

*Example request*

```http
GET /v1/links/adaptive/abchd345678 HTTP/1.1
Authorization: Basic <authorization string>

```

*Response*

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

{
  "adaptiveLinkId": "abchd345678",
  "url": "https://wallet-api.urbanairship.com/v1/pass/adaptive/abchd345678",
  "iosUrl": "https://wallet-api.urbanairship.com/v1/pass/adaptive/abchd345678/ios",
  "androidUrl": "https://wallet-api.urbanairship.com/v1/pass/adaptive/abchd345678/android",
  "landingPageUrl": "https://example.com/landing.html",
  "isExpired": false,
  "availablePasses": 100000,
  "ttlInDays": 30
}

```

---

## List Adaptive Links {#listadaptivelinks}

Returns a list of adaptive links.

[Jump to examples ↓](#listadaptivelinks-examples)

### `GET /links/adaptive`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Responses**

**`200`** Returns a list of all adaptive links for the account.

Response body:

**Content-Type:** `application/json`

- **`links`** `array` <[Adaptive Link response]({{< ref "/developer/rest-api/wallet/schemas/adaptive-links/" >}}#adaptivelinkresponse)>
**Examples**

*Example request*

```http
GET /v1/links/adaptive HTTP/1.1
Authorization: Basic <authorization string>

```

*Response*

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

{
   "links": [
      {
         "adaptiveLinkId": "0bDEgyJEko",
         "url": "https://wallet-api.urbanairship.com/v1/pass/adaptive/0bDEgyJEko",
         "iosUrl": "https://wallet-api.urbanairship.com/v1/pass/adaptive/0bDEgyJEko/ios",
         "androidUrl": "https://wallet-api.urbanairship.com/v1/pass/adaptive/0bDEgyJEko/android",
         "isPersonalized": true,
         "isExpired": false,
         "availablePasses": 999999,
         "ttlInDays": 30,
         "iosTemplateId": 4834,
         "androidTemplateId": 4840
      },
      {
         "adaptiveLinkId": "58HTBeYkqg",
         "url": "https://wallet-api.urbanairship.com/v1/pass/adaptive/58HTBeYkqg",
         "iosUrl": "https://wallet-api.urbanairship.com/v1/pass/adaptive/58HTBeYkqg/ios",
         "androidUrl": "https://wallet-api.urbanairship.com/v1/pass/adaptive/58HTBeYkqg/android",
         "landingPageUrl": "https://www.urbanairship.com/",
         "isPersonalized": false,
         "isExpired": true,
         "expirationDate": "2020-10-01",
         "availablePasses": 1000000,
         "ttlInDays": 30,
         "iosTemplateId": 4393,
         "androidTemplateId": 4387
      },
      {
         "adaptiveLinkId": "7Qxf5ar9P6",
         "url": "https://wallet-api.urbanairship.com/v1/pass/adaptive/7Qxf5ar9P6",
         "iosUrl": "https://wallet-api.urbanairship.com/v1/pass/adaptive/7Qxf5ar9P6/ios",
         "androidUrl": "https://wallet-api.urbanairship.com/v1/pass/adaptive/7Qxf5ar9P6/android",
         "isPersonalized": false,
         "isExpired": false,
         "availablePasses": 1000000,
         "ttlInDays": 30,
         "iosTemplateId": 4682,
         "androidTemplateId": 4680
      }
   ]
}

```

---

## List Adaptive Links for a project {#listadaptivelinksforproject}

Returns a list of adaptive links for a project.

[Jump to examples ↓](#listadaptivelinksforproject-examples)

### `GET /links/adaptive/projects/{projectId}`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wadl

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | `string` | Required | The ID of the project. |

**Query parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `pageSize` | `integer` |  | The maximum items to return per page. Defaults to 10. Default: `10` |
| `nextPageToken` | `string` |  | The token for the next page of results. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Responses**

**`200`** Returns a list of all adaptive links for a project.

Response body:

**Content-Type:** `application/json`

- **`links`** `array` <[Adaptive Link response]({{< ref "/developer/rest-api/wallet/schemas/adaptive-links/" >}}#adaptivelinkresponse)>

  Max items: 1000

**Examples**

*Example request*

```http
GET /v1/links/adaptive/projects/7331?pageSize=2 HTTP/1.1
Authorization: Basic <authorization string>

```

*Response*

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

{
  "links": [
    {
      "adaptiveLinkId": "7XRMaSpcEQk",
      "url": "https://d720-104-177-34-165.ngrok.io/v1/pass/adaptive/7XRMaSpcEQk",
      "isPersonalized": false,
      "availablePasses": 998,
      "iosTemplateId": 106178,
      "projectId": 7331,
      "createdAt": "2023-05-23T20:21:10.446Z",
      "updatedAt": "2023-05-23T20:21:10.446Z",
      "status": 200,
      "isExpired": false,
      "doesAllowUrlParameters": true,
      "expiry": "2023-11-19",
      "isAvailablePassesUnlimited": false
    },
    {
      "adaptiveLinkId": "Y0E6EXuTx5i",
      "url": "https://d720-104-177-34-165.ngrok.io/v1/pass/adaptive/Y0E6EXuTx5i",
      "isPersonalized": false,
      "availablePasses": 998,
      "iosTemplateId": 106178,
      "projectId": 7331,
      "createdAt": "2023-05-23T20:20:39.808Z",
      "updatedAt": "2023-05-23T20:20:39.808Z",
      "status": 200,
      "isExpired": false,
      "doesAllowUrlParameters": true,
      "expiry": "2023-11-19",
      "isAvailablePassesUnlimited": false
    }
  ],
  "nextPageToken": "XGMuDpx2RDs.1684443368127"
}

```

---

## List Adaptive Links for a template {#listadaptivelinksfortemplate}

Returns a list of adaptive links for a template.

[Jump to examples ↓](#listadaptivelinksfortemplate-examples)

### `GET /links/adaptive/projects/{projectId}/templates/{templateId}`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wadl

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | `string` | Required | The ID of the project. |
| `templateId` | `string` | Required | The ID of the template. |

**Query parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `pageSize` | `integer` |  | The maximum items to return per page. Defaults to 10. Default: `10` |
| `nextPageToken` | `string` |  | The token for the next page of results. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Responses**

**`200`** Returns a list of all adaptive links for a template.

Response body:

**Content-Type:** `application/json`

- **`links`** `array` <[Adaptive Link response]({{< ref "/developer/rest-api/wallet/schemas/adaptive-links/" >}}#adaptivelinkresponse)>

  Max items: 1000

**Examples**

*Example request*

```http
GET /v1/links/adaptive/projects/7331/templates/106178 HTTP/1.1
Authorization: Basic <authorization string>

```

*Response*

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

{
  "links": [
    {
      "adaptiveLinkId": "7XRMaSpcEQk",
      "url": "https://d720-104-177-34-165.ngrok.io/v1/pass/adaptive/7XRMaSpcEQk",
      "isPersonalized": false,
      "availablePasses": 998,
      "iosTemplateId": 106178,
      "projectId": 7331,
      "createdAt": "2023-05-23T20:21:10.446Z",
      "updatedAt": "2023-05-23T20:21:10.446Z",
      "status": 200,
      "isExpired": false,
      "doesAllowUrlParameters": true,
      "expiry": "2023-11-19",
      "isAvailablePassesUnlimited": false
    }
  ],
  "nextPageToken": "Y0E6EXuTx5i.1684873239808"
}

```

---

## List passes for an Adaptive Link {#getpassesbyadaptivelink}

List passes for an adaptive link.


[Jump to examples ↓](#getpassesbyadaptivelink-examples)

### `GET /links/adaptive/{adaptiveLinkId}/passes`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wpas

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `adaptiveLinkId` | `string` | Required | The adaptive link ID used for pass creation. |

**Query parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `status` | `string` |  | Find only passes matching the installation status.  * `installed` — passes currently installed. * `uninstalled` — passes that have been uninstalled. * `been_installed` — passes that have been either installed or uninstalled. * `not_been_installed` — passes that have never been installed.  Possible values: `installed`, `uninstalled`, `been_installed`, `not_been_installed` |
| `pageSize` | `integer` |  | The number of passes per page. Defaults to 10. Default: `10` |
| `page` | `integer` |  | The page of results you want to retrieve, starting at 1. Default: `1` |
| `order` | `string` |  | The order you want passes returned in, defaulting to `id`. Possible values: `id`, `createdAt`, `updatedAt` Default: `id` |
| `direction` | `string` |  | Determines whether to return values in ascending or descending order. Defaults to `DESC`. Possible values: `ASC`, `DESC` Default: `DESC` |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Responses**

**`200`** A successful request returns a paged list of passes for a particular adaptive link.

Response body:

**Content-Type:** `application/json`

- **`count`** `integer`

  The total number of passes associated with an adaptive link.

- **`pagination`** `object` <[Pagination object]({{< ref "/developer/rest-api/wallet/schemas/others/" >}}#paginationobject)>

  Contains information about pagination, according to your query parameters.

- **`passes`** `array[object]`

  The metadata for passes associated with the adaptive link. Each object in the array represents a pass.

**`404`** The adaptive link ID does not exist.


**Examples**

*Example request*

```http
GET /v1/links/adaptive/rthBWAWDaAA/passes HTTP/1.1
Authorization: Basic <authorization string>
Api-Revision: 1.2

```

*Response*

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

{
    "passes": [{
        "id": 616,
        "templateId": 1000057,
        "url": "https://d720-104-177-34-165.ngrok.io/v1/pass/616/download",
        "serialNumber": "aff7ffbf-04d7-4180-9da2-c790e08da0b8",
        "createdAt": "2023-04-19T06:17:01.000Z",
        "updatedAt": "2023-04-19T06:17:01.000Z",
        "status": "installed",
        "installedAt": "2023-04-19T06:17:02.000Z",
        "platform": "android"
      },
      {
        "id": 610,
        "templateId": 1000083,
        "url": "https://d720-104-177-34-165.ngrok.io/v1/pass/610/download",
        "serialNumber": "34b6f9de-3745-4107-99ae-3f952208e216",
        "createdAt": "2023-04-05T17:55:23.000Z",
        "updatedAt": "2023-04-05T17:55:23.000Z",
        "status": "installed",
        "installedAt": "2023-04-05T17:55:23.000Z",
        "platform": "android"
      }
    ],
    "pagination": {
      "order": "id",
      "direction": "desc",
      "page": 1,
      "start": 0,
      "pageSize": 2
    }
}

```

---

## List passes for an Adaptive Link for a project {#getpassesbyadaptivelinkforproject}

List passes for an adaptive link for a project.


[Jump to examples ↓](#getpassesbyadaptivelinkforproject-examples)

### `GET /links/adaptive/project/{projectId}/id/{adaptiveLinkExternalId}/passes`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wpas

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | `string` | Required | The ID of the project, generated by Airship, containing the adaptive link. |
| `adaptiveLinkExternalId` | `string` | Required | The adaptive link external ID used for pass creation. |

**Query parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `status` | `string` |  | Find only passes matching the installation status.  * `installed` — passes currently installed. * `uninstalled` — passes that have been uninstalled. * `been_installed` — passes that have been either installed or uninstalled. * `not_been_installed` — passes that have never been installed. * `unknown` — passes that have an unknown status.  Possible values: `installed`, `uninstalled`, `been_installed`, `not_been_installed`, `unknown` |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Responses**

**`200`** A successful request returns a paged list of passes for a particular adaptive link.

Response body:

**Content-Type:** `application/json`

- **`count`** `integer`

  The total number of passes associated with an adaptive link.

- **`pagination`** `object` <[Pagination object]({{< ref "/developer/rest-api/wallet/schemas/others/" >}}#paginationobject)>

  Contains information about pagination, according to your query parameters.

- **`passes`** `array[object]`

  The metadata for passes associated with the adaptive link. Each object in the array represents a pass.

**`404`** The project ID or adaptive link external ID does not exist.


**Examples**

*Example request*

```http
GET /v1/links/adaptive/project/6884/id/my_ext_121924_2/passes HTTP/1.1
Authorization: Basic <authorization string>
Api-Revision: 1.2

```

*Response*

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

{
  "passes": [
    {
      "id": 1574695,
      "templateId": 5483,
      "url": "https://wallet-staging-gcp.urbanairship.com/v1/pass/1474695/download",
      "serialNumber": "a1c69eaf-754c-4eed-8124-6c0090c66b31",
      "createdAt": "2024-11-19T17:42:52.000Z",
      "updatedAt": "2024-11-19T17:46:24.000Z",
      "status": "installed",
      "headers": {
      },
      "fields": {
      },
      "installedAt": "2024-11-19T17:43:10.000Z",
      "platform": "ios"
    }
  ],
  "pagination": {
    "order": "id",
    "direction": "desc",
    "page": 1,
    "start": 0,
    "pageSize": 10
  }
}

```

---

## List passes for an Adaptive Link for an external project {#getpassesbyadaptivelinkforexternalproject}

List passes for an adaptive link for an external project.


[Jump to examples ↓](#getpassesbyadaptivelinkforexternalproject-examples)

### `GET /links/adaptive/project/id/{projectExternalId}/id/{adaptiveLinkExternalId}/passes`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wadl

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectExternalId` | `string` | Required | The external ID of the project containing an adaptive link. |
| `adaptiveLinkExternalId` | `string` | Required | The adaptive link external ID used for pass creation. |

**Query parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `status` | `string` |  | Find only passes matching the installation status.  * `installed` — passes currently installed. * `uninstalled` — passes that have been uninstalled. * `been_installed` — passes that have been either installed or uninstalled. * `not_been_installed` — passes that have never been installed. * `unknown` — passes that have an unknown status.  Possible values: `installed`, `uninstalled`, `been_installed`, `not_been_installed`, `unknown` |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Responses**

**`200`** A successful request returns a paged list of passes for a particular adaptive link.

Response body:

**Content-Type:** `application/json`

- **`count`** `integer`

  The total number of passes associated with an adaptive link.

- **`pagination`** `object` <[Pagination object]({{< ref "/developer/rest-api/wallet/schemas/others/" >}}#paginationobject)>

  Contains information about pagination, according to your query parameters.

- **`passes`** `array[object]`

  The metadata for passes associated with the adaptive link. Each object in the array represents a pass.

**`404`** The project ID or adaptive link external ID does not exist.


**Examples**

*Example request*

```http
GET /v1/links/adaptive/project/id/exid_7294/id/my_ext_flight_111924_2/passes HTTP/1.1
Authorization: Basic <authorization string>
Api-Revision: 1.2

```

*Response*

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

{
  "passes": [
    {
      "id": 1474695,
      "templateId": 5383,
      "url": "https://wallet-staging-gcp.urbanairship.com/v1/pass/1474695/download",
      "serialNumber": "a1c69eaf-754c-4eed-8124-6c0090c66b31",
      "createdAt": "2024-11-19T17:42:52.000Z",
      "updatedAt": "2024-11-19T17:46:24.000Z",
      "status": "installed",
      "headers": {
      },
      "fields": {
      },
      "installedAt": "2024-11-19T17:43:10.000Z",
      "platform": "ios"
    }
  ],
  "pagination": {
    "order": "id",
    "direction": "desc",
    "page": 1,
    "start": 0,
    "pageSize": 10
  }
}

```

---

## Update Adaptive Link {#updateadaptivelink}

Updates an individual adaptive link. You can provide any part of an adaptive link body. Adaptive link fields that you do not provide in this request remain unchanged.

[Jump to examples ↓](#updateadaptivelink-examples)

### `PUT /links/adaptive/{adaptiveLinkId}`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wadl

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `adaptiveLinkId` | `string` | Required | The ID of the adaptive link. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Request body**

A request specifies templates and other information about, and limits for, passes created from the adaptive link. If you provide a single template, then the adaptive link functions for either iOS or Android devices and sends users of the other device type to a landing page.

**Content-Type:** `application/json`

[Adaptive Link request]({{< ref "/developer/rest-api/wallet/schemas/adaptive-links/" >}}#adaptivelinkrequest)

**Responses**

**`200`** A successful request results in an adaptive link.

Response body:

**Content-Type:** `application/json`

[Adaptive Link response]({{< ref "/developer/rest-api/wallet/schemas/adaptive-links/" >}}#adaptivelinkresponse)

**`404`** Could not find templates or Dynamic Link object(s).      


**Examples**

*Example request*

```http
PUT /v1/links/adaptive/as3shd345 HTTP/1.1
Authorization: Basic <authorization string>
Content-Type: application/json

{
   "iosTemplateId": 12345,
   "androidTemplateId": 154321,
   "isPersonalized": "true",
   "landingPageUrl": "https://example.com/landing.html",
   "payload": {"fields": {"tier": {"value": "gold"}}}
}

```

*Response*

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

{
   "adaptiveLinkId": "as3shd345",
   "url": "https://wallet-api.urbanairship.com/v1/pass/adaptive/as3shd345",
   "iosUrl": "https://wallet-api.urbanairship.com/v1/pass/adaptive/as3shd345/ios",
   "androidUrl": "https://wallet-api.urbanairship.com/v1/pass/adaptive/as3shd345/android",
   "landingPageUrl": "https://example.com/landing.html",
   "isPersonalized": "true",
   "isExpired": false,
   "availablePasses": 100000,
   "ttlInDays": 30
}

```

---

