Call Get Authorized Shops
Now that you've completed the last step of creating the cryptographic hash to sign your request, you're finally ready to make your first call to the TikTok Shop API.
Now that we've got all required parameter values, we can call the Get Authorized Shops API. For this call, we have to pass the access_token in the x-tts-access-token header, so you'll need to use a tool such as cURL to create the request.
| Parameter | Location | Type | Description |
|---|---|---|---|
app_key | Query | string | The App key that was generated when you created your TikTok Shop App. You can retrieve this value by visiting the TikTok Shop Partner Center Console, selecting App & Service from the left navigation, clicking on your TikTok Shop Application card in the App & service pane, then scrolling down to the Developing section. |
sign | Query | string | The cryptographic hash that you created in generate a hash to sign your test API call. |
timestamp | Query | Unix timestamp | The Unix epoch time stamp that you used to generate the sign parameter above. Note that the timestamp used to generate the cryptographic hash and the value you generate for this API call must not be more than five minutes apart. |
x-tts-access-token | Header | string | The test access token you created when you generated a test access token. |
For this HTTP request, you're required to add headers. If you're not creating the request programmatically in code using an HTTP library in your favorite programming language, you'll need to use a tool such as cURL.
If you're using cURL, your first API call will resemble:
TEXTWord Wrap
curl --location --request GET 'https://open-api.tiktokglobalshop.com/authorization/202309/shops?app_key=<your App key>&sign=<your cryptographic hash>×tamp=<a timestamp within 5 minutes of when the sign parameter was created>'
--header 'Content-Type: application/json'
--header 'x-tts-access-token: <your access token>'
If your request was successful, you'll receive the following response:
JSONWord Wrap
{
"code": 0,
"data": {
"shops": [
{
"cipher": "<the shop cipher for your test TikTok Shop>",
"code": "<the shop code for your test TikTok Shop>",
"id": "<the identifier for your test TikTok Shop>",
"name": "<the name of your test TikTok Shop>",
"region": "<the region of your test TikTok Shop>",
"seller_type": "<your seller type>"
}
]
},
"message": "Success",
"request_id": "<the request identifier generated by the TikTok Shop server>"
}
Troubleshooting
The two most common issues that you may encounter may be related to your access token value in the x-tts-access-token header or the cryptographic hash you generated for the sign parameter.
If your request fails due to an authentication issue, please ensure that you've followed all the steps exactly in generate a test access token. If you still encounter authentication issues, you may have a problem with either your TikTok Shop App or your test TikTok Shop Seller account. You can reach out to technical support to help you resolve these issues.
If your request fails because of an invalid sign parameter, please review the content in sign your API request as it's much more comprehensive than the getting started content. If you still experience issues, please reach out to technical support for assistance.
Next steps
Now that you've successfully made your first API call, you're ready to start working on your TikTok Shop App. Head over to the developer guide to learn about:
- TikTok Shop API concepts,
- How to develop a public TikTok Shop App and launch it in the TikTok Shop App Store and the requirements for listing in the App development process overview,
- Our developer tools to help you with application development and testing.