【发布时间】:2019-12-04 13:50:35
【问题描述】:
我正在尝试使用 JSON 批处理将多个请求合并到一个 HTTP 调用中,以便使用 GRAPH Explorer 在 MS Teams 频道中发布消息。
url=https://graph.microsoft.com/beta/$batch
Request Body ={
"requests": [
{
"id": "1",
"url": "/teams/cf82621f-bbe1-4bf1-a973-030fc6e58f03/channels/19:832f5e8d49ad4bfe96944d47cdd921d2@thread.skype/messages",
"method": "POST",
"body": {
"content": "HelloWorld"
},"headers": {
"Content-Type": "application/json"
}
}
]
}
在发布时我得到了成功 - 状态代码 200,但响应是
{
"responses": [
{
"id": "1",
"status": 400,
"body": {
"error": {
"code": "BadRequest",
"message": "Value cannot be null.\r\nParameter name: Content",
"innerError": {
"request-id": "e23a0012-f40b-45e8-bae8-d68204217921",
"date": "2019-12-04T13:23:16"
}
}
}
}
]
}
我已经提到了正文中内容的价值,没有 JSON 批处理它对我来说很好。
【问题讨论】:
标签: json rest microsoft-graph-api microsoft-teams microsoft-graph-teams