Microsoft Graph API - Get subscriptions issue - microsoft-graph-api

I have tried to get subscriptions list
GET https://graph.microsoft.com/v1.0/subscriptions
And got the response:
{
"error": {
"code": "QueryNotSupported",
"message": "Get Subscriptions list is not supported for the API version 1.0.",
"innerError": {
"request-id": "39473acc-179a-4a41-beba-0dd7887c299b",
"date": "2019-09-17T07:49:12"
}
}
}
The same request is eventually working during the last couple of hours.
Are there some migration activities with Graph API?
Thank you
Update:
Subscriptions getting is working now, but when I got subscription's id
{
"id": "45f46028-2f93-4167-947a-2a1dda035226",
"resource": "users/****/events",
"applicationId": "***",
"changeType": "created,updated,deleted",
"clientState": null,
"notificationUrl": "******",
"expirationDateTime": "2019-09-19T19:46:53.934Z",
"creatorId": "****"
},
and tried to delete it:
DELETE https://graph.microsoft.com/v1.0/subscriptions/45f46028-2f93-4167-947a-2a1dda035226
I got the response:
{
"error": {
"code": "ResourceNotFound",
"message": "The object was not found.",
"innerError": {
"request-id": "c485edd8-cc2e-461b-8c90-2cb5cc8dbebd",
"date": "2019-09-19T08:51:46"
}
}
}

We are sorry, but we did have a degradation of service affecting those two operations (list and delete). It has been resolved since.

Related

Create Workforce Integration using the graph API

I am using this endpoint in POSTMAN: Endpoint: https://graph.microsoft.com/v1.0/teamwork/workforceIntegrations
with requst body
Request body:
{
"apiVersion": 1,
"displayName": "samplename",
"encryption": {
"protocol": "sharedSecret",
"secret": "someescretvalueasper the doc"
},
"isActive": true,
"supportedEntities": "shift",
"url": "sampleurl.com"
}
I have followed all steps as mentioned in the documentation here https://learn.microsoft.com/en-us/graph/api/workforceintegration-post?view=graph-rest-1.0&tabs=http
however I am getting this error
{
"error": {
"code": "BadRequest",
"message": "{\"error\":{\"title\":\"Something went wrong\",\"externalErrorMessage\":\"Bad Request\",\"externalSource\":\"ShiftBookingsFlow\",\"externalImageLink\":null,\"externalData\":null,\"code\":\"BadRequest\",\"message\":\"Sorry your change couldn’t be completed.\",\"details\":[],\"innererror\":{\"code\":\"WorkforceIntegrationError\"}}}",
"innerError": {
"date": "2022-12-18T23:47:36",
"request-id": "d8e370a1-1d63-4137-9b49-07c74df6861b",
"client-request-id": "d8e370a1-1d63-4137-9b49-07c74df6861b"
}
}
}
Can anyone help me understand what I am doing wrong over here?
I expect a 200 Ok response but it is giving 400 bad request.
Is there any pre-requirsite to this API?

Trying to create team with owner using principal name, gives error "Failed to find users with user principal name" but user is owner of 365 account

Request URL
https://graph.microsoft.com/v1.0/teams
Request Body
{
"template#odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('standard')",
"displayName": "Team22",
"description": "My Sample Team’s Description",
"members": [
{
"#odata.type": "#microsoft.graph.aadUserConversationMember",
"roles": [
"owner"
],
"user#odata.bind": "https://graph.microsoft.com/v1.0/users('vishalkumar#4vswmg.onmicrosoft.com')"
}
]
}
Response Code 404
Response Preview
{
"error": {
"code": "NotFound",
"message": "Failed to find users with user principal name 'vishalkumar#4vswmg.onmicrosoft.com'",
"innerError": {
"date": "2022-05-13T06:55:15",
"request-id": "9df9a8fa-21cc-4455-b39f-ef1aca1d4b07",
"client-request-id": "24d55bd6-3f77-b808-221e-3f1a7af7dd5a"
}
}
}
The following payload worked for me:
Ref Doc: https://learn.microsoft.com/en-us/graph/api/team-post?view=graph-rest-1.0&tabs=http#example-9-application-permissions-using-user-principal-name
"template#odata.bind":"https://graph.microsoft.com/v1.0/teamsTemplates('standard')",
"displayName":"My Sample Team",
"description":"My Sample Team’s Description",
"members":[
{
"#odata.type":"#microsoft.graph.aadUserConversationMember",
"roles":[
"owner"
],
"user#odata.bind":"https://graph.microsoft.com/v1.0/users('jacob#contoso.com')"
}
]
}```
Keep in mind you can add only one owner at the time of Team creation using Graph API

Getting 400 bad request from Microsoft Graph Api for SchemaExtensions

Limit of: 5 extension schema definitions can be written. !
Here is the response
{
"error": {
"code": "BadRequest",
"message": "Limit of: 5 extension schema definitions can be written.",
"innerError": {
"date": "2020-10-26T12:29:47",
"request-id": "requestID",
"client-request-id": "client-requestID"
}
}
}
And here is the request body
{
"id": "myMetaData",
"description": "My description",
"targetTypes": [
"Group"
],
"properties": [
{
"name": "shortName",
"type": "String"
},
{
"name": "supervisor",
"type": "String"
}
]
}
I have used delegated permision and used token generated by password since SchemaExtension needs delegated one and doesn't support application perm.
I got the answer , it was due to limit of the schemaExtensions that could be created other developer on the project already created 5 and since this was the limit set it showed this error

How to filter SharePoint list items by ID using Microsoft Graph Api

How to filter SharePoint list-items by Id.
Id is out-of-the-box field in the SharePoint-list.
I am testing using graph-explorer: https://developer.microsoft.com/en-us/graph/graph-explorer
I tried with these filters
Working filter with Title:
https://graph.microsoft.com/v1.0/sites/root/lists/ba0dc64a-263c-44b6-8160-66a3034a1429/items?$expand=fields&$filter=fields/Title eq '1'
Non-working filter with Id:
https://graph.microsoft.com/v1.0/sites/root/lists/ba0dc64a-263c-44b6-8160-66a3034a1429/items?$expand=fields&$filter=fields/id eq '1'
{
"error": {
"code": "invalidRequest",
"message": "A provided field name is not recognized",
"innerError": {
"request-id": "9f0bd335-bf60-42dd-893e-397fe62bc890",
"date": "2019-05-01T00:25:51"
}
}
}
https://graph.microsoft.com/v1.0/sites/root/lists/ba0dc64a-263c-44b6-8160-66a3034a1429/items?$expand=fields&$filter=fields/Id eq 1
{
"error": {
"code": "BadRequest",
"message": "Invalid filter clause",
"innerError": {
"request-id": "730490af-6b08-4ac1-8259-fa9bb9dd9e46",
"date": "2019-05-01T00:26:28"
}
}
}
A single ListItem resource could be addressed by Id like this (refer Get item endpoint for a more details):
GET https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}?$expand=fields
where
site-id - identifier of Site resource
list-id - identifier of List resource
item-id - identifier of ListItem resource
To retrieve multiple items by ids, JSON batch endpoint could be utilized, for example:
POST https://graph.microsoft.com/v1.0/$batch
Accept: application/json
Content-Type: application/json
Body:
{
"requests": [
{
"id": "1",
"method": "GET",
"url": "/sites/root/lists/{list-id}/items/{item_id-1}/"
},
{
"id": "2",
"method": "GET",
"url": "/sites/root/lists/{list-id}/items/{item_id-2}/"
}
]
}

Unable to update OneNote page content

I send a PATCH request to https://graph.microsoft.com/beta/me/onenote/pages/1-3e7c1460680d4fe28501792ccda64915!119-304d54d6-d499-49f0-b231-cb3a9248e4e9/content
with body
[
{
"action": "replace",
"target": "p:{3e7c1460-680d-4fe2-8501-792ccda64915}{197}",
"content": "<p data-tag=\"to-do:completed\" style=\"margin-top:0pt;margin-bottom:0pt\">Sdasdsad</p>"
}
]
And I get response 500 with body:
{
"error": {
"code": "19999",
"message": "Something failed, the API cannot share any more information at the time of the request.",
"innerError": {
"request-id": "574a3b34-c354-4603-a73e-981984a56758",
"date": "2018-09-24T08:23:02"
}
}
}
The error is persistent. Does anybody knows where I can get help?

Resources