Microsoft graph api 有没有办法用代码片段发布消息?
通过端点上传图像作为托管内容的新方法非常棒!但是,有没有一种方法可以将文本/纯文本作为托管内容上传,以便在消息中发布代码片段卡? 我已经尝试上传文本,但响应给了我一个错误,说唯一允许的内容类型是'image/jpg,image/jpeg,image/png' 请求示例:Microsoft graph api 有没有办法用代码片段发布消息?,microsoft-graph-api,microsoft-teams,microsoft-graph-teams,Microsoft Graph Api,Microsoft Teams,Microsoft Graph Teams,通过端点上传图像作为托管内容的新方法非常棒!但是,有没有一种方法可以将文本/纯文本作为托管内容上传,以便在消息中发布代码片段卡? 我已经尝试上传文本,但响应给了我一个错误,说唯一允许的内容类型是'image/jpg,image/jpeg,image/png' 请求示例: { "body": { "contentType": "html", "content": "&l
{
"body": {
"contentType": "html",
"content": "<attachment id=\"4d92eb51ab9c48ebb5b364794a2fa569\"></attachment>"
},
"attachments": [
{
"id": "4d92eb51ab9c48ebb5b364794a2fa569",
"contentType": "application/vnd.microsoft.card.codesnippet",
"contentUrl": null,
"content": "{\"name\":\"\",\"language\":\"CSharp\",\"lines\":1,\"wrap\":false,\"codeSnippetUrl\":\"../hostedContents/1/$value\"}",
"name": null,
"thumbnailUrl": null
}
],
"hostedContents":[
{
"@microsoft.graph.temporaryId": "1",
"contentBytes": "VGVzdA==",
"contentType": "text/plain"
}
]
}
我在GitHub文档中收到了一个答案: 目前不支持代码段。他们在需要支持的事情清单上,但还没有时间表可以分享
{
"error": {
"code": "BadRequest",
"message": "Unsupported content type in hostedContent with Id '1'. Allowed values are 'image/jpg,image/jpeg,image/png'",
"innerError": {
"date": "2020-10-07T12:17:15",
"request-id": "ed24f5df-3e1f-4871-b430-e4c1c9f30348",
"client-request-id": "ed24f5df-3e1f-4871-b430-e4c1c9f30348"
}
}
}