Brand API quick startBeta
Create an API token with the right scopes and make your first three calls.
Beta. The Brand API is in beta. Fields can still be added to version 1, and any breaking change will ship as a new version (/api/v2) rather than change v1.
1. Create a token
Open Developers in your workspace and go to API tokens.
Create a token and choose the scopes it needs (see the table below).
Copy the token now. It starts with
tk_and is shown only once. Tarkle stores only a hash of it.
Scope | Allows |
|---|---|
| List and read brands, their files, |
| Update a brand's text, links, color, access, download approval and tracking IDs. |
| List download and view requests and approve or reject them. |
A token created before scopes existed has no scopes and cannot call the Brand API. It keeps working for whatever it was used for before. Create a new token to use the API.
2. Send the token
Send it as a bearer token on every request. Keep it on your server: the API does not allow calls from a browser, and a token in a web page is a leaked token.
export TARKLE_TOKEN="tk_your_token_here"
curl -H "Authorization: Bearer $TARKLE_TOKEN" https://tarkle.com/api/v1/brandsUse your own workspace address instead of tarkle.com if you use a custom domain.
3. Update a brand
{brand} is the brand's id or its slug.
curl -X PATCH \
-H "Authorization: Bearer $TARKLE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"summary":"Business banking for SMEs","download_approval":true}' \
https://tarkle.com/api/v1/brands/aspire4. Approve a download request
curl -X POST \
-H "Authorization: Bearer $TARKLE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"action":"approve"}' \
https://tarkle.com/api/v1/brands/aspire/requests/REQUEST_IDFind the request id by listing GET /brands/{brand}/requests?status=pending first.