Describe the problem/error/question
I’m trying to use the “Download TikTok Video” node via RapidAPI in my n8n workflow. The node fails with an error related to invalid JSON, although I expected a proper API response.
The Step before is Trigger: Get TikTok URL via Telegram
What is the error message (if any)?
Invalid JSON in response body
Error: Invalid JSON in response body at jsonParse
at ExecuteContext.execute (…)
…
See attached screenshot for the full stack trace.
Please share your workflow
json
{
“nodes”: [
{
“parameters”: {
“url”: “https://tiktok-download-video1.p.rapidapi.com/getVideo?url={{ $json.message.text }}”,
“authentication”: “none”,
“sendHeaders”: true,
“headerParametersUi”: {
“parameter”: [
{
“name”: “x-rapidapi-host”,
“value”: “tiktok-download-video1.p.rapidapi.com”
},
{
“name”: “x-rapidapi-key”,
“value”: “<MY_API_KEY>”
}
]
}
},
“name”: “Download TikTok Video”,
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 3,
“position”: [720, 300]
}
]
}
Share the output returned by the last node
Invalid JSON in response body
The node fails because the API response is not in proper JSON format, possibly due to:
• HTML being returned (e.g. 403 or 404 error page),
• or the TikTok URL is malformed or no longer supported by the API.
Information on your n8n setup
• n8n version: 1.94.1 (Self Hosted)
• Database (default: SQLite): Default
I’d love to help, but it looks like the workflow code you’ve pasted isn’t quite correct.
Could you please share the actual workflow again, making sure it’s properly formatted?
Tip: You can insert your workflow by clicking the </> button and pasting in the workflow’s code.
Also, it would be really helpful if you could pin the data in the relevant node(s), so we can better understand what’s going wrong and debug more effectively.
For pinning the data you can first execute the node and and from the output click on the pin icon.
Thanks Subhanshu Sharma, for your support. I am beginning on n8n. your support is more than helpful.
Below my source code + error message - in attachment the workflow + http request
what is it wrong ? thanks for your advise
Did you want to jump on a call? We can try call outside n8n see what results you get, it worked first time for me let me know, we can use discord google meet?
Thank you for meeting, to confirm we used split('?q=')[0 I think it was, which removed the unneeded query parm from the url which is shared via telegram.
Please do mark as solution and feel free to reach out if anything further comes up.