# TikTok over API

This page explains how to set up API access for TikTok Business Messaging with Infobip. Before you begin, make sure you have completed the [general TikTok setup](https://www.infobip.com/docs/tiktok/get-started).

To send and receive TikTok messages through the API, you need an API key and a configured webhook endpoint.

___

## Prerequisites [#prerequisites]

Before you set up API access, make sure you have the following:

- A [connected TikTok Business Account](https://www.infobip.com/docs/tiktok/get-started#connect-tiktok-and-infobip-integrate-tiktok-with-infobip)
- An **HTTPS endpoint** that can receive webhook requests
    - It must be publicly accessible over HTTPS
    - It must be able to respond with `HTTP 200` to acknowledge receipt
    - It must be [secured](#configure-event-subscriptions) using the configured notification profile setting

___

## Set up API access [#set-up-api-access]

To send TikTok messages programmatically, you need an API key with the required permissions.

1. In the Infobip [web interface](https://portal.infobip.com/login), go to **Developer Tools** > **API Keys**.
2. Select **Create API key**.
3. Add a name and select the following API scopes:
   - `tiktok:manage`
   - `saas:tiktok-ads:manage`
4. Select **Create** to generate the API key.

Copy and store it securely because you will use it in the [Authorization header](https://www.infobip.com/docs/essentials/api-essentials/api-authentication#api-key-header) when sending [API requests](https://www.infobip.com/docs/api/channels/tiktok).

___

## Configure event subscriptions [#configure-event-subscriptions]

To receive inbound messages as well as delivery and seen reports, you must create [event subscriptions](https://www.infobip.com/docs/cpaas-x/subscriptions-management).

1. In the Infobip [web interface](https://portal.infobip.com/login), go to **Developer Tools** > **Subscriptions**.
2. [Create a subscription](https://www.infobip.com/docs/cpaas-x/subscriptions-management/create-manage-subscriptions#create-a-subscription) for TikTok and select the following events:
   - **Delivery**
   - **Inbound message**
   - **Seen**
3. During the [notification profile](https://www.infobip.com/docs/cpaas-x/subscriptions-management/create-manage-subscriptions#create-and-manage-notification-profiles) creation step, enter your public HTTPS endpoint URL.
    - Keep in mind the [HTTPS endpoint requirements](#prerequisites).

    NOTE
If available, enter a **secret key** that you will use to verify webhook signatures/hashes. While creating the notification profile, configure **HMAC** authentication under **Security settings** and add the secret key.

4. Save your TikTok event subscription.

Visit the [API essentials](https://www.infobip.com/docs/essentials/api-essentials/api-authentication) and [Subscriptions](https://www.infobip.com/docs/cpaas-x/subscriptions-management) pages to explore key concepts and setup instructions.

___

Related pages

[Send and receive TikTok messages](https://www.infobip.com/docs/tiktok/send-and-receive-messages)
Send your first message after completing the API setup.

[TikTok message types](https://www.infobip.com/docs/tiktok/message-types)
Review supported text, image, and share post formats.

[Delivery and seen reports](https://www.infobip.com/docs/tiktok/reports)
Monitor delivery and seen events for outbound messages.