-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Service error 'Unknown' when attempting to send a (non-reply) message #260
Comments
Pretty please halp? Sending an activity is failing.. seems like an integral part of the service as a whole which isn't replaced in any way by the Graph API :(. Is this not a critical failure? Am i doing something very wrong? Because I've gone over this documentation over and over and not only is it impossible to know which APIs to use anymore, but it's not working 👎 Thanks @stevkan for the labels. |
Hi @dmvtech! Sorry to be a noob about Azure but I'm not sure how to get to that page. Is it around here somewhere: I don't see Teams in the blade options: |
So, when you create a bot resource (either a Bot Channels Registration or a Web App Bot), it will create a App Registration (an AAD app), but it is itself also another resource type ( These types of resource have a blade called Channels where you can configure the channels that are allowed/setup for this bot to use. More info: |
I don't have any errors logging in the My Bots webpage: And I retried a few more calls and it's the same issue - I get the conversation id successfully but I get the service error upon sending an activity. I am going to go through a full flow of the following tasks:
Here we go: Here is a sample incoming request: Now that you know these values are valid, I am going to use the bot id, bot name, user id and user name to create a conversation and then send a non-reply message/activity: Now the code for sending a message/activity: And now the actual code output when I run it - conversation gets created successfully, but sending an activity fails 👍 Further information that may be useful.. here is the function that successfully creates a token (default scopes set in the app): API Permission set for this bot application (yes, I set a whole lot of them as I was playing with the graph api): After doing a bunch more of these requests, i still see no warnings on the MS Teams bot channel page. Any ideas on what I could try next? Thanks! |
Can you share a repro project, without the keys and secrets? We cannot copy/paste the screenshots. By looking at your screenshots, I'm surprised the calls are able to generate a conversation.id. I thought the Teams channel requires TenantId for this call, as is done here: https://github.com/microsoft/botbuilder-js/blob/main/libraries/botbuilder/src/botFrameworkAdapter.ts#L484 A few things to check:
Hope this helps! What you are doing is definitely possible. I think we just have not documented exactly how to accomplish this from the Teams channel specifically. |
hi @penguinsource Thanks for the info. Lots of good info/suggestions from @EricDahlvang, as usual. I can try and see if I can set up something similar, but as Eric suggested if you can share a sanitized repro, then that might expedite things a bit. |
@dmvtech @EricDahlvang thank you very much for your input - I really appreciate it! A few pressing issues have come up on my side but I'm going to go through your suggestions asap by the end of the week and post updates here! |
Hi @EricDahlvang , I updated the service url to https://smba.trafficmanager.net/amer when creating a conversation and it responds with bad format of conversation id - i added the tenant id and now creating a conversation and sending a message works (aweeeeeeeeeeeesomeeeeeeeee)!!! You can create a conversation id using https://smba.trafficmanager.net/api without a tenant id which you should not do (or should not do for the purpose of sending a message, anyhow). I really thought I switched them out before but I guess I never got both calls to use the /amer endpoint. Thank you!! The REST documentation should be updated to reference https://smba.trafficmanager.net/amer instead of https://smba.trafficmanager.net/api. It uses the /api endpoint everywhere in the 'Connector' section: Documentation: https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-authentication?view=azure-bot-service-4.0 Here is a link to a very basic sample repo with some hard-coded values for my bot and user name for reference in case others want to use it - https://github.com/penguinsource/ms-teams-bot/blob/master/index.js I will update it/clean it up a bit |
Since I have a knowledgeable audience about this product in this topic, I might as well ask - I could not find a way to do this with the Graph API, at least not with any documentation pointing to initiating a conversation with a user. Is it possible? Is this Bot Framework API going to be deprecated in favor of the Graph API? If yes, do you know if there are any plans of updating the Graph API to support this workflow? And last but not least, where do I set up the API permissions for the bot framework? I've been digging through documentation and I'm still quite lost :( My application is going to consist of a business signing up for my platform.
Do you have any tips on how to go about setting up permissions and authorizations that you could point me towards? Thank you very much again! |
Hi @penguinsource Thanks for the follow up!
I think the documentation is aimed to be more generic and mostly focused on Direct Line and not for the intricacies of using Teams. Additionally, i'm not sure if /amer is going to be a global fix, as I'm guessing it probably depends on the regional location of the resources (my assumption is /amer is Americas). @EricDahlvang any input here? Also; you can always suggest a change to the documentation from the GitHub link on the bottom of the page.
No, unfortunately not.
Not that we are aware of at this point.
I guess this depends on what permissions you are talking about exactly (there is a lot of them and a lot going on). When you create a bot there is the app registration that gets created that sets up the basics for authentication through the bot framework service and the multiple channels. Secondarily, you have to configure the channels and there are permissions for that as well.
Ah, I believe you will want to look into some of the OAuth samples we have. I think this will get you started in the right direction. |
Hi!
I am using the Bot Framework Rest API with Node. I am successfully sending reply messages upon a user sending a message (in MS Teams).
I am now trying to start a conversation, to which the response comes back successful, with a conversation id.
( POST /v3/conversations returns me an id - great!)
Then, I try to send a message to that conversation id and I keep getting Service error 'Unknown'. I have tried everything..
Get token function (works fine)
Create a conversation (works fine)
Using the conversationId above, send a message (Not working):
I am following the documentation provided:
https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-api-reference?view=azure-bot-service-4.0#create-conversation
Step 1, create a conversation:
Step 2, send message using conversation id from above:
The text was updated successfully, but these errors were encountered: