0

We're using Microsoft.Graph to read /users and get notifications. This is the working example on how we subscribe:

        var result = await _client.Subscriptions.Request().AddAsync(new Subscription() {
            ChangeType = "updated,deleted",
            NotificationUrl = /* skipped */,
            ExpirationDateTime = DateTimeOffset.UtcNow.AddMinutes(10),
            Resource = "/users",
        }, token);

Up until 6th or 7th of December 2018 this was a valid code. Currently it returns:

Code: ExtensionError
 Message: Operation: Create; Exception: [Status Code: Forbidden; Reason: Forbidden]

 Inner error

Read /users works.

Read and subscribe to /users/some@email/contacts works.

Verification request on my callback url is received and properly processed.

I have an application token with Directory.Read.All and Contacts.Read application permissions.

Was there a change in permissions or API ?

UPDATE:

It is broken again approx 20th of January 2019. Are there any updates on that?

norekhov
  • 3,915
  • 25
  • 45
  • Have you referred to https://learn.microsoft.com/en-us/graph/api/subscription-post-subscriptions?view=graph-rest-1.0 – Jim Xu Dec 12 '18 at 01:41
  • Magically it works again. Looks like issue from MS side. Thanks to stackoverflow! – norekhov Dec 12 '18 at 09:30

1 Answers1

0

I also encountered the same problem. The description is as follows: there is no Reston code, just code is forbidden:

{

    "Error": {        
        "code": "ExtensionError",        
        "message": "Operation: Create; Exception: [Status Code: Forbidden; Reason: ]",

        "innerError": {        
            "request-id": "81d5439d-aebb-41e4-9b8f-df8475a60f1e",        
            "date": "2019-12-24T09:01:32"        
         }        
    }    
}

I don't know if it's Microsoft's problem. The error prompt is not comprehensive. I'm a little worried...

Manoj Choudhari
  • 5,277
  • 2
  • 26
  • 37