BOTPRESS WEBHOOK UNABLE TO RECEIVE POST REQUEST
# 🤝help
a
The botpress webhook integration can't receive post request. I have tried other free test webhooks online and they're working but botpress webhook is unable to do the same. Please any assistance will be highly appreciated. I will really appreciate it if someone can tell me how it works, that is if it's working
a
hey @ancient-author-26489 how is your bot set up to receive webhook payloads?
a
Yes I have followed every step but nothing is still going through. Have you used the webhook before to receive data, if yes put me through.
a
would you mind generating a problem report? Then I'll be able to see the bot directly
@square-energy-41150 how to get a problem report ID
huh looks like the bot is down. To gen. a problem report hit this option and fill out the form
a
I will do so but how will it work when the data don't even arrive botpress from it's webhook?
a
not sure, that's why we test. But my top two hunches are: 1. The request going to Botpress webhook is not well formed 2. The bot is not processing the incoming data so it looks like nothing is being done
we'll know for sure when I take a look at the bot, so plz share a report ID
a
Give me a minute let me generate the report
Thanks, this is the report id 131afdc6-285e-4e67-a174-6a71b37ed63c
So I will be waiting for your reply To test other webhooks you can use the free online webhook testers to check it out, you will see the exact message I'm supposed to receive through botpress webhook.
a
So @ancient-author-26489 nothing is wrong with your webhook, it is receiving data with no issues. I added a brief bit of code immediately after the webhook, and was able to see the posted data in the logs. A couple of tricky things about the webhook workflow: 1. Because there is only one webhook for your bot, the webhook will only post its data to the published version of your bot. You will need to publish your bot before testing to see changes. 2. Because the webhook works with the published version of the bot, logs won't be shown in the studio; instead you need to view the producton logs from the admin panel.
I used Insomnia to test https://insomnia.rest/
but Postman is also another popular API tool you can try
a
Thanks for the response but I didn't see the message received by the webhook and I would also know how I could utilize the message but please can I see the message received in botpress
a
you can save the data as a variable and then speak the variable
a
Please can you give me a screenshot of the data received
a
Sure. First I send data from Insomnia (my webhook testing tool) like this. I am using my account's personal access token for authentication.
Then, immediately after the webhook trigger I have some code
This is the code:
Copy code
js
console.log('Webhook received!')
console.log(event.payload)
workflow.payloadData = event.payload.body['text']
it: 1. Logs that a webhook was received 2. Logs the contents of the incoming request's payload 3. Saves the content form the payload body's
text
field to a new variable
Finally, I speak this variable using a normal text card
it is red because I haven't created the variable in the bottom left panel
but as soon as I create the variable it turns green
a
Can you please send from the AI caller I'm using, that will be more effective, you can swap the webhook section of the API with yours
I need to see the json string sent by the ai after the call.
I'm available for a call though
a
There is no info returned from the webhook
You can try with whatever API tool you're using. Here's the body:
Copy code
js
{
    "type":"text",
    "text":"Hello World"
}
a
But I used other webhook and it worked, botpress doesn't
a
You can even try it as a cURL request in terminal
Copy code
curl --request POST \
  --url https://webhook.botpress.cloud/96a2aa78-f745-4567-9a94-ee0beaa50549 \
  --header 'Authorization: Bearer <YOUR_PAT_HERE>' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: insomnia/8.4.5' \
  --data '{
    "type":"text",
    "text":"Hello World"
}'
just replace the with your actual access token
a
Are you please available to help me out on a call
a
I am not available for a call, no
f
Maybe this video can help you @ancient-author-26489

https://www.youtube.com/watch?v=mrkQ5iLb4DM

a
I have watched it, and I don't have a problem with webhooks, just that botpress webhook is not receiving data for my use case, I have been using webhooks for a long time.
Please, can you at least try out my use case to see what's wrong
a
was this not your use case? Get data from a webhook payload and have the bot speak it
a
My use case was the bot I sent you or maybe should I add you as a collaborator if you don't have access to the bot
a
I have access to the bot. It's this bit, right?
Webhook says the status of the call, bot picks it up and then says the status back
a
Yes, the workflow.talk don't display what is sent through the webhook
a
yep, the two reasons for that are: 1. The in the code, you used workflow.task not workflow.talk as the variable 2. You were assigning event.payload.call_status when tou need to be assigning event.payload.body['call_status']
a
This is the API, and this is were the webhook is attached, you can swap it for yours and test it out.
I know, workflow.task is for the task, I didn't plan to display it, I was trying to display workflow.talk which has the content of the webhook received data
Please are you testing it? What are your findings?
a
I am testing it, yes
a
Okay, I'm still online
I just received a call right now, it should come through if it works
The "call API" is the AI caller api, if you need it I can give you mine in your DM
a
okay so just tested it, it works just fine
I copied the same info from the earlier chat history- phone num, API key, etc
only think I changed was the code after the webhook
changed it to
Copy code
js
console.log(event.payload)
workflow.task = JSON.stringify(event.payload)
just so I could see what the payload being returned was
a
Okay did you finally see the output, I would love a screenshot
a
a
Thanks, but this is not the data that should be sent down the webhook, the data that should have been sent should have been the transcript
a
ah you mean like this?
a
If you want to see the data that should be sent to botpress webhook, Please use this free webhook online https://webhook-test.com/ And replace the botpress webhook with the webhook you generate from the site, then make the call again
a
this popped up earlier in the testing, then about 5-6 min ago it changed to the Las Vegas one
a
This should be the output
This is the output I was trying to send to botpress. How will I save it into a variable because according to my research any input from the user deletes or concatenates the data from the webhook
a
you can do that in the code card. Just get the right field names like
event.payload.body['status']
etc.
I think you have everything you need to get it done on your side
test, log lots of things
and you can save & replay webhook events, too
just click on the webhook trigger node
using the 'discover events' button
a
Thanks a lot but can this happen in the background if you're not around, so to correct my mistake, what exactly made my own version not display or getting the data from the webhook
a
You were not correctly getting the data from the payload. Your code was looking for data in
event.payload.call_duration
or something like that, and you should have been looking in
event.payload.body['call_duration']
a
Another thing is did you know why this changed?
a
I assumed you had made changes on your side
a
I mean from the chunk of text to {"type","text","text"...............
a
I don't know about that. You'll have to do some testing on your side to find out
a
Okay, apart from changing the code syntax to event.payload.body['call_status'] What else do I need to know? Please secondly how did you get the right syntax bcuz it has been a nightmare on my side.
a
review what has already been said in this thread. I go through step by step how to call your webbhook, troubleshoot, etc
a
Thanks again for taking your time to assist me, but before you go, how long did it take for the data to arrive? Secondly, can I automate the data in the background, like receive the data and sending it to Google sheets using Zapier? Lastly I hope you don't mind if I dm you when I encounter an issue ?
a
* The data arrived near instantly * You're free to try what you want. * No, please make posts on #1111009377525186570 so others can learn, too
a
Yes, please I didn't see the changes yet, did you do it in your own version of the code? I would love it if you do the changes directly on my project, let me see for my self
Please 🙏🙏 can you reflect the changes in my bot?
a
the change was literally one line of code, my dude
right here
and you can review this entire thread to see the process of how we got there
a
Okay, the changes was here right?
q
What great and detailed instructions from @acceptable-kangaroo-64719, these are going to be so useful for many things! 🫡 And a really cool project, @ancient-author-26489. Your chatbot starts to look AWESOME, and we finally got Biden on board to make some cold calls.
f
Hello, everybody! It is nice work. But I have problem with webhook too. I did everything like @acceptable-kangaroo-64719 but it isn't working. And I don't "Discover event" button in botpress studio. May be something wrong with my botpress? Could you help me with it, please?
a
Bro we are not using the same software to send the response, so it won't be sent in the same format. What component of the data from the software do you want to receive. Try to check the documentation of the software you're receiving from
f
json if it possible I'm runing script from aitable (below). script is correct. console.log(
Hello, ${base.name}!
); const inputData = input.config() const { recordId, rooms } = inputData; const response = await fetch("https://webhook.botpress.cloud/fad69cb4-633a-4a6a-a8b2-79200cb24a84?recordId="+recordId+"&rooms="+rooms) console.log(response.status) But I tryed to send data from Insomnia, but nothing too
a
are you running script from airtable to fetch info from botpress or what?
f
yes, i'm running script from airtable to fetch data into botpress webhook
a
@acceptable-kangaroo-64719 I did exactly the process, added the code after the webhook node but i did not get the feedback you got in the your screenshot, and i could recall you said the bot must be publish to get the data but in the screenshot you got it in the emulator. Can you please explain?
The discover event does not show up when I click the webhook 😮‍💨
@acceptable-kangaroo-64719 I couldn't get this output
e
The webhook URL is just for sending data to a bot, it doesn't provide a response. You would use the URL to start a conversation and save data -------
@ancient-author-26489 please read and reread this thread to understand what's happening, you have everything to get it working already
Gordy has gone above and beyond trying to give you the solution
Now it's up to you. Check out the documentation to understand how the platform works https://botpress.com/docs/
It links to other resources as well
a
I know, I just didn't phrase my English well because it's not my first language, what I'm saying is that the bot doesn't receive any data from the webhook
e
Hey @ancient-author-26489 are you still having issues?
q
@ancient-author-26489 🫡 If you are still having issues using Botpress Webhooks, check out this chatbot, tutorial and YouTube video from @fresh-fireman-491 🦾 https://discord.com/channels/1108396290624213082/1216153876051267584
It could be even better for your projects than previous solutions.
24 Views