1-to-1 Proactive messaging using Bot Framework 4 - c#

I am using C# (.NET Core) with Bot Framework v4 to develop a bot service. I am a beginner to Bot Framework.
The problem statement goes as follows :
I want to be able to Store some questions on o365 SharePoint
subscription in a list. The data structure of the list will have a
column containing users who are the intended audience for the
question.
When a question is added to the list, I want my bot to send out the
questions to intended users on Microsoft Teams.
Even if the user is not online to teams, I would want to send out a
notification to the user on Teams chat, something like "Missed
conversation".
Now, I understand, on a very beginner level, that the key here is Proactive messaging using the Bot. What I can't figure out or find on any forum articles is that how do I write my bot to go to SharePoint (could be using polling or event driven) and fetch information and then send out the fetched data to Users on personal 1-to-1 team chat?
What I have done so far is :
I have written my SharePoint business logic to fetch information.
The bot calls this business logic when it receives an activity from
User. i.e. say, a user says "Hi" and the bot goes and fetches
information from SharePoint and returns it to the user in the chat
window.
Any help would be greatly appreciated.
Cheers,
Yogesh

My guess is that you should be able to accomplish the goals, but make sure to break this up into smaller problems when looking for assistance. You might need some other layers between the two to accomplish as well.
As you have found, proactive messages will be what you want to use from the bot side to message users without them engaging the bot first. You won't find any success (especially in Teams) if the users have never interacted with the bot before as there will need to be some sort of way for the bot to be able to know how to contact them (former conversation, etc). Please find more information here and here.
What I can't figure out or find on any forum articles is that how do I
write my bot to go to SharePoint (could be using polling or event
driven) and fetch information and then send out the fetched data to
Users on personal 1-to-1 team chat?
I have written my SharePoint business logic to fetch information. The
bot calls this business logic when it receives an activity from User.
i.e. say, a user says "Hi" and the bot goes and fetches information
from SharePoint and returns it to the user in the chat window.
So; it seems like the part you are missing is an intermediate layer that does polling or such. The proactive sample, is just using turn events to then 'proactively' message the user back. You might have to get creative. Have some sort of other service/timerjob/serverless function that might be able to assist.
This is an article for v3, but the general idea about proactive messages is good and helps understand how to best approach proactive message paradigm and ensure a good user experience:
https://learn.microsoft.com/en-us/azure/bot-service/dotnet/bot-builder-dotnet-proactive-messages?view=azure-bot-service-3.0#send-a-dialog-based-proactive-message

I was able to achieve the above mentioned tasks. For starters I was thinking too much and the solution was simple.
I wrote an infinite loop with asynchronous call to SharePoint at regular intervals using simple Task.Delay(milliseconds) and push the questions proactively when found.
As for 1-to-1 messaging, I am using Teams extension for Bot Framework to store individual channel information and send messages on private chat to users as and when there is something to send based on polling functionality above.
Hope that clears the air for someone, who might be looking to achieve anything similar.
Cheers,
Y

Related

Skype for Business Call Log

I am currently seeking for a REST API for Skype for Business/Lync that will allow out team access information on various calls for our company made throughout the day(since they talk to customers), such as call duration, from, to, etc. that we can display in a repeater in our web page.
We would like to store this information if possible. I have found that perhaps Unified Communications Web API(UCWA) might be the best route to take, but have found nothing relating to a call history/log.
Would this be the correct first step in trying to achieve my goal using a REST API to access our company's Skype for Business/Lync call information?
Thank you.
There is currently no way to get this information through the UCWA API. (or any other Skype API atm)
One option is to use the Call detail recording (CDR) database instead.
The other option is to use the Skype for Business SDN SDK but it wouldbe way more involved. I would assume the CDR would be easier for you to use as it's just database access.

Require Paypal Subscription to Create an Account - ASP.Net / MVC4 / C# / Razor

I am new to Entity Framework, MVC and Razor but am almost finished with my first project using it.
The final piece of the puzzle is to tweak the "canned" Log-in / Registration piece that comes by default when setting up an MVC project. I need to integrate with Paypal in order to create a monthly subscription. If payment is up-to-date then their account will then allow them to access all the benefits my site has to (hopefully) offer.
I signed up with developer.paypal.com and think I have a good start as far as creating test accounts. I just need to get the code in place.
Is there any sample code that already tackles this? I read through the API doc but
Is there any best practices that relate to what I want to accomplish? For example, should someone pay first, then create an account or vice versa? Should I have to implement managing their subscription cancellation or do they have to do it within their account? etc...
How can I tell if a user is current with their subscription and they didn't cancel.
How can I tie a user to their Paypal transaction?
Any help would be much appreciated. Thanks in advance!
PayPal has Standard Subscriptions and then they have the Recurring Payments API, or what can sometimes be seen as Recurring Billing. I would definitely recommend going with the API's as it will give you much more freedom to do everything you're wanting.
If you're talking about PayPal payments (where people sign in to pay) I'd go with Express Checkout, which consists if SetExpressCheckout, GetExpressCheckoutDetails, and then DoExpressCheckoutPayment and/or CreateRecurringPaymentsProfile depending on what you're doing. In your case it sounds like you'll be doing CRPP because you're working with subscriptions.
That will return a profile ID which you can save locally in your user table(s). Then, when people login you can make a call to GetRecurringPaymentsProfileDetails to lookup the current status of the profile, and then redirect the user to different places depending on the status.
PayPal's .NET SDK should make all of those calls easy on you, but it's really just a matter of building NVP requests and sending them to PayPal via HTTP POST.
If you want to do all of that with credit cards directly then the process is the same, but there are different API calls involved, and depending on the version of PayPal account you have the calls would be different.
If you're using Website Payments Pro 3.0 then you would use the DoDirectPayment platform, which in the case of recurring payments you would just make a single call to CreateRecurringPaymentsProfile and include the credit card details in that request.
If you're on Payments Pro 2.0 that would use the PayFlow API, and that's where it's called Recurring Billing, so you'd just have to setup a PayFlow request accordingly.

Create a newsfeed page with real time data from users using ASP.NET

I want to make a small web app using ASP .NET for intranet usage where users can send messages to either everyone or personal messages to a selected user from a drop down list.
The functions:
Send a broadcast message to everyone.
Send a personal message to a selective user.
Receive messages in real time.
Show who is online and their status.
Hear alert sound for new messages.
Is this all possible with ASP.NET? I thought I can easily make it with silver light but I don't have experience on that field.
Totally possible. Take a look at Jabbr http://about.jabbr.net/. Made using ASP.NET and SignalR.

How to get Messenger contact list through .NET

I want to be able to get the list of Messenger contacts of a certain user through .NET.
I've seen Messenger Connect, but it's still under beta and with limited access.
Any ideas for easier alternatives? I thought it would be as easy as invoking a WCF service.
Thank you for your help.
One option is the Windows Live User Data APIs, which contains the Windows Live Contacts API. See the documentation on retrieving contacts.
Keep in mind that the API is considered deprecated, and will eventually be replaced by Messenger Connect. See this post for more information on a possible timeframe for the service being discontinued.
Try Jbuddy from Zion Software, multiprotocol support.

Login to online accounts

First time poster. Back to programming after being away for a few years, trying to clean off the rust. I'm creating a dashboard that will run initially on my laptop (Macbook Pro, 10.4.x O/S). Amongst other things I want it to retrieve latest information from my online accounts. I'm starting with html, but will probably migrate to something else (TBD, possibly ruby or c#). What would sample code look like for logging into account, going through specific account workflow, retrieve data/docs/other, and pull it back to be stored locally.
It is a little open-ended, apologies and thanks in advance.
Are you looking for something like Google Gears?
It depends on the kind of accounts you want to log onto.
For instance there is a Google has an specific API for that Google Accounts API, other services provide similar API's some other do not.
So it depends pretty much what are your "online accounts" all about and if they do provide a public API or not.
EDIT
As per your comment and for the products you've mentioned, I'll suggest your to start looking at browsers plugin development and to start understanding the HTTP protocol and all the related technologies around it ( HTTPS, encryption, authentication etc. )
The public API let you easily login into an account, but you don't really need one to do it ( although it make life much more simpler ) If you do not have a public API, you can still login into any account by "simply" doing what the browser does. Sending an HTTP(s) request with the appropriate security mechanism and following the protocol.
If you know how does the browser send the request and you have the user trusting your their passwords, the only remaining thing you have to do is ... :) code it.
As of now the question is too broad to be answered. Pick one service at a time and ask specific questions about it.
I would suggest you to start with the previously mentioned "Google Accounts" API and learn from there.
One open source product that already manages google account authentication is "Ubiquity" you can take a peak at their source code and start understanding how do they fetch the user contact list.

Categories

Resources