Hi Community,
I am using the HTTP module “Make an OAuth2.0 Request” to connect to TikTok for developers to publish videos to my account. I am using a sandbox version of my “App” in TikTok to be able to do the setup before passing on to the actual live version.
It looks like I have successfully managed to setup the Authorization flow as it is now saved in my connections and the login windows with scopes appears as should be.
The issue I am facing is when I try to submit my API request to publish the video, I get an error 401 return from TikTok telling me: “The access token is invalid or not found in the request. Please refresh the token and retry.”
Is this because the access_token is not succesfully being passed on with the API request? When looking at the input bundle it looks like the header is completely empty…
Any help with this issue would be very much appreciated. Thank you
Alex
For information, TikTok needs to receive the access_token in the header with the API request as follows:
I have setup my API request like this:
And I set up the connection to find the access_token in the header using the token name “Bearer”:
If you need more info on the documentation for TikTok api please see the specifics here: TikTok for Developers
Here is the input bundle that is being passed to the OAuth2.0 module:
[
{
"ca": null,
"qs": [],
"url": "https://open.tiktokapis.com/v2/post/publish/video/init/",
"data": "\"post_info\": {\n \"title\": \"dsdsdsdsd\",\n \"privacy_level\": \"PUBLIC_TO_EVERYONE\",\n \"disable_duet\": false,\n \"disable_comment\": false,\n \"disable_stitch\": false,\n },\n \"source_info\": {\n \"source\": \"PULL_FROM_URL\",\n \"video_url\": \"https://url_example"\n }",
"gzip": true,
"method": "post",
"headers": [],
"timeout": null,
"useMtls": false,
"bodyType": "raw",
"contentType": "custom",
"serializeUrl": false,
"shareCookies": false,
"parseResponse": true,
"followRedirect": true,
"useQuerystring": false,
"customContentType": "application/json; charset=UTF-8",
"followAllRedirects": false,
"rejectUnauthorized": true
}
]