Skip to main content

Get widget token

Implementation Details

Notes

Fill in the following, from your PRD API template

This is the "Technical Guide" how to actually use the API

List endpoints and all CRUD operations supported

TypeValueOwner
API Name/OperationGet Widget Token@Keyi Fan
API VersionVersion:202401
API URI ( Fixed for all APIs )Host: open-api.tiktokglobalshop.com
Schemes: HTTPS
API PathPath:
  • /authorization/202401/widget_token | | | API Method | [GET] | | | API Function Description | This api is used to get your widget token to pass widget api. | |

Common Parameters(This section will be generated by Open platform)

Notes

Common Parameters required for the APIs

PropertiesTypeRequiredSampleDescription
app_keystringY38abcdEvery single app will have a unique key. Please use the specific key assigned to your app.
timestamptimestampY1623812664Unix timestamp GMT (UTC+00:00). This timestamp is used across all API requests. Developers can use this convert to local time.
signstringY5361235029d141222525e303d742f9e38aea052d10896d3197ab9d6233730b8c> Notes: Try to be descriptive

Signature generated by gen algorithm. When you send API requests to TTS, you must sign them so that TTS can identify the senders. | | x-tts-access-token | string | Y | aaaaa000-aaa0-aaa0-aaa0-aaaaaaaaa000 | Authorization Token, provided for all eligible TikTok Shop Partner Developers. Set it in header | | version | int32 | N | 1 | The API interface version you want to access |

Define OBJECT fields

Notes

For the column Additional clarification required | Detailed requirements:

For popular fields or common questions, add details

For Example: order_status is a key component. Link back to "Business Guide" if possible

Provide Code samples for both request and response

Request parameters

PropertiesTypeRequiredSampleDescription
No information

Sample Query

PLAINTEXTWord Wrap

https://open-api.tiktokglobalshop.com/authorization/202401/widget_token?app_key=123abc&sign=5361235029d141222525e303d742f9e38aea052d10896d3197ab9d6233730b8c&timestamp=1625484268

Response Parameters

fieldstypeRequiredSampledescriptionAdditional clarification required | Detailed Requirements
codestringreq0The success or failure status code returned in API response.
messagestringreqSuccessThe success or failure messages returned in API response. Reasons of failure will be described in the message.
request_idstringreq202203070749000101890810281E8C70B7Request log
dataobjectoptional
-widget_tokenobjectoptionalwidget token related info struct
--tokenstringoptionaleyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJVc2VySUQiOjc0OTM5OTA3NTMyNTY5MDA0ODYsIkNsaWVudEtleSI6IjZhbW00dnVoNWZvMWciLCJTaG9wSURzIjpbNzQ5Mzk5MDc1MzI1NjkwMDQ4Nl0sIkV4cGlyZSI6MTcwMTA2NjAyMCwiU2VsbGVyVHlwZSI6MiwiZXhwIjoxNzAxMDY2MDIwfQ.KS15mwJ8LUC2U6Chfbmwr7PO2mGK_3wLYYaa8TM6DixdKmbG3o4kRSlCfi1a6UotpXxU0CNelLwX1G5H3sY7vwThe widget token you used to pass a widget api
--expire_atint64optional1701363599The expire timestamp of widget token. Usually expire in 5 minutes

Response Sample

JSONWord Wrap

{  
"code": 0,
"data": {
"widget_token": [
{
"token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.
eyJVc2VySUQiOjc0OTM5OTA3NTMyNTY5MDA0ODYsIkNsaWVudEtleSI6IjZhbW00dnV
oNWZvMWciLCJTaG9wSURzIjpbNzQ5Mzk5MDc1MzI1NjkwMDQ4Nl0sIkV4cGlyZSI6MTcwMTA2
NjAyMCwiU2VsbGVyVHlwZSI6MiwiZXhwIjoxNzAxMDY2MDIwfQ.KS15mwJ8LUC2U6Chfbmwr7PO2mGK_
3wLYYaa8TM6DixdKmbG3o4kRSlCfi1a6UotpXxU0CNelLwX1G5H3sY7vw",

"expire_at": 1701363599
}
]
},
"message": "Success",
"request_id": "202203070749000101890810281E8C70B7"
}

Error Codes

Notes

Error codes must be prescriptive: state the error code, define it, and prescribe a solution

Error CodeError MessageError Description ( in API Documentation )
Impact LevelPotential ImpactResolution
98001001internal errorL3Unable to retrieve authorized shop info.. The SLA will be affected.System error. If it occur frequently, please oncall.
98001004Invalid paramL3Param is not validPls check the api document
13002013Seller does not existL3Unable to find the sellerThis case happened when you use a wrong token to access this api

API Testing

Notes

Describe how a developer can test the API

If you can use the API testing tool, then use it

If you need to use Sandbox, then use it

For this API, you can utilize API Testing tool.