0

Is there any way to send activities that are happening in external application to ms teams activity feed through any api.Now I have designed a blog where other users can like comment and follow my post in the blog.So I want to get all the activities that are happening in my blog to ms teams.

Bansi 569
  • 1
  • 1

1 Answers1

0

The Microsoft Graph REST API uses a webhook mechanism to deliver change notifications to clients. A client is a web service that configures its own URL to receive notifications. Client apps use notifications to update their state upon changes.

subscription operations require read permission to the resource. For example, to get notifications for messages, your app needs the Mail.Read permission.

Please look at change notification API

Trinetra-MSFT
  • 957
  • 5
  • 9
  • Thanks for replying, I have gone through change notification api and what I have understood is when any change happens in o365 applications like when a new message arrives in teams then we can send a notification to an external app saying that someone has posted a message but I'm looking the other way around where some external app sends a notification to teams when some activity takes place in that external app. In simple terms I'm trying to send activity stream JSON format of an activity(eg like activity) to the teams so that at teams side I can make an english statement out of json format – Bansi 569 May 05 '20 at 11:53
  • I think that is the one way to read activity feed from external app in teams, still what you can do you can set up a [incoming webhook](https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook) to post activity in teams later you can subscribe to the webhook to read the changes in your external service, whenever any change will happen in your web service your webhook will be triggered and you can notify the same in team – Trinetra-MSFT May 05 '20 at 11:58
  • Ya I agree that adding a incoming webhook to a teams channel and posting a message to that incoming webhook would result in pushing a message from external application to a teams channel but not directly to the teams activity feed. I don't want to create any extra channel just to look for the activities that are happening in the external application rather I want those activities to directly appear in the activity feed of ms teams. Hope I'm not being too ambitious – Bansi 569 May 05 '20 at 12:19
  • Could you please tell me how to read activity feed from an external app using change notifications API – Bansi 569 May 05 '20 at 12:32
  • You can [create subscription](https://learn.microsoft.com/en-us/graph/api/subscription-post-subscriptions?view=graph-rest-1.0&tabs=http) to listener application (webhook url) to receive notifications from external app. – Trinetra-MSFT May 05 '20 at 12:42
  • But if an external app subscribes to a webhook url,how am I going to send the notifications to that webhook because I will only be notified about the events that are happening on the webhook since my app subscribed to it but I cannot sent any notifications to the webhook – Bansi 569 May 05 '20 at 12:57
  • You can POST request.(Text, Message Card) to your webhook from external service .For that you need to integrate webhook in your application. So when any change will occure webhook will notify in the Teams, later you can subscribe to teams channel and read the message – Trinetra-MSFT May 06 '20 at 07:53