我正在尝试连接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))