User Profile
GuillaumeStD
Copper Contributor
Joined Sep 28, 2022
User Widgets
Recent Discussions
[Error] Subscribe to messages of any chat where my bot is installed
Hi, I am trying to subscribe to messages events of any chat where my bot is installed using this endpoint : https://learn.microsoft.com/en-us/graph/teams-changenotifications-chatmessage#subscribe-to-messages-of-any-chat-in-a-tenant-where-a-specific-teams-app-is-installed-preview Unfortunately, when calling this endpoint I get this error : { "error": { "code": "ExtensionError", "message": "Operation: Create; Exception: [Status Code: Forbidden; Reason: AAD App Id 'XXX' is not allowed to manage the Teams App 'YYY'.]", "innerError": { "date": "2022-10-27T10:25:13", "request-id": "c2d30aa0-eade-4324-9df7-71696d2a5bbc", "client-request-id": "c2d30aa0-eade-4324-9df7-71696d2a5bbc" } } } Note that for security reasons I have masked my AppId and TeamsAppId from the above error. I have checked them and they are correct. I have tried granting my token the following permissions (TeamsAppInstallation.ReadWriteForChat.All, TeamsAppInstallation.ReadWriteForTeam.All, TeamsAppInstallation.ReadWriteForUser.All), but I still get the same error. Any help would be appreciated.2KViews1like11CommentsRe: MessageId undefined when creating a message
Hi Meghana-MSFT , thanks for your response. Meghana-MSFT wrote: - I used this sample to send attachment to a bot - https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore/56.teams-file-upload. - I used bot not connector API. - I use nodeJS, so I have tried with this sample, but it has the same issue. The context. sendActivity() method doesn't return the created activity ID when the created activity contains attachments : https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/javascript_nodejs/56.teams-file-upload - For your information, bot sdk uses the Connector API under the hood, so by using the bot sdk, we are using the Connector API. Meghana-MSFT wrote: Could you please clarify what your bot and Graph API do not support, your exact requirement? Thank you. => Graph API doesn't support sending message as a bot as stated in its docs here (only delegated permissions work, not application permissions) : https://learn.microsoft.com/en-us/graph/api/chat-post-messages?view=graph-rest-1.0&tabs=http#permissions2.5KViews0likes5CommentsRe: MessageId undefined when creating a message
Meghana-MSFT Thanks for the response. Unfortunately I can't use Graph API because I need to send messages as my bot and Graph API doesn't support that as stated in https://learn.microsoft.com/en-us/graph/api/chat-post-messages?view=graph-rest-1.0&tabs=http. I have 2 questions : - Can you send the detailed request that resulted in this bot response ? - You tried sending the message "through a bot", is it via a bot SDK https://www.npmjs.com/package/botbuilder or the Connector API directly ?2.6KViews0likes7CommentsMessageId undefined when creating a message
Hi, I just found a weird behavior that I believe to be a bug. When https://learn.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-api-reference?view=azure-bot-service-4.0#send-to-conversation, I can create a message with this kind of Axios config : { method: "POST", headers: { Authorization: botBearerToken }, url: `${connectorApiBaseURI}/v3/conversations/${conversationId}/activities`, data: { type: "message", text: "random text message", inputHint: "acceptingInput", }, } I can retrieve the activity/message id I just created in the response body. But if I add some attachments to the message, the message with its attachments is properly created in Teams but the id in the response body is undefined. This is a plague for my app, as the message Id is mandatory to update the message afterwards when necessary. Here is the Axios config in this case : { method: "POST", headers: { Authorization: botBearerToken }, url: `${connectorApiBaseURI}/v3/conversations/${conversationId}/activities`, data: { type: "message", text: "random text message", inputHint: "acceptingInput", attachmentLayout: "list", attachments: [...], }, } My request is to have the message/activity Id in the response body reliably when the message/activity creation succeeds.3.3KViews0likes11Comments
Recent Blog Articles
No content to show