T
Typebot5mo ago
Donal

Test webhooks against localhost

I'm trying to use a webhook block to save history from the typebot in my database, however I can't test against a local API URL (such as http://localhost:8000/API_URL) for obvious reasons. Is there any way around this without me having to deploy my API first?
3 Replies
Donal
Donal5mo ago
I managed to get it working via ngrok so it forwarded to my localhost. However now I am having an issue due to the webhook sending requests as "text/plain" - is there any way to configure the webhook to send application/json data instead?
Baptiste
Baptiste5mo ago
Are you sure the body you are sending is JSON without syntax error? Can you share it here? Because it should automatically detect if it is indeed JSON
Donal
Donal5mo ago
You are absolutely right, silly mistake on my part. I assumed that the "Custom Body" was in JSON format already so I just added the key/value pair without brackets. Working perfectly now. Really appreciate your prompt replies, thank you!