用于列出频道消息和发布频道的Microsoft Graph API引发错误的请求

时间:2020-05-13 09:03:25

标签: microsoft-graph-api microsoft-teams microsoft-graph-teams

我们正在使用带有$ top = 1的列表频道消息beta API获取最新消息 https://graph.microsoft.com/beta/teams/ $ {team_id} / channels / $ {channel} / messages?$ top = 1

用于发布与以下请求正文一起使用的消息传递https://graph.microsoft.com/beta/teams/ $ {team_id} / channels / $ {channel} / messages API

{ subject: 'Head Post', body: { contentType: 'html', content: '<b><i>Hi</i></b> Introduce yourself.' } }

。 租户全局管理员访问令牌作为承载令牌提供。

有时会出现以下错误,并且没有提供信息。

{ error: { code: 'BadRequest', message: 'Bad Request', innerError: { 'request-id': 'bbd96990-bd80-4023-b7a6-925319dc79ef', date: '2020-05-12T19:19:11' } } }

error.response.headers

{ 'cache-control': 'private', 'content-type': 'application/json', 'request-id': 'bbd96990-bd80-4023-b7a6-925319dc79ef', 'client-request-id': 'bbd96990-bd80-4023-b7a6-925319dc79ef', 'x-ms-ags-diagnostic': '{"ServerInfo":{"DataCenter":"South Central US","Slice":"SliceC","Ring":"4","ScaleUnit":"002","RoleInstance":"AGSFE_IN_22"}}', 'strict-transport-security': 'max-age=31536000', date: 'Tue, 12 May 2020 19:19:11 GMT', connection: 'close', 'content-length': '207' }

任何人都可以解释导致错误的原因以及如何解决该错误吗?

0 个答案:

没有答案