代码之家  ›  专栏  ›  技术社区  ›  Shabbir Dhangot

MSTeams:自适应卡头空间文本

  •  0
  • Shabbir Dhangot  · 技术社区  · 2 年前

    我们正在使用调用图API从MS团队应用程序向用户发送自适应卡。发送卡片时,我们发现卡片顶部有空位。请参阅下图。

    enter image description here

    下面是我们传递给API作为有效负载的内容。 Document

    {
        attachments: [{
            id,
            contentType: 'application/vnd.microsoft.card.adaptive',
            contentUrl: null,
            content: JSON.stringify(card),
            name: null,
            thumbnailUrl: null
        }],
        body: { contentType: 'html', content }
    }
    

    我们尝试了不同的方式,在附件中给主体和主客体起名字,但并没有成功。我想知道我们如何在标题部分提供文本,或者如果不可能,我们如何完全消除它。

    0 回复  |  直到 2 年前
        1
  •  0
  •   Meghana-MSFT    2 年前

    工程团队已经确认,这是因为卡是由Graph API发送的,没有与Graph API关联的应用程序,因此卡上没有显示应用程序属性。

    以下是关于如何指定TeamsAppId以修复此问题的文档 https://docs.microsoft.com/en-us/graph/api/chatmessage-post?view=graph-rest-beta&tabs=http#example-10-send-message-that-contains-cards-that-are-attributed-to-a-teams-app

    请注意,这仍然是测试版。