How to get Microsoft Graph access token using email id in the skype for business bot to add an event to Calendar - botframework

In Skype for Business Bot , User is pre-authenticated, need to get Microsoft graph access token , in order to perform Microsoft Graph operations (such as adding events to calendar) in programmatic way..
Please suggest how Microsoft Graph Apis can be integrated with Azure Bot for Skype for business channel.
We want Skype for Business bot to book the meeting just like described here
But instead of Teams need to use Skype for Business. but basically this code line will ask user to explicitly in this code sample
"await context.Forward(new AzureAuthDialog("
There is another sample that need Adminconsent to update the calendar of specific user
Swati

You cannot reuse anything from the pre-authentication. Like any other channel, you have to go through a specific authentication phase.
You have a great sample on the official repository to do this, here: https://github.com/Microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/24.bot-authentication-msgraph

Related

Calling an external API from MS Teams chat

Can anyone offer guidance on how to call an external API from within MS Teams chat/posts initiated by an #mention or #hastag? The service I want to build would use the mention/hastag to call an API and return various types of meta data that would then be added to the chat, post, etc. Wondering if Flow or Yo Teams is the best way to go.
The best approach for this would be to create a bot, which gets a name that can be '#' mentioned (e.g. if you bot is called MyBot, you could mention #MyBot in a Teams channel, and it will get notified). Once it receives the notification, the bot can do anything you need it to do.
If you have development skills available (yourself or someone on your team), have a look at the Teams Bot development documentation to get started. If not, Power Virtual Agents could suit your needs (it's like a "drag and drop" bot creator.

Bot Framework - add member to Teams group chat

I have a group chat on Microsoft Teams with 4 members: 3 people and a bot. Is it possible for the bot to add a new member to the existing group chat?
I found the method deleteConversationMember of the class BotFrameworkAdapter, which should remove an existing member. Well, I would need the opposite, adding a new member.
I have also checked Microsoft Teams Graph API, but it seems to be possible only to get members and not add a new one.
As I see from your comment, you're trying to have the bot escalate, or "hand off" to a service desk agent. If that's correct, you can have a look at another model for this altogether, where the user continues to chat with the bot, but the messages are being sent, by the bot, to an agent behind the scenes. This is referred to as a "handoff", and you can see a blog post here and source code (from the blog author) here on github
The BotFrameworkAdapter methods use the Bot Framework REST API, which itself calls channel-specific API's. As you've seen in the Teams Graph API, adding a member to a group chat is not currently supported and even if it was that Graph API is in preview and not suited for production applications. This document explains how to give feedback if you want to request this feature.
As a workaround, I recommend having the bot give the existing group members some instruction on adding the new member to the group themselves.
If you'd like to go with a bot-to-human handoff solution like Hilton suggested, you might be interested in this new sample: https://github.com/arturl/lpproxybot

LUIS deployed through SharePoint - How to get user data?

We have deployed LUIS V4 in our Azure Platform, and made it available to our employee through SharePoint. It is currently open and does not need log in to be used.
We would like to capture information about who the person interacting with the bot is; is there any way that information related to the user can be retrieved? (employees to use the bot must be authenticated to Azure as it is within a SharePoint, but the bot doesn't require authentication as mentioned)
Thank you!
If you are just using LUIS, then no, it does not do any user specific tasks. It only translates an utterance (phrase) into specific actions (intents and entities), also does not store any state.
So all authorisations and user customisations need to be done outside of LUIS, with plain code. If you are using Azure/Microsoft Bot, you can hook up a channel to LUIS and use the id to identify user (skype id, phone number, microsoft teams id...)
A bit of info for connecting Azure Bot with SharePoint.

Can we develop a functional or process bot using azure service

I'm looking for a solution where my bot can understand users request(may be with LUIS this can be achieved) and verifies/validates the user/requirement with master data. If all good, then connect to my native database(Siebel CRM via API) to perform the defined action and log a reference ticket(via API) and finally send an email to user using outlook. Is this achievable using azure service?
Yes, the Bot Framework can do all of those things:
my bot can understand users request
LUIS is perfect for this.
verifies/validates the user/requirement with master data
All of this can be done within Waterfall dialogs or Prompts. You can either store the master data in the bot code, or query it from an external source and have the bot validate against it.
Here's a good sample for prompts and validation.
connect to my native database(Siebel CRM via API) to perform the defined action and log a reference ticket(via API)
The bot runs on C#/Node, so anything (including calling your APIs) that you can do in C#/Node, you can do in your bot.
send an email to user using outlook
Bot Framework has a specific Email Channel for this or you can use the Graph API.
Recommended Resources
Docs and QuickStarts
Samples Repo
Reference Docs: C# / TypeScript
LUIS Docs

Does a Bot Framework bot need to be registered every time it changes, or only once?

I have created Bot 'MyFirstBOT' where my backend is QnA maker application data. I have given a name to this bot called 'TestJPBOT' and I have enabled the Teams channel for this bot so that we can use this bot on Teams applications. Right now in our organization we are working to register this bot with Microsoft so that we can start using it. I would like to know going forward if I want to make any changes in the bot, like changing its name, profile picture, or something similar, do I need to reregister it every time with Microsoft? Or is there no need?
Per my simple testing using Azure Bot Service env, we don't need register again after change our bots.
Actually, register your bot is populate your bot on Microsoft, equivalent to create a index for your bot I think. You change your bot's profile or code, should not effect the index.

Resources