Skip to content

Resolve a short link and 302-redirect to its destination

Public short-link entry point. Always responds with 302 (never 301 — a 301 would be cached and break tracking). Behavior:

  • Captures all 29 ad-platform Click IDs + UTM params + IP/UA/referrer/geo from the inbound query string and persists attribution asynchronously (waitUntil).
  • Appends _tl=<shortLinkId> to the destination URL and passes inbound query through, filling default UTM values.
  • Sets first-party cookies on Domain=retidal.com (Path=/; SameSite=Lax, Secure on https): visitor cookie (Max-Age 1 year) and session cookie (Max-Age 30 min). Reuses existing cookie values if present.

Attribution query params the caller may pass through on the inbound link are the standard Click IDs (bd_vid, gclid, fbclid, …) and UTM params; they are extracted automatically. _tk/shortLinkCode is NOT used here — that is an event-ingest field for direct-landing (non-redirect) attribution.

Auth: none (public).

code
required
string

The short-link short code (base62, nanoid).

Redirect to the resolved destination URL (with _tl appended).

Location
string format: uri

Destination URL with _tl=<shortLinkId> and passed-through query.

Set-Cookie
string

Two cookies — visitor (1y) and session (30m). Multiple Set-Cookie headers are emitted.

Short link does not exist (plain-text body 链接不存在).

Media typetext/plain
string
Example
plaintext
链接不存在

Short link is paused (链接已暂停) or expired (链接已过期).

Media typetext/plain
string
Examples
plaintext
链接已暂停