> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dashlink.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# App association

> The files iOS and Android require before your app may open your links.

Neither platform lets an app claim a domain's links on its own say-so. Both fetch a file from the domain and check the app is listed. Without it, your links open in a browser no matter how they are configured.

| Platform | File | Served at |
| - | - | - |
| iOS | `apple-app-site-association` | `/.well-known/apple-app-site-association` |
| Android | `assetlinks.json` | `/.well-known/assetlinks.json` |

Dashlink serves both on your **Dynamic Link domain**. Association is host-wide, so a shared shortlink domain such as `dshl.in` cannot carry it. Create a dedicated Dynamic Link domain (for example `go.example.com` or `news.dshl.in`) first.

You do not paste fingerprints or App IDs by default. Dashlink copies the files from the destination website of the dynamic links on that domain. If a link points at `https://stagingapp.dashlink.ai/demo`, Dashlink fetches `stagingapp.dashlink.ai/.well-known/…` and republishes it on the Dynamic Link host. AASA paths are rewritten to `*` so a back-half such as `/Z39pGI` matches.

## What the app must declare

The OS will not intercept the tap unless the app lists the **Dynamic Link host**.

### Android

```xml theme={null}
<intent-filter android:autoVerify="true">
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="https" android:host="news.dshl.in" />
</intent-filter>
```

```bash theme={null}
adb shell pm get-app-links com.example.app
```

Expect the Dynamic Link host listed as verified.

### iOS

Add `applinks:news.dshl.in` to the app's Associated Domains entitlement.

## Reading the current configuration

```bash cURL theme={null}
curl -X GET "https://api.dashlink.ai/api/v1/app_association/get_app_association?id=DOMAIN-0001" \
  -H "X-API-Key: $DASHLINK_API_KEY"
```

```javascript Node.js theme={null}
const response = await fetch("https://api.dashlink.ai/api/v1/app_association/get_app_association?id=DOMAIN-0001", {
  headers: { "X-API-Key": process.env.DASHLINK_API_KEY },
});
const payload = await response.json();
```

```python Python theme={null}
import os
import requests

response = requests.get(
    'https://api.dashlink.ai/api/v1/app_association/get_app_association?id=DOMAIN-0001',
    headers={'X-API-Key': os.environ["DASHLINK_API_KEY"]},
)
payload = response.json()
```

```go Go theme={null}
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	endpoint0 := "https://api.dashlink.ai/api/v1/app_association/get_app_association?id=DOMAIN-0001"
	req0, err0 := http.NewRequest("GET", endpoint0, nil)
	if err0 != nil {
		panic(err0)
	}
	req0.Header.Set("X-API-Key", os.Getenv("DASHLINK_API_KEY"))
	resp0, err0b := http.DefaultClient.Do(req0)
	if err0b != nil {
		panic(err0b)
	}
	defer resp0.Body.Close()
	body0, _ := io.ReadAll(resp0.Body)
	fmt.Println(string(body0))
}

```

```ruby Ruby theme={null}
require "net/http"
require "json"
require "uri"

uri0 = URI("https://api.dashlink.ai/api/v1/app_association/get_app_association?id=DOMAIN-0001")
request0 = Net::HTTP::Get.new(uri0)
request0["X-API-Key"] = ENV.fetch("DASHLINK_API_KEY")
response0 = Net::HTTP.start(uri0.hostname, uri0.port, use_ssl: true) do |http|
  http.request(request0)
end
payload0 = JSON.parse(response0.body)
```

```php PHP theme={null}
<?php
$ch0 = curl_init('https://api.dashlink.ai/api/v1/app_association/get_app_association?id=DOMAIN-0001');
curl_setopt($ch0, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch0, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch0, CURLOPT_HTTPHEADER, [
    "X-API-Key: " . getenv("DASHLINK_API_KEY"),
]);
$payload0 = json_decode(curl_exec($ch0), true);
curl_close($ch0);
```

`id` is the domain id from `get_user_domains`. The response includes mirrored Android packages and iOS App IDs, `association_mode`, source hosts, last sync time, and the live `assetlinks_url` / `aasa_url`.

## Auto vs manual

`association_mode` defaults to `Auto`. Saving a dynamic link enqueues a refresh; a daily job re-fetches so rotated signing certificates stay current. Use the dashboard **Re-sync** action, or set `association_mode` to `Manual` and write the child tables yourself when the destination site does not publish well-known files.

```bash cURL theme={null}
curl -X POST "https://api.dashlink.ai/api/v1/app_association/update_app_association" \
  -H "X-API-Key: $DASHLINK_API_KEY" \
  -d "id=DOMAIN-0001" \
  -d "association_mode=Manual" \
  -d 'ios_apps=[{"app_id":"TEAMID123.com.example.app"}]' \
  -d 'android_apps=[{"package_name":"com.example.app","sha256_fingerprints":["AA:BB:CC:..."]}]'
```

```javascript Node.js theme={null}
const body = new URLSearchParams();
body.append("id", "DOMAIN-0001");
body.append("association_mode", "Manual");
body.append("ios_apps", "[{\"app_id\":\"TEAMID123.com.example.app\"}]");
body.append("android_apps", "[{\"package_name\":\"com.example.app\",\"sha256_fingerprints\":[\"AA:BB:CC:...\"]}]");

const response = await fetch("https://api.dashlink.ai/api/v1/app_association/update_app_association", {
  method: "POST",
  headers: { "X-API-Key": process.env.DASHLINK_API_KEY },
  body,
});
const payload = await response.json();
```

```python Python theme={null}
import os
import requests

response = requests.post(
    'https://api.dashlink.ai/api/v1/app_association/update_app_association',
    headers={'X-API-Key': os.environ["DASHLINK_API_KEY"]},
    data={
        'id': 'DOMAIN-0001',
        'association_mode': 'Manual',
        'ios_apps': '[{"app_id":"TEAMID123.com.example.app"}]',
        'android_apps': '[{"package_name":"com.example.app","sha256_fingerprints":["AA:BB:CC:..."]}]',
    },
)
payload = response.json()
```

```go Go theme={null}
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
	"net/url"
	"strings"
)

func main() {
	endpoint0 := "https://api.dashlink.ai/api/v1/app_association/update_app_association"
	form0 := url.Values{
		"id": {"DOMAIN-0001"},
		"association_mode": {"Manual"},
		"ios_apps": {"[{\"app_id\":\"TEAMID123.com.example.app\"}]"},
		"android_apps": {"[{\"package_name\":\"com.example.app\",\"sha256_fingerprints\":[\"AA:BB:CC:...\"]}]"},
	}
	req0, err0 := http.NewRequest("POST", endpoint0, strings.NewReader(form0.Encode()))
	if err0 != nil {
		panic(err0)
	}
	req0.Header.Set("Content-Type", "application/x-www-form-urlencoded")
	req0.Header.Set("X-API-Key", os.Getenv("DASHLINK_API_KEY"))
	resp0, err0b := http.DefaultClient.Do(req0)
	if err0b != nil {
		panic(err0b)
	}
	defer resp0.Body.Close()
	body0, _ := io.ReadAll(resp0.Body)
	fmt.Println(string(body0))
}

```

```ruby Ruby theme={null}
require "net/http"
require "json"
require "uri"

uri0 = URI("https://api.dashlink.ai/api/v1/app_association/update_app_association")
request0 = Net::HTTP::Post.new(uri0)
request0["X-API-Key"] = ENV.fetch("DASHLINK_API_KEY")
request0.set_form_data("id" => "DOMAIN-0001", "association_mode" => "Manual", "ios_apps" => "[{\"app_id\":\"TEAMID123.com.example.app\"}]", "android_apps" => "[{\"package_name\":\"com.example.app\",\"sha256_fingerprints\":[\"AA:BB:CC:...\"]}]")
response0 = Net::HTTP.start(uri0.hostname, uri0.port, use_ssl: true) do |http|
  http.request(request0)
end
payload0 = JSON.parse(response0.body)
```

```php PHP theme={null}
<?php
$ch0 = curl_init('https://api.dashlink.ai/api/v1/app_association/update_app_association');
curl_setopt($ch0, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch0, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch0, CURLOPT_HTTPHEADER, [
    "X-API-Key: " . getenv("DASHLINK_API_KEY"),
]);
curl_setopt($ch0, CURLOPT_POSTFIELDS, http_build_query(['id' => 'DOMAIN-0001', 'association_mode' => 'Manual', 'ios_apps' => '[{"app_id":"TEAMID123.com.example.app"}]', 'android_apps' => '[{"package_name":"com.example.app","sha256_fingerprints":["AA:BB:CC:..."]}]']));
$payload0 = json_decode(curl_exec($ch0), true);
curl_close($ch0);
```

### iOS (manual)

`app_id` is your Team ID and bundle identifier joined by a dot:

```
TEAMID123.com.example.app
```

The Team ID is in your Apple Developer account under Membership.

### Android (manual)

`package_name` is your application id, and `sha256_fingerprints` are the signing certificate fingerprints:

```bash theme={null}
keytool -list -v -keystore my-release-key.keystore -alias my-alias
```

> [!WARNING]
>
> Include **every** certificate that signs a build you ship — debug, release, and Play App Signing. Google Play re-signs uploads with its own key, so the fingerprint from your local keystore alone is not enough and links will fail only in production.
>
> The Play Console shows the right one under **Setup → App integrity**. Auto mode already copies every fingerprint the destination site publishes.

## Resolve the deep link from the app

When the OS intercepts the tap, the app receives the short URL and the edge never sees a browser click. Call the same URL as JSON so the app can route to content and the click is counted as an app open:

```bash theme={null}
curl "https://yourbrand.dshl.in/Ab12Cd?format=json&platform=android" \
  -H "X-API-Key: dlk_sdk_…"
```

Use a Dynamic Link key (`dlk_sdk_…`), not a REST key (`dlk_live_`). Browser 302s need no key.

Or send `Accept: application/json`. The body includes `app_url`, `destination_url`, `fallback_url`, `platform`, `outcome` (`app_open`, `deferred_open`, or `deferred_miss`), `click_id`, `is_deferred`, `match_type`, and UTM fields. `platform=android` or `platform=ios` overrides User-Agent detection when the app's HTTP client would otherwise look like desktop.

The [Android](https://docs.dashlink.ai/guides/app-dynamic-links/android.md) and [iOS](https://docs.dashlink.ai/guides/app-dynamic-links/ios.md) SDKs call this for you on live taps and on first open after a store install. See [Receive](https://docs.dashlink.ai/guides/app-dynamic-links/receive.md) for the JSON contract.

## Verifying

```bash theme={null}
curl https://news.dshl.in/.well-known/apple-app-site-association
curl https://news.dshl.in/.well-known/assetlinks.json
```

Both must be served over HTTPS with a valid certificate, with no redirect. The iOS file must be `application/json` and **must not** have a `.json` extension.

Google's own checker:

```
https://digitalassetlinks.googleapis.com/v1/statements:list\
?source.web.site=https://news.dshl.in\
&relation=delegate_permission/common.handle_all_urls
```

## When links still open in a browser

> [accordion] The app does not declare the Dynamic Link host
>
> Auto-mirrored files are not enough. Android needs an `autoVerify` intent-filter for that host; iOS needs `applinks:` on Associated Domains.

> [accordion] iOS caches the file
>
> iOS fetches the association file at install time and caches it. After changing it, delete and reinstall the app — an update is not always enough.

> [accordion] The fingerprint does not match
>
> The most common Android failure, and it only shows up in production builds. Check the Play Console fingerprint, not your local keystore. If Auto mode is on, confirm the destination site publishes the Play App Signing fingerprint.

> [accordion] The domain is a shortlink domain
>
> Association is rejected on Shortlinks usage. Create a Dynamic Link domain and put the link there.

> [accordion] The domain is not verified
>
> App association requires a verified domain with a valid certificate. Check `get_domain_verification_info` and `get_domain_ssl_status`.

> [accordion] There is a redirect in the way
>
> Neither platform follows redirects when fetching these files. `http` to `https`, or apex to `www`, is enough to break it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.