Send Activity Notification in MS Teams for the personal application - microsoft-graph-api

I have created one personal app which is added as in the Microsoft teams. Now I have a requirement to Send Activity Notification in Activity Feed for the users who match certain criteria.
My question is related to the Send Notification Graph API.
When I try to add the activities in my manifest.json file it is not displayed in the App studio. That section disappeared.
When I try to run the Graph API command it fails.
Can someone guide me with step by step implementation for the custom app?
Error I get when try in Graph Explorer
The value of the topic must match the graph resource path.

You can use the activity feed notification APIs in Microsoft Graph to extend this functionality to your apps.
Requirements for using the activity feed notification APIs:
The Teams app manifest must have the Azure AD app ID added to the
webApplicationInfo section.(Teams app manifest version must be 1.7 or greater)
Activity types must be declared in the activities section in manifest schema.
The Teams app must be installed for the recipient, either
personally, or in a team or chat they are part of.
For detailed steps ,please follow below doc:
https://learn.microsoft.com/en-us/graph/teams-send-activityfeednotifications#understanding-the-basics-of-activity-feed-notification

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?

Is there an event payload when adding ms teams app to org?

If I upload a custom app that has a messaging bot to an MS Teams org (through admin center), is there an event payload that gets sent to the bot messaging payload that lets me know that the app/bot is added to that MS Teams tenant?
Something similar to installationUpdate event: https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/subscribe-to-conversation-events?tabs=dotnet#installation-update-event but for adding app to org (this payload event is sent for when users add app to their own MS Teams space)
No, there is no event for this.
Having it installed in a tenant doesn’t do anything except making it available for users to install. And without a user installing it, you cannot interact with the bot.
There are only two ways the app could be added to the org: either (a) by them adding the package manually, in which case presumably you gave it to them, so you should know about it, or (b) by your app being in the public App Store. In this 2nd case, you'll know it's been installed into the tenant by using the same installationUpdate event you mentioned - you can store an entry somewhere on your infrastructure (e.g. a database or otherwise) that tracks which tenants have installed the bot ever before in any channel, and if nothing is found for the incoming tenant id, it must be new.

createChannel in GraphAPI sometimes results in not creating the corresponding Sharepoint/OneDrive folder

Currently the creation of a channel through the Graph API frequently results in the relative, corresponding Sharepoint folder not being created.
When using the Graph API to create a channel the response indicates creating the channel was a success, but when going to the files tab it shows:
"Your files can’t be found, working on it to restore them."
After having clicked on the files tab in the Teams UI, the folder is created eventually (after a couple of minutes).
But because automated processes depend on the channel folder, we don’t want to ask the user to manually open the team before the other processes can continue.
So: Team created: Ok -> Channel created: Ok-ish (But missing the linked folder) -> One-drive/share point folder, with the name of the channel: Not created
Sometimes the folder is created properly, but lately more often it is not created (Not even after 3-4 days of waiting) until the user opens the files tab in the Teams client.
This behaviour is new since it worked flawlessly until a week ago. Is there a known workaround for this?
We're following the default documentation for creating a channel via Graph API as described in the Microsoft Graph Reference
Best regards,
Dominic
This is by design or rather limitation of SPO provisioning is async as in create team succeeds without waiting for SPO site provisioning completes. In those scenarios when channel get provisioned before SPO that get created without files folder. The recovery mechanism is accessing files tab in the channel.
Currently there isn't any solution to check if provisioning is completed. However, there is a feature ask to provide an API to provision similar to what happens on the client (clicking on Files tab). We do not have any ETA on this.

Audit logs retrieval in slack

I need to check audit logs for activities done between a timeperiod on my slack account. I couldn't find any API/methods which can help me with audit logs retrieval. I need to see what all users have been added, removed or invited between a given timeframe. Any help on how this can be done?
There are of course methods to download login (team.accessLogs) and integration activity (team.integrationLogs), but they only provide a part of the functionality you asked for and the first is only available on paid tier.
However you could develop a small custom app for logging all required activity using the new Event API. With the Event API your app can subscribe to any event type you like to log. Whenever an event of that type occures Slack will send a request to your app, with detailed context information. Your app can then store this info in a file for later retrieval and analysis.
e.g. users added: https://api.slack.com/events/team_join

Office 365 SharePoint list notify on new item

I am looking at creating a business app for our company that will simplify specific tasks. These correspond to items in Lists in SharePoint hosted in Office 365.
It is basic enough to use the Office 365 iOS SDK to get list items, but we would like to add push notifications for new items in specific lists (e.g. announcements). My only solution so far is an Azure Mobile Service which polls the list and then can use push notifications from here to notify the device of the update.
Is there a way to notify a remote app/service when a new item is created in the SharePoint List? i.e. maybe a web hook type service that could POST to our web service (maybe azure notification hubs or azure mobile services) on creation or something directly from SharePoint that can send push notifications to a custom iOS app.
This is for Office 365 so you need a Remote Event Receiver for when the item is added to the list. The link below shows how to create one. You can have this event run your code to create the push notification in the Azure Notification Hub.
http://msdn.microsoft.com/EN-US/library/office/jj220043(v=office.15).aspx
You may also want to take a look at the updated PnP guidance on Remote Event Receivers
https://github.com/OfficeDev/PnP/tree/master/Samples/Core.EventReceivers
Updated:
If you follow the tutorial (thanks #efimovandr) to wire up your iOS application to use the Azure notification hub, your Remote Event Receiver only needs to contain the code in the Send Notification from BackEnd step, which writes an item to the Service Bus Notifications when the ItemAdded event fires on your list.
I am not good in SharePoint but looking at this or this article I can see that it is possible to write a handler which is called on SharePoint side when new item appears in a list. In that handler you could send a push notification using Azure Notification Hub. Just look at tutorial.

Resources