我在通过Graph API
应用程序访问POST API(发送消息,创建频道)时遇到问题。
第一个请求是创建频道:
请求网址:h ttps://graph.microsoft.com/v1.0/teams/id/channels
帖子正文:
{:displayName=>"new channel", :description=>"description"}
标头还包括来自授权API的承载令牌
收到错误:
{:code=>"BadRequest", :message=>"channel cannot be null.\r\nParameter name: channel", :innerError=>{:date=>"2020-06-24T12:40:33", :"request-id"=>"be91ce7b-0"}}
我遵循的文档:https://docs.microsoft.com/en-us/graph/api/channel-post?view=graph-rest-1.0&tabs=http
第二个请求是向通道发送消息:
请求网址:https://graph.microsoft.com/v1.0/teams/bc71-8b158cc3b3/channels/19:ec73841@thread.skype/messages
帖子正文:
{:body => {:contentType=>"html", :content=>"Tesing message from graph api"}}
标头还包括来自授权API的承载令牌
收到错误:
{:code=>"InternalServerError", :message=>"Failed to execute request.", :innerError=>{:date=>"2020-06-24T12:42:01", :"request-id"=>"ed601c89-f0bd3"}}
我遵循的文档:https://docs.microsoft.com/en-us/graph/api/channel-post-messages?view=graph-rest-1.0&tabs=http