I created Azure Bot Framework bot using REST API.
Bot replies in Web Chat all the time but the bot does not reply in Teams often. (Bot reply in Teams sometimes but very unstable)
When bot does not reply in Teams, it seems no messaging endpoint access in server log. Might it be a channel problem?
I added channel of Microsot Teams and I also tried adding channel of Skype before adding channel fo Teams like the article below but I got same problem still.
https://social.msdn.microsoft.com/Forums/ja-JP/cb4bbbfd-8202-4c12-bd2d-9e1f02bffcb5/botframework-azure-web-app-bot-dose-not-repry-from-microsoft?forum=windowsazureja
Tested like this
curl -X POST {serviceUrl}v3/conversations/{conversationId}/activities/{activityId} -H 'Authorization: Bearer {accessToken}' -H 'Content-Type: application/json' -d '{"type":"message","from":{"id":"...","name":"..."},"conversation":{"conversationType":"personal","id":"..."},"recipient":{"id":"...","name":"...","aadObjectId":"..."},"replyToId":"...","text":"Hello"}'
After I upgraded to MS Teams paid service, then this issue was solved. This was only issue when I use MS Teams free service.
Related
I'm not sure if I am understanding the way how to use webhooks quite right, but:
I want to send messages in different channels or to different users (not at once), without being involved in that conversation.
My problem: I can only create webhooks for specific users, so I end up having a unique URL for every user / channel?
If I use something like the "channel" parameter or even the "setReceipent" method from the library I use, it doensn't have any effect and only the channel / user the webhook was created for, receives the message.
Do I need to use API access or can I accomplish my needs using webhooks?
In general incoming webhooks are fixed to the configured channel. So if you want to send messages to users and/or multiple channels you need to create multiple webhooks or send messages though the API (e.g. chat.PostMessage).
However, there is a another way to create webhooks, that allows you to send messages to every channel with the same webhook by adding a channel override property ('channel') to your message. Its how incoming webhooks used to work in the past and part of legacy custom integrations.
To create such a webhook you need to install an app called "Incoming webhooks" from the Slack App Directory (app is made by the Slack team).
Syntax:
POST https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
Content-type: application/json
{
"text": "Hello, world.",
"channel": "U12345678"
}
Where U12345678 is the Slack ID of the user you want to send a direct message to.
Note that the channel property is optional and the message will be send to the default channel if omitted.
See here fore the full documentation.
Hooks only allow you to send to the channel defined in the hook.
If you want to send to any channel you need to create a bot user who can post to any channel. To create a bot user you need to do the following:
Add an API app Once done create a bot user (or create and delete a webhook )
Create a bot user or create and delete a webhook (which will create the bot user for you)
Add chat:write and possibly chat:write.public to the OAuth & Permissions of the API App.
Grab the Bot User OAuth Access Token it should start xoxb
Post to https://slack.com/api/chat.postMessage
eg
curl -X POST \
-H 'Authorization: Bearer xoxb-###-###-***' \
-H 'Content-type: application/json' \
--data '{"channel": "#general","text":"Hello, World!"}' \
https://slack.com/api/chat.postMessage
https://api.slack.com/messaging/sending#publishing provides some details
I'm running a bot with Microsoft Teams and have it setup in Azure. It's a demo bot from the bot builder code Microsoft released. I'm pointing it to a local server that has ngrok running. This works fine when I test via Web Chat in Azure but it doesn't work at all when working with Teams.
The app sideloads properly and the manifest is accepted by teams. No response appears to be making it to the server. When I click to show the Bot Channels in Azure some kind of OPTIONS query is being sent to the server and the demo bot throws a 405 error.
The bot id is f22039b8-5400-4569-a0f2-5bdceb8431f2 but I can't talk to it in 1:1 chat either when I specify this ID.
There are no logs in Azure or teams- I don't see any errors, so I have no idea how to start debugging this.
This is a link to someone with the exact same question:
Bot not answering messages in microsoft teams
There is currently a bug in our bot registration code that is causing this. We are currently investigating its root cause.
As a workaround, add the Skype channel and the MS Teams channel to the bot.
I have followed the instructions for setting up Square Connect web hooks.
I entered my Notification URL in the developer portal and enabled web hooks. I then sent a test notification. I verified that is working correctly.
I subscribed to "INVENTORY_UPDATED" with the Update Webhooks endpoint.
I verified that worked by calling /v1/{{location_id}}/webhooks. The response is
["INVENTORY_UPDATED"]
So I know that my location is properly subscribed to INVENTORY_UPDATED notifications.
But when I sign into the dashboard and create new items or update the inventory
count on those items, I don't receive any notifications.
I'm stumped.
Do inventory updates in the dashboard trigger INVENTORY_UPDATED webhook events? If so, did I miss a step?
Any suggestions of how to troubleshoot this?
You need to subscribe to the webhook notification by:
open your terminal or cmd (on your PC).
Run (curl -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d "[\"INVENTORY_UPDATED\"]" https://connect.squareup.com/v1/YOUR_LOCATION_ID/webhooks)
NOTE: Your Access token and Location are found on the dashboard of your square account.
I am trying to build a BOT like service for "Skype For Business".
As of now Microsoft BOT Framework doesn't have out of the box channel for this.
Searching in the internet, I found following nice workaround to tackel such problem Using Lync Server 2013 SDK.
http://devopssnippets.blogspot.jp/2016/08/integrating-lyncskype-for-business-with.html#.WIW3PXKtTjE
But in my case, I have "Skype For Business Online" in Office365 where Lync Server 2013 SDK is not supported.
UCWA web API seems to be available for "Skype For Business Online".
Using this API, I want to receive IM and forward this to my existing BOT by using DirectLine API.
And finally I want to reply the skype user with the response from the DirectLine API.
So, here what I am curious to know that whether it is possible to receive message from user and send message to user by using UCWA.
Yes, it is possible to send and receive messages using UCWA API if you are using Skype For Business. You can implement the UCWA API and then whenever you receive any message, you can forward them to the bot. And after you receive a message back from your bot, you can forward that to the user.
Here are some links that might be of help.
Setting up Skype for Business Online using Skype WebSDK
Skype For Business Step By Step
Official UCWA site with examples and steps
Skype and Skype for Business are 2 completely different things. You won't be able to connect Skype and Skype Bots (Microsoft Bots) with UCWA or Skype for Business Online
I'm able to get conversation details for webchat using https://webchat.botframework.com/api/conversations/[conversationId]/messages
Service URL for skype channel is https://skype.botframework.com, but I dont find any documentation for getting conversation details
You can use the DirectLine Rest API (see docs).
The Direct Line API is a simple REST API for connecting directly to a single bot. This API is intended for developers writing their own client applications, web chat controls, mobile apps, or service-to-service applications that will talk to their bot.
Within the Direct Line API, you will find:
An authentication mechanism using standard secret/token patterns
The ability to send messages from your client to your bot via an HTTP POST message
The ability to receive messages by polling HTTP GET
A stable schema, even if your bot changes its protocol version
You need to enable the DirectLine channel for your bot on (see screenshot)
You don't have to access each specific channel endpoint separately, you can do it all (with some limitations) through the DirectLine API.
Start a New Conversation
POST /api/conversations
Get Messages in a Conversation
GET /api/conversations/{conversationId}/messages
Send a Message
POST /api/conversations/{conversationId}/messages
The full details are in the docs as linked above.
Hope this helps
Can you be more specific about conversation details and what you're looking for?
Generally, you shouldn't assume those URL's are static BTW; an incoming message from the Bot Framework will have a ServiceURL that should be used for the life of that conversation. Some services may have multiple ServiceUrl's that they give out for different users.