python Microsoft Graph API -获取计划器任务-权限错误

cvxl0en2  于 2023-01-19  发布在  Python
关注(0)|答案(1)|浏览(153)

我正在使用Microsoft Graph Explorer测试一些get请求(例如:https://graph.microsoft.com/beta/me/planner/tasks),它可以工作。我在python脚本中创建了URL。该脚本还包含其他get请求,它们的工作方式如下:获取用户名和他们的ID。但是当我检查输出时,我得到这个错误:“您没有权限..."。
我将把全部错误写在下面。

{'error': {'code': 'UnknownError', 'message': '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r\n<html xmlns="http://www.w3.org/1999/xhtml">\r\n<head>\r\n<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>\r\n<title>403 - Forbidden: Access is denied.</title>\r\n<style type="text/css">\r\n<!--\r\nbody{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}\r\nfieldset{padding:0 15px 10px 15px;} \r\nh1{font-size:2.4em;margin:0;color:#FFF;}\r\nh2{font-size:1.7em;margin:0;color:#CC0000;} \r\nh3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} \r\n#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;\r\nbackground-color:#555555;}\r\n#content{margin:0 0 0 2%;position:relative;}\r\n.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}\r\n-->\r\n</style>\r\n</head>\r\n<body>\r\n<div id="header"><h1>Server Error</h1></div>\r\n<div id="content">\r\n <div class="content-container"><fieldset>\r\n  <h2>403 - Forbidden: Access is denied.</h2>\r\n  <h3>You do not have permission to view this directory or page using the credentials that you supplied.</h3>\r\n </fieldset></div>\r\n</div>\r\n</body>\r\n</html>\r\n', 'innerError': {'request-id': '01b084bb-fd48-4cf3-b83b-dd1641a0e889', 'date': '2020-06-09T22:33:18'}}}

我检查了我的权限。My Permissions in Microsoft Graph
https://learn.microsoft.com/en-us/graph/api/planneruser-list-tasks?view=graph-rest-1.0&tabs=http
我只需要组。读。所有和组。读。写。所有的权限,我已经得到了。顺便说一句,我是管理员。
我错过什么了吗?

egmofgnx

egmofgnx1#

现在支持应用程序权限。
过期回复:
您的请求失败,因为提供的令牌是仅应用程序令牌。Planner当前不支持应用程序权限,您需要使用委派凭据。
应用程序权限已公布:https://devblogs.microsoft.com/microsoft365dev/announcing-updates-to-the-planner-api-in-microsoft-graph/

相关问题