问题描述
我正在尝试与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"
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))