3

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

AppConfig

Permissions Page during Oauth

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?

Syed Mauze Rehan
  • 1,125
  • 14
  • 31
  • Can you please let me know the authentication process for Management API? – Sandy Oct 01 '15 at 11:02
  • I use Client Credentials Flow for access tokens. I pass "https:// manage.office.com" as my resource and get an access token against it. The details can be found here https://msdn.microsoft.com/EN-US/library/dn707383.aspx – Syed Mauze Rehan Oct 02 '15 at 06:51
  • Thanks for you help. I am getting error: "Specified tenant ID is incorrectly configured in the system.". I have registered for preview program and took the enable API and preview surveys available on dashboard. Any idea on this? – Sandy Oct 05 '15 at 06:35
  • The tenant and the app for that tenant must be registered. (Say your tenant is abc.com, and you have an app called myApp created through this tenant, then you need to register both of these and then use this app. I think there is a confirmation or something that you receive. Otherwise I think the error would persist.) – Syed Mauze Rehan Oct 07 '15 at 05:43
  • Where and how to register? – Sandy Oct 07 '15 at 08:42
  • You have to have subscribed to their early access/preview program (you must have the invite, otherwise it's not possible I believe) You can leave a question to their support. – Syed Mauze Rehan Oct 07 '15 at 09:44

1 Answers1

2

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.

Syed Mauze Rehan
  • 1,125
  • 14
  • 31