Connect to TikTok API

While we don’t have a native integration, we can pull data from TikTok using our API steps.

To start, you’ll need to request developer access from TikTok to generate your credentials. From there, you can authorize the connection.

Authorization process

Generating a temporary auth_code

  1. In the TikTok Marketing Portal, head to My Apps and click the application(s) you want to grant access to.
  2. Copy and paste the Authorized URL into your browser
  3. Select the Permissions you want to grant and click Confirm
  4. You will be redirected to a separate URL in your browser
  5. In the URL, copy the parameter value after &auth_code=
    1. For example,
https://ads.tiktok.com/marketing_api/docs?state=your_custom_params&code=3c6dc21d2db289199737bcb8c006c23aaf000a1e&auth_code= **1234c21d2db289199737bcb8c006c23aaf000a1e** &id=170189090577920

Generating a long term access_token

  1. Head to Parabola and use a Pull from an API step to make a POST request to this endpoint: https://ads.tiktok.com/open_api/v1.2/oauth2/access_token/
  2. In your Request body, add this JSON:
{

"secret": "SECRET",

"app_id": "APP_ID",

"auth_code": "AUTH_CODE"

}
  1. Replace your SECRET and APP_ID with the values stored in your Portal. Copy the auth_code value from the above URL as your AUTH_CODE.
  2. If successful, the API will return an access_token

You can now use the access_token as an API key in future requests. When sending an access_token to their API, send it as a custom header with the Header Key of “Access-Token”. Insert the access_token as your Header Value.

Once authorized, you can then make requests to TikTok’s API.

The example report below pulls TikTok’s Basic report and combines it with campaign data. Feel free to use it to get started using this snippet: parabola:cb:69471cd28150404a922ef23d320224f2

Note: You’ll need to enter your access token in the “Request Header” section.

Let us know if you have any questions!