ETLMCPData Conveyance Works
Log in Start free
Docs

TikTok connector errors

What each TikTok return code means for an etlmcp sync, which codes are retried by themselves, and which need a reconnect or a different ad account.

Coming This connector is coming.

TikTok reports a failed call with a numeric return code in the response body, and that code wins over the HTTP status: a response with status 200 can still be a failure. When the connector is available, etlmcp reads the code first and sorts it into five groups. Rate limits and maintenance are retried by themselves. A broken connection needs a reconnect, an ad account you can no longer reach needs a check of access in TikTok, and a problem with etlmcp's own TikTok app needs a fix on etlmcp's side. For the connector's fields and setup, see the TikTok connector.

Codes that need a reconnect

etlmcp treats six codes as a token that no longer works: 40102, 40103, 40104, 40105, 40107 and 40110. In TikTok's reference these cover an expired access token, an expired or wrong refresh token, an empty token, an invalid token and an authorization code that was cancelled, already used or expired.

The run ends with TikTok needs reconnecting and is not retried, because the same token would get the same answer. Before the run ends, etlmcp marks the connection as one that needs reconnecting. On the sources page, use the Reconnect button on the TikTok connection, signing in as a person who still has access to the ad accounts, then start the sync again.

Codes about access to one ad account

Two codes, 40001 and 40106, mean the token lacks access. TikTok describes 40001 as no permission for the operation and 40106 as an invalid core user; for 40106 it asks you to check that the access token is valid for the advertiser you named. When either code comes back on a report or an ad account details request, etlmcp treats it as a problem with that one ad account: the run ends with this ad account is no longer accessible and the source is marked. On any other request, the same codes mean the grant itself lacks access, and the run ends with TikTok needs reconnecting.

Three more codes are about the advertiser a request names: 40119 (the developer and the advertiser are not in the same company), 40300 (the advertiser does not exist or was deleted) and 40301 (the advertiser cannot be matched). On a report or details request they end the run with this ad account is no longer accessible as well. Check in TikTok Ads Manager that the account still exists and that the person who connected it still has access. If the account moved to another business, connect it again through someone who can see it. Only this source is marked: other ad accounts on the same connection are left as they were.

Codes about etlmcp's TikTok app

Four codes point at etlmcp's own app rather than at your account: 40101, 40113, 40125 and 40131. TikTok uses them for an app id and secret that do not match, a blocked or unknown app, a developer without the needed permission (40125 also covers a field that is not supported) and an authentication error on the token endpoints. The run ends with tiktok refused this server's app (code 40113), with the number TikTok sent, and is not retried. Reconnecting does not change it. It needs a fix on etlmcp's side: note the code and the time of the run when you report it.

Rate limits and maintenance

Codes 40016, 40100 and 40133 mean TikTok is throttling calls. TikTok's reference ties 40016 and 40100 to limits on the developer app and 40133 to a limit on calls per second for one advertiser. etlmcp waits and sends the call again within the same run; TikTok's connector starts with longer waits than most platforms. If the limit holds through every try, the run fails with tiktok is rate limiting requests and is retried as a whole: a run gets 3 attempts in all, the second at least 60 seconds after the first and the third at least 300 seconds after the second. See retries for how those waits work.

Code 60001 means TikTok is in maintenance. etlmcp also treats every code from 50000 to 59999 as a passing fault on TikTok's side; TikTok's own list of system codes includes 50000, 50002 and 51305. etlmcp retries both kinds the same way, first within the run and then as a whole run. If every attempt fails, the run shows tiktok API error 60001: followed by TikTok's own text, cut to a short length. Wait for the maintenance to end and start the sync again; routine syncs re-pull the last 29 days, so a missed day inside that window comes back on the next one.

Any other code

A code outside these groups ends the run with tiktok API error {…}: {…}, the code and TikTok's message, and is not retried. Look the code up in TikTok's return-code reference. Messages that every connector can raise, such as network errors, are on the shared errors page, and run statuses explains how a failed run is shown.

Related

Sources

  1. Return codes — business-api.tiktok.com, checked