I create one subscription in Microsoft Graph.
When I list the existing subscriptions (GET /v1.0/subscriptions), the subscription with the id X is returned.
When I Delete the subscription (DEL /v1.0/subscriptions/X), I get an HTTP 404 error with the following content:
"error": {
"code": "ExtensionError",
"message": "Operation: Delete; Exception: [Status Code: NotFound;
Reason: The subscription with Id '[an internal id]' is not found.]"
}
I noticed this behavior on 03/25/2019 but the API had been working since January.
Related
When trying to create a subscription on some of my customers calendars using MS Graph (https://graph.microsoft.com/v1.0/subscriptions), I get this error for a few users
{
"error": {
"code": "ExtensionError",
"message": "Operation: Create; Exception: [Status Code: ServiceUnavailable; Reason: Target resource 'xxxx-xxx-xxx-xxxx' hosted on database 'xxxx-xxx-xxx-xxxx' is currently on backend 'Unknown']",
"innerError": {
"date": "2020-11-27T00:12:53",
"request-id": "xxxx-xxx-xxx-xxxx",
"client-request-id": "xxxx-xxx-xxx-xxxx"
}
}
}
The documentation https://learn.microsoft.com/en-us/graph/errors suggests that ExtensionError means that the users calendar is on an on premises Exchange Server, but I am able to read and write the events of the users calendar, so I don't think this is the case. Any other suggestions?
I am trying to subscribe to Microsoft Teams Presence API for a particular user.
Request Url:
https://graph.microsoft.com/beta/subscriptions
Request Body
{
'changeType': 'created,updated',
'notificationUrl': 'https://<domain-name>/presence-notify/',
'resource': '/communications/presences/{id}',
'expirationDateTime': '2020-09-10T07:37:13Z',
'clientState': 'secretClientState'
}
Response
{
"error": {
"code": "ExtensionError",
"message": "Operation: Create; Exception: [Status Code: Forbidden; Reason: The request is not authorized for this user or application.]",
"innerError": {
"date": "2020-09-09T11:27:27",
"request-id": "c563f94d-3c10-4c09-be35-0d1993d9a112"
}
}
}
The following delegated permissions were requested and granted by admin:
Presence.Read
Presence.Read.All
Client Certificate Pic
Finally i am able to solve the issue. As the error mentioned The request is not authorized for this user or application. So i thought there might be an issue with Access Token. Actually i was calling API on behalf of App i.e token with grant_type as client_credentials. Rather i should have called API on behalf of User i.e token with grant_type as password as it is clearly mentioned in documentation that
permissions are delegated. I didn't use any encryptionCertificate still subscription was successful.
You need to specify the encryptionCertificate. From the documentation:
presence subscriptions require encryption. Subscription creation will fail if encryptionCertificate is not specified.
When trying to retrieve data from a v1.0 report endpoint on a demo tenant, for example:
https://graph.microsoft.com/v1.0/reports/getOffice365ActiveUserCounts(period='D7')
I get this strange result:
{
"error": {
"code": "UnknownTenantId",
"message": "We do not recognize this tenant ID 3d64a....7279c0. Please double-check the tenant ID and try again.",
"innerError": {
"request-id": "7b7b8....8029b",
"date": "2018-04-30T09:32:46"
}
}
}
Instead of an HTTP 302 redirection to get the CSV report results (according to the doc).
I'm trying from Graph API Explorer, authenticated as tenant admin account, this has worked as expected before tenant expiration + extension (a few hours ago)
I will try in a few hours again, tomorrow etc. (I'll write the results here) because this error looks to be related to tenant expiration (or else, what is happening?)...
Hello I am getting several skip token errors when running a full import on the graph API.
here is the error
The following one looks like expiration of skiptoken. Graph connector uses skip token in different cases. I would communicate with Graph API team to understand if this is correct behavior for the API.
Message: Error during http call. HttpStatusCode: BadRequest;
url: https://graph.microsoft.com:443/v1.0/groups/5802115b-ef14-4572-bec1-9a4747e5bcfb/members/?$select=id&$skiptoken=X%2744537074090001000000000000000010000000D6203A9D758C6F4B887B307BA3302EB5000000000000000000000017312E322E3834302E3131333535362E312E342E323333310000000000000157F232736047814E848C20B3547FF5E8%27;
Response: {
"error": {
"code": "Directory_ExpiredPageToken",
"message": "The specified page token value has expired and can no longer be included in your request.",
"innerError": {
"request-id": "1489b123-f94c-4531-82d1-d4b76331e3eb",
"date": "2017-11-27T18:59:23"
}
}
}
Message: Error during http call. HttpStatusCode: Unauthorized;
"code": "Authentication_MissingOrMalformed",
"message": "Access Token missing or malformed.",
The application has full control over all objects so it should not get an error with permissions issues
I created an app on https://apps.dev.microsoft.com
with the following Application Permissions:
Calendars.Read (Admin Only) Calendars.ReadWrite (Admin Only) User.Read.All (Admin Only)
Admin Consent
Admin consent was then successfully granted via this URL
https://login.microsoftonline.com/strixtechnology.onmicrosoft.com/adminconsent?client_id=bbb35336-faee-4c10-84b4-34136634db41&state=1234&redirect_uri=https%3A%2F%2Fdashmeetings.com%2Fmicrosoft%2Foauth
Get access token
An access token was then obtained from
POST https://login.microsoftonline.com/common/oauth2/v2.0/token
with headers
Content-Type=application/x-www-form-urlencoded
and body with key-value pairs
grant_type=client_credentials
client_id=bbb35336-faee-4c10-84b4-34136634db41
client_secret=xxx
scope=https://graph.microsoft.com/.default
This returns an access token.
Subscribe to notifications
Using that access token, I then try to subscribe to the events on a certain resource mailbox:
POST https://graph.microsoft.com/beta/subscriptions
with headers
Content-Type=application/json
Authorization=Bearer <access_token_here>
and body
{
"changeType": "created,updated,deleted",
"notificationUrl": "https://dashmeetings.com/microsoft/notify",
"resource": "users/mahogany#strixtechnology.com/events",
"expirationDateTime":"2017-12-01T11:00:00.0000000Z",
"clientState":"1234"
}
This returns a 401 Unauthorized with
{
"error": {
"code": "ExtensionError",
"message": "Operation: Create; Exception: [Status Code: Unauthorized; Reason: Unauthorized]",
"innerError": {
"request-id": "98ce5e5e-1ce4-4417-8c35-456a3cc0e696",
"date": "2017-11-30T10:59:28"
}
}
}
This question seems similar to “Resource not found for the segment” using Graph subscription beta, but I follow the same steps without any luck
The admin consent URL had to be
https://login.microsoftonline.com/common/adminconsent?client_id=bbb35336-faee-4c10-84b4-34136634db41&state=1234&redirect_uri=https%3A%2F%2Fdashmeetings.com%2Fmicrosoft%2Foauth
and the access token address:
https://login.microsoftonline.com/<tenant_id>/oauth2/v2.0/token