Office365: Unauthorized response when accessing the management activity api

强颜欢笑 提交于 2019-12-10 09:51:48

问题


I am having trouble accessing the management activity API that has recently been rolled out. Though I believe I have correctly configured my app

Yet when I make the following API call

POST

https://manage.office.com/api/v1.0/<tenantId>/activity/feed/subscriptions/start?contentType=Audit.SharePoint    

BODY

{
"webhook" : {
"address": "<myServerURL>",
"authId": "o365activityapinotification",
"expiration": ""
}

}

RESPONSE

401
{
    "Message": "Authorization has been denied for this request."
}

What am I doing wrong?

Update 1

I successfully registered the webhook (don't know what the issue was but it has registered my webhook now)

{
"contentType": "Audit.Sharepoint",
"status": "disabled",
"webhook": {
    "authId": "o365activityapinotification",
    "address": "<myserverurl>",
    "expiration": null,
    "status": "enabled"
}
}

is the response I got. Now my question is why is the status disabled? I did bunch of changes but no Push has been received, I believe this disabled state here is the reason. Any help?


回答1:


The API is in preview state so when you subscribe, it's in DISABLED state and you have to ask MSFT guys to enable it for you (provided you had an invite to the early access) My subscription is enabled now and I'm getting the PUSH notifications for the tenant level changes.



来源:https://stackoverflow.com/questions/32583795/office365-unauthorized-response-when-accessing-the-management-activity-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!