几个月前,Teams 团队又推出了新的 Graph API,让 app 可以给用户发送 Activity Feed。我们来看看如何做。
首先,我们的app需要使用较新的 manifest 1.7版本,当然如果使用最新的1.8版本就更好了。在manifest json中添加 webApplicationInfo
和 activities
配置块
{
"$schema": "https://developer.microsoft.com/json-schemas/teams/v1.8/MicrosoftTeams.schema.json",
"manifestVersion": "1.8",
"version": "1.0.0",
"id": "your app id",
"packageName": "com.example.myapp",
...
"webApplicationInfo": {
"id": "AAD App ID",
"resource": "Resource URL for acquiring auth token for SSO",
"applicationPermissions": [ ... ],
},
"activities": {
"activityTypes": [
{
"type":"taskCreated",
"description":"Task Created Activity",
"templateText":"{actor} created task {taskId} f