TikTok Shop OAuth2 404 Error

Can anyone help with an OAuth2 issue I’m running into with TikTok shop?

I’m getting a 404 error during the authentication handshake.

When I manually attempt to hit this URL (as provided by TikTok) I’m given the access token, refresh token and so on, but n8n returns a 404 error when trying to do the handshake. I’m wondering if n8n sends code instead of auth_code in the query parameters?

https://auth.tiktok-shops.com/api/v2/token/get?app_key={{app_key}}&app_secret={{secret}}&grant_type=authorized_code&auth_code={{code}}

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @scottyb!, thanks for reaching out!

I couldn’t find the url structure you referenced in the TikTok Shop API documentation.

I recommend you start there and use their API Testing Tool to ensure you are structuring requests to their endpoints correctly prior to building out functionality in a workflow.

Happy building!

Hi Ludwig,

Thanks for the reply :slight_smile:

The TikTok docs are here (you can search the page for https://auth.tiktok-shops.com/api/v2/token/get to see that part of the docs), and their requirements for signing requests is here.

The structure is definitely correct as I’m able to generate the API key manually, just not when using the OAuth2 flow in the HTTP Request Node.