【发布时间】:2020-11-06 15:47:24
【问题描述】:
我正在尝试与https://graph.microsoft.com/v1.0/informationProtection/threatAssessmentRequests联系
出现以下错误: 401 {
“错误”:{
"code": "Unauthorized",
"message": "Required authentication information is either missing or not valid for the resource.",
"innerError": {
"date": "2020-11-06T15:21:22",
"request-id": "8f4d480e-2916-4501-904b-0ca13db9e85e",
"client-request-id": "8f4d480e-2916-4501-904b-0ca13db9e85e"
我使用的是 python3.7,代码看起来像:
token ="xyz.dslkdskds_123"
headers = {
"Content-type": "application/json",
"Authorization": "Bearer " + token
}
query1={
"@odata.type": "#microsoft.graph.urlAssessmentRequest","url": "info.cvx.com", "contentType":"url",
"expectedAssessment": "block", "category": "phishing"
}
url="https://graph.microsoft.com/v1.0/informationProtection/threatAssessmentRequests"
r = requests.post(url, headers=headers,data=json.dumps(query1))
【问题讨论】:
-
能否请您提供所需的权限 Delegated(工作或学校帐户) ThreatAssessment.ReadWrite.All
-
使用jwt.ms 解析您的访问令牌并提供屏幕截图。
-
您在这个问题上还需要帮助吗?如果是,请分享上述信息。
-
@SruthiJ-MSFTIdentity :您好 Sruthi,我已获得许可。 "user.read","mail.send","ThreatAssessment.ReadWrite.All","ThreatAssessment.Read.All"
-
我在 MS 门户中发现了“威胁评估权限仅对工作或学校帐户有效”的评论。是不是表示企业账号不支持这个功能?
标签: microsoft-graph-api office365api microsoft-information-protection