Server API: Saved links
The app’s saved links, made, read and changed by your servers, with their stats.
| What it does | Route |
|---|---|
| List the links | GET /server/v1/links |
| Make a link | POST /server/v1/links |
| Read a link | GET /server/v1/links/{slug} |
| Change a link | PATCH /server/v1/links/{slug} |
| Read a link’s stats | GET /server/v1/links/{slug}/stats |
List the links
Section titled “List the links”GET /server/v1/links
A page of the app’s saved links, the newest first: by kind (staff, shared or referral; staff’s unless asked), campaign, channel, tag, archived, or a search. Needs a key with the links scope.
Needs: a server key (Authorization: Bearer crm_sk_…). See Connect your backend.
Parameters
| Name | In | Description |
|---|---|---|
q | query | Words to search for. |
campaign | query | |
channel | query | |
tag | query | |
kind | query | |
archived | query | |
cursor | query | |
limit | query | How many to answer, at most. |
Answers
| Status | Body | Meaning |
|---|---|---|
| 200 | SavedLinkList | OK |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 429 | problem | Too many requests: wait for Retry-After. |
Make a link
Section titled “Make a link”POST /server/v1/links
A saved link, as the Links tab makes one: its slug (made up when empty), destination, data, campaign, channel, overrides, preview, goal and expiry. With an Idempotency-Key, a request sent again answers the link the first made, 200 with Idempotent-Replayed. Needs a key with the links scope.
Needs: a server key (Authorization: Bearer crm_sk_…). See Connect your backend.
Parameters
| Name | In | Description |
|---|---|---|
Idempotency-Key | header | Your own id for this link (at most 100 characters): sent again, it answers the link it made. |
Body (application/json): SavedLinkBody
| Field | Type | Description |
|---|---|---|
android_url | string | |
campaign | string | |
channel | string | |
countries | array of LinkCountryRule | |
data | object of string | |
desktop_mode | string | |
desktop_url | string | |
destination (always) | string | |
expired_url | string | |
expires_at | string (date-time) | |
goal_days | integer | |
goal_event | string | |
ios_url | string | |
name (always) | string | |
og_description | string | |
og_image | string | |
og_title | string | |
slug (always) | string | Made up when it is empty. |
tags | array of string | |
template_id | string | |
variants | array of LinkVariant |
Answers
| Status | Body | Meaning |
|---|---|---|
| 200 | SavedLink | OK |
| 201 | SavedLink | Made |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 409 | problem | Refused as things stand: the problem says why. |
| 422 | problem | A value that is not right: the problem says which. |
| 429 | problem | Too many requests: wait for Retry-After. |
Read a link
Section titled “Read a link”GET /server/v1/links/{slug}
One of the app’s saved links, by its slug, with its short and canonical addresses. Needs a key with the links scope.
Needs: a server key (Authorization: Bearer crm_sk_…). See Connect your backend.
Parameters
| Name | In | Description |
|---|---|---|
slug (required) | path | The article’s or collection’s slug. |
Answers
| Status | Body | Meaning |
|---|---|---|
| 200 | SavedLink | OK |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 404 | problem | Not found, or the part is switched off. |
| 429 | problem | Too many requests: wait for Retry-After. |
Change a link
Section titled “Change a link”PATCH /server/v1/links/{slug}
Changes the fields the body names; the rest stay as they are. Needs a key with the links scope.
Needs: a server key (Authorization: Bearer crm_sk_…). See Connect your backend.
Parameters
| Name | In | Description |
|---|---|---|
slug (required) | path | The article’s or collection’s slug. |
Body (application/json): SavedLinkBody
| Field | Type | Description |
|---|---|---|
android_url | string | |
campaign | string | |
channel | string | |
countries | array of LinkCountryRule | |
data | object of string | |
desktop_mode | string | |
desktop_url | string | |
destination (always) | string | |
expired_url | string | |
expires_at | string (date-time) | |
goal_days | integer | |
goal_event | string | |
ios_url | string | |
name (always) | string | |
og_description | string | |
og_image | string | |
og_title | string | |
slug (always) | string | Made up when it is empty. |
tags | array of string | |
template_id | string | |
variants | array of LinkVariant |
Answers
| Status | Body | Meaning |
|---|---|---|
| 200 | SavedLink | OK |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 404 | problem | Not found, or the part is switched off. |
| 409 | problem | Refused as things stand: the problem says why. |
| 422 | problem | A value that is not right: the problem says which. |
| 429 | problem | Too many requests: wait for Retry-After. |
Read a link’s stats
Section titled “Read a link’s stats”GET /server/v1/links/{slug}/stats
A link’s clicks, unique visitors, opens in the app and installs by day over a range (from and to, days in UTC; the last 30 by default), its clicks by platform, channel and referrer, and its goal’s conversions. Needs a key with the links scope.
Needs: a server key (Authorization: Bearer crm_sk_…). See Connect your backend.
Parameters
| Name | In | Description |
|---|---|---|
slug (required) | path | The article’s or collection’s slug. |
from | query | |
to | query | A link’s path in the app, with its query. |
Answers
| Status | Body | Meaning |
|---|---|---|
| 200 | LinkStats | OK |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 404 | problem | Not found, or the part is switched off. |
| 429 | problem | Too many requests: wait for Retry-After. |