> ## Documentation Index
> Fetch the complete documentation index at: https://www.dropfans.io/developers/llms.txt
> Use this file to discover all available pages before exploring further.

# Links & Telegram deep links

> Canonical profile, tip, subscribe and buy URLs for a creator — on the web and inside the Dropfans Telegram Mini App.

- Source: https://www.dropfans.io/developers/guides/links-and-deep-links
- Section: Guides
- OpenAPI: https://www.dropfans.io/developers/openapi.json

Never assemble Dropfans URLs by hand — [GET /links](https://www.dropfans.io/developers/reference/get-links.md) returns every canonical link for the creator behind your key, in one call.

## The response

```bash
curl "https://www.dropfans.io/api/external/links" \
  -H "Authorization: Bearer $DROPFANS_API_KEY"
```

```json
{
  "username": "ava",
  "web": {
    "profile": "https://www.dropfans.io/u/ava",
    "tip": "https://www.dropfans.io/u/ava?tip=1",
    "tipTemplate": "https://www.dropfans.io/u/ava?tip={usd}",
    "subscribe": "https://www.dropfans.io/u/ava?subscribe=1",
    "buyTemplate": "https://www.dropfans.io/buy/{productId}"
  },
  "telegram": {
    "bot": "dropfansbot",
    "profile": "https://t.me/dropfansbot/app?startapp=p_ava",
    "tip": "https://t.me/dropfansbot/app?startapp=t_ava",
    "tipTemplate": "https://t.me/dropfansbot/app?startapp=pt_{cents}_ava",
    "subscribe": "https://t.me/dropfansbot/app?startapp=s_ava",
    "spin": "https://t.me/dropfansbot/app?startapp=w_ava",
    "buyTemplate": "https://t.me/dropfansbot/app?startapp=b_{productId}"
  }
}
```

A creator without a username returns `409 { "error": …, "code": "username_required" }` — ask them to set one in their profile first.

## Web links

- `/u/<username>` — the profile.
- `/u/<username>?tip=1` — profile with the tip sheet auto-opened.
- `/u/<username>?tip=<usd>` — tip sheet **prefilled** with that dollar amount, when it is within $5–$750; out-of-range values open the sheet unfilled.
- `/u/<username>?subscribe=1` — profile with the subscribe sheet open.
- `/buy/<productId>` — a drop’s checkout page.

## Telegram Mini App links

`t.me/<bot>/app?startapp=<param>` opens the Dropfans Mini App inside Telegram. The `startapp` prefixes:

| Prefix | Opens |
| --- | --- |
| `p_<username>` | the creator’s profile |
| `t_<username>` | the tip sheet |
| `pt_<cents>_<username>` | the tip sheet prefilled — **amount in cents** |
| `s_<username>` | the subscribe sheet |
| `w_<username>` | the reward-wheel spin |
| `b_<productId>` | a drop’s checkout |

> [!IMPORTANT] Never hardcode the bot username
> When the `telegram` block is `null`, the Telegram bot is not configured for this environment — fall back to the web links. Always build Telegram links from the templates in the response, never from a bot name you saw once.

## Templating into a message

```javascript
const links = await (await fetch('https://www.dropfans.io/api/external/links', {
  headers: { Authorization: 'Bearer ' + process.env.DROPFANS_API_KEY },
})).json();

const buyLink = (links.telegram ?? links.web).buyTemplate.replace('{productId}', productId);
const message = 'new set just dropped — ' + buyLink;
```

Note the units difference between the two tip templates: `web.tipTemplate` takes **dollars** (`{usd}`), `telegram.tipTemplate` takes **cents** (`{cents}`). $10 is `?tip=10` on the web and `pt_1000_ava` in Telegram.

Next: [Sell a drop end-to-end](https://www.dropfans.io/developers/guides/sell-a-drop.md) or [Post to the For You feed](https://www.dropfans.io/developers/guides/post-to-feed.md).

---

Previous: [Upload images, audio and video](https://www.dropfans.io/developers/guides/upload-media.md) · Next: [Post to the For You feed](https://www.dropfans.io/developers/guides/post-to-feed.md) · All pages: [llms.txt](https://www.dropfans.io/developers/llms.txt)
