API Reference
Get a long-term access token
/open_api/v1.3/oauth2/access_token/https://tiktok-ads.mimicr.dev · provider: https://business-api.tiktok.comUse this endpoint to obtain a long-term access token from the auth_code the advertiser authorization redirect carries. Only Content-Type: application/json is supported.
The auth_code is valid for 1 hour and can be used once. The token does not expire and there is no refresh token: the response has no expires_in or refresh_token. scope lists numeric permission ids (1 Ad Account Management, 2 Ads Management, 3 Audience Management, 4 Reporting, 5 Measurement, 6 Creative Management, 8 Pixel Management, 12000000 Lead Management).
Errors: 40002 (missing field), 40113 (unknown app), 40101 (wrong secret, or a code of another app), 40110 (code used, revoked or older than 1 hour).
Authorization
Public route, no token.
Body
application/jsonID of your developer app.
Secret of your developer app.
The authorization code (auth_code) generated by your Advertiser authorization URL.
Responses
200Response envelope {code, message, request_id, data}. code 0 (message "OK") is success. Validation and business errors also come with HTTP 200 and a non-zero code: check code, not the HTTP status.
Return code. 0 means success; see the return codes appendix for the others.
Return message: OK on success, otherwise the error description.
The log ID of the request, which uniquely identifies it (also sent in the X-Tt-Logid header).
Returned data.
Show child attributes
The long-term access token for permission verification.
The list of ad accounts that the token can access.
The scope of permissions granted to the access token. See Permission scope to learn about the permission that a scope ID (value of scope) corresponds to.