I am facing issue while sending message in my Chatbot. I had taken the below steps to create the Chatbot.
- Created the bot using Bot framework SDK v-4 and published to Azure
- Created the Bot Channels Registrations and registered the App ID
- Included the AppID and password for the bot channel in my Bot service API's app settings in Azure
- Created a web client using botchat-es5.js (es-5 version)
When I type and send a message (using the web client) I get below error (with code error 502) on my browser console.
POST https://directline.botframework.com/v3/directline/conversations/7IqYgcAzBp4EObQvFzK2fF/activities 502 (Bad Gateway)
The Directline and Web chat channel logs shows the error message as
There was an error sending this message to your bot: HTTP status code Forbidden
Below is the request header details.
Below is the Bot config (.bot) file details. Note, the App ID and Password is blank, if that's the issue?
{
"name": "Chatbot",
"services": [
{
"type": "endpoint",
"name": "development",
"endpoint": "http://localhost:3978/api/messages",
"appId": "",
"appPassword": "",
"id": "1"
},
{
"type": "endpoint",
"name": "production",
"endpoint": "https://<my_app_name>.azurewebsites.net/api/messages",
"appId": "<YOUR APP ID>",
"appPassword": "<YOUR APP PASSWORD>",
"id": "2"
}
],
"padlock": "",
"version": "2.0"
}
I tried re-creating all of these on a different subscription but I get same error. I have another bot which is up and running and if I use the Directline channel key of that bot in the same web client, it works fine.
I looked for some online references but those didn't help. Can someone please help me if I am missing something? Let me know if I can provide more details.
.bot
file, you need to set yourappId
andappPassword
for your production endpoint. The 403 Forbidden error is almost always appId/password related. What method did you use to deploy/publish your bot? I can help walk you through the deployment steps. – mdrichardson