Sending multilanguage notifications to MS Teams user from a LogicApp - microsoft-graph-api

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?

Related

How to send user identification when a user interacts with an adaptive card in a Teams Message

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

Will multiple push notifications opt-ins be an issue with iOS?

Quick question, if I develop an app and create a dedicated "alerts screen" and on that screen will be a list of 200 teams, next to each team will be "news" and "transfers".
So the user has the option to opt in to push notifications for only the teams they choose but also narrow down to just news or transfers for example.
Will this be an issue with iOS? I know Parse and others allow "segmentation and channelling" but I am not sure if this is the best way as my app has no user login/registration, I will be doing it via device token.
It won't be an issue with iOS, as long as you plan to support this functionality in your server - once the user chooses the types of notifications they prefer to see, you'll send these types along with the device token to your server and store them in your DB. Your server will send push notifications to each device token based on those preferences.
That being said, a UI screen with 200 options to choose from doesn't seem very user friendly. You should think how to make it less painful for the user to make those choices.

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.

Send Facebook notification to user who registered on my site via facebook connect

Let me start by saying facebook's developer documentation sucks. Bad.
I'm using the facebooker plugin in rails to let users sign up through facebook connect. Now when certain things occur I want to send notifications to certain users through facebook. I heard some say that notifications must go from one user to another, but I've seen evidence otherwise. I signed up at the site http://www.meetingwave.com/ through fb connect, and now they send me (annoyingly) daily notifications of new things on their site. Also, using the comments widget on my own site www.tmatthew.net, when an anonymous user leaves a comment I get notified of that as well.
So uh, how do you do that? I've been googling all week long and can't seem to find anything. It seems like I should be able to send a notification from my app to one of it's users.
The api call you are looking for is called Notifications.send. The only thing is that they will be disabling it very soon so there is probably no point in implementing it into your application.

Resources