How to send user identification when a user interacts with an adaptive card in a Teams Message - microsoft-graph-api

We are using the graph API to send a message to the General channel of a Microsoft Team, which has a number of members.
We would like to allow any members to interact with the message via an adaptive card.
This is doable using say Action.OpenUrl or .Submit, however we need to know which user it is which is interacting. I imagine this must be a fairly common thing to do.
What solutions and options are available to do this?
For example, is it possible to obtain the user's Team id at the time an action is invoked ?

Every activity sent to the bot has a from property that identifies the user that sent the activity. You can see the full activity schema here. I advise you to run your bot in debug mode so that you can see all the data your bot receives. If you want to run your bot in debug mode and talk to the bot using Teams instead of Emulator, you can use tunneling: https://learn.microsoft.com/azure/bot-service/bot-service-debug-channel-ngrok

Related

Sending multilanguage notifications to MS Teams user from a LogicApp

I have a LogicApp that, in some cases, can decide to send a notification to a user via Teams (provided that the target user has installed the associated Teams App).
I was successful in doing so by using the approach presented here.
However, I got stucked when it comes to localize the message.
My first idea was to retrieve somehow the user language settings, but it seems that this info is not available through the Graph API.
Any other idea on how to implement this feature?

Firebase Cloud Messaging - Send message to all users

I'm new using the Firebase Cloud Message. I built an IOS app to receive push notifications. The app works fine. I send messages from the Firebase console and they're displayed correctly.
Now I`m trying to build an web api to allow my customer to send the push messages (without accessing the firebase console). Studying the documentation here I realized that I've always to have a "to", meaning a group, topic or device id.
My question is: can I send a message to all devices (like I can do in the console)? I yes, how so?
Thanks in advance!
You can make use of topics. Given that all of your users are subscribed to a specific one. Just like what I mentioned here (removed some parts, just check them out if you want):
If you are looking for a payload parameter to specify that you intend the message for all your users, unfortunately, it doesn't exist.
Commonly, when sending notifications to multiple users, you can make use of the registration_ids parameter instead of to. However, it only has a maximum of 1000 registration tokens allowed. If you intend to use this, you can make batch requests of 1000 registration tokens each, iterating over all the registration tokens you've stored in your app server.
However, do keep in mind that Diagnostics for messages sent to Topics are not supported.
I found this:
!('TopicA' in topics)
With this expression, any app instances that are not subscribed to
TopicA, including app instances that are not subscribed to any topic,
receive the message.
So you could probably use
condition="!('nonExistingTopic' in topics)"

Get Chat History From Zopim iOS Chat SDK

How do i get chat history for Zoipm chat iOS SDKs, i am logging using anonymous user using default controller, is there any pre-config to be set to get this.
From an end-user's perspective, there is no way of seeing a chat history. Each chat is treated more like a ticket as it creates a ticket with the transcript upon completion. A chat transcript can be sent to the end-user.
I suppose the end-user could look through their ticket history and effectively see the chats alongside their other submitted tickets.

Questions about the notifications API

We have a need to fetch notifications for a particular user. By notifications, I mean the "Alert" items that appear in the D2L minibar (Message alerts, Update alerts, Subscription alerts).
We want to integrate some of these items into our CMS' menu.
I see that D2L offers a Notifications API:
http://docs.valence.desire2learn.com/res/user.html#id1
Question 1: Is the notifications API flexible enough to grab the items described above for a user?
Question 2:
To experiment with the notifications API, I tried using the following API call:
http://docs.valence.desire2learn.com/res/user.html#get--d2l-api-lp-%28D2LVERSION-version%29-notifications-instant-carriers-
And a 403 error was encountered.
The documentation states:
These routes depend upon the back-end service having the Notifications tool active. If the service does not have the Notifications tool active, then all calls to these routes will result in authorization (403) error results.
Where is the option in the backend to toggle this setting? Is this setting available in DOME somewhere?
Question 3: For the Alert items, is there a static link to view these items on D2L?
For example, I am able to access the:
Pager - at
example.desire2learn.com/d2l/lms/pager/messageList.d2l?ou=ORGID
Email - at example.desire2learn.com/d2l/lms/email/frame.d2l?ou=ORGID
But, there doesn't appear to be a way to access the "Update Alerts" and "Subscription Alerts" items from a static link. They only appear via AJAX when you click on these icons in the minibar. If I am overlooking where these links are, please let me know.
The answer will be long-ish, and probably isn't what you want to hear. First off, there is a strong distinction between "alerts" (the items that show up in the minibar) and "notifications". The Notifications API is simply exposing the "Instant Notifications preference" table that you can see when you open your user's Notifications settings page (the page at url: http://yourLMS.edu/d2l/Notifications/Settings).
The types of messages that can be sent as a "notification" are the rows in the Instant Notifications table; the "carriers", or endpoints, for them are the columns of checkboxes. The Notifications API exposes this table, letting you retrieve it's current state, and change the setting for a checkbox at the vertex of a notification messageTypeId and a carrierId.
So, to answer your specific questions:
Question 1. No, the Notifications API does not currently provide any access to the alerts that appear in the minibar control in the LMS' web UI.
Question 2. Your 403 may indicate that your calling user context does not have the permission required to use the Notifications tool: the calling user must have a role that grants them the ability to Receive Instant Notifications -- without that, the API call to retrieve the carriers list results in a 403.
If your org has had the Notifications tool turned off entirely, then it's likely no user will be able to see their Notifications setting page through the Web UI, and to turn it back on may require your organization to call D2L's support desk to have it turned back on: I'm not sure that client organization admins have the ability to select what tools are on and which are off without intervention from the support desk.
Question 3. I do not believe there is a static page for the Update and Subscription alert lists.

How to Add Phone With twitter using Third Party tool

I need a script that will add my phone with Twitter for All latest notification.
I found this page Twitter but i need to create script for my own application.
I goggled but i didn't get any solution For this.Please Help me to find this answer.
Thanks a lot in advance.
First Edit
This is a twitter's new feature Send notification to Phone. Actually I want to create an app that will allow users to register there phone with twitter via my application. Ie I need a script to implement send notification to phone.
The question that others are asking you Pankaj is what platform is your application being written for. You keep saying you want a "script" to do this, but what kind of script?
Giving us more insight to what your application is (a console application written in C#, or an ASP.NET web application) would lend more detail and raise the chances of someone being able to help you. :)
Regardless of your app's platform though, you're probably going to need to look into the Twitter API for setting this up. This is the normal method to interact with Twitter from 3rd party applications. So all the suggestions above, specifically the list of API's available, is probably what you're looking for.
Hey, can you give some more information? What kind of Phone are you developing for?
Maybe that helps solving your Problem.
If you are just searching for a way connecting your Phone to Twitter, here is the Twitter FAQ for Phone connecting:
http://support.twitter.com/articles/14014-twitter-phone-faqs
Maybe it helps, or give you more keywords for your search.
I don't believe there's a way to get or set the notification phone number using the API, however if a phone is already setup on the profile you want to configure, you can do the following to get notification from all user friends.
The user will need to authorize your application to access her account. This flow uses OAuth, and begins here:
http://api.twitter.com/oauth/request_token
Once the user has granted your app access, and your application has all the required OAuth credentials, turn on notifications using account/update_delivery_device:
http://api.twitter.com/1/account/update_delivery_device.json?device=sms
Next, fetch all the IDs for your user's friends using the friends/ids API call. Be sure to study the documentation; this call uses cursors, so you will have to manage those if the user has over 5,000 friends. Store these IDs for use in the next step. Here's an example call:
http://api.twitter.com/1/friends/ids.json?cursor=-1
Once you have all of the friend IDs, you can call notifications/follow repeatedly to enable notifications on your mobile device whenever your friend makes an update:
http://api.twitter.com/1/notifications/follow.xml?user_id=12345
This approach will burn one API call for each user that you enable notifications for; there's no way currently to manage notifications en masse.

Resources