TikTok Business API - always 40131 Authorization code is expired

122 views Asked by At

https://business-api.tiktok.com/portal/docs?id=1766037914914818&rid=uz955smt6w

Account API

Authorization url returns code successfully.

https://business-api.tiktok.com/portal/auth?app_id=*&redirect_uri=*&state=*

But all requests on next endpoint to get refresh token and access token returns in error

Array
(
    [code] => 40131
    [message] => Authorization code is expired.
    [request_id] => 20231128065023E81AF5A697F6751ACD17
)

curl --location --request POST 'https://business-api.tiktok.com/open_api/v1.3/tt_user/oauth2/token/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "client_id": "***",
    "client_secret": "***",
    "grant_type": "authorization_code",
    "auth_code": "***",
    "redirect_uri": "http://localhost:8000/tikTokBusinessAccount"
}'

No error is expected as the result.

0

There are 0 answers