如何解决使用Graph API在规划器中创建新任务时遇到错误?
尝试在Microsoft Planner中创建任务时收到以下错误:
Graph API call result:
{
"error": {
"code": "BadRequest","message": "Write requests are only supported on contained entities","innerError": {
"date": "2020-08-13T13:05:07","request-id": "f9fe4928-a432-4b49-9bc2-b3d433f4bebc"
}
}
}
我正在尝试执行以下发帖请求:
request_body = '''{
"planId": "<My Plan ID>","title": "New Task","assignments": {}}
'''
graph_data = requests.post( # Use token to call downstream service
config["endpoint"],headers={'Authorization': 'Bearer ' + result['access_token'],'Content-Type':'application/json',},data = request_body).json()
print("Graph API call result: ")
print(json.dumps(graph_data,indent=2))
我已经提供了所有必需的权限,还提供了租户ID。 config['endpoint']
设置为https://graph.microsoft.com/v1.0/Users/<My USER ID>/planner/tasks
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。