Microsoft ToDo Graph API is sending broken JSON - microsoft-graph-api

I'm getting the response with invalid JSON (brackets aren't closed) when trying to get the MS ToDo task for the user. Also, API sends HTTP status 200 with that response.
Request/response examples:
https://graph.microsoft.com/v1.0/me/todo/lists/:listID/tasks/:taskID
{
"title": "DELETED",
"createdDateTime": "2020-06-17T18:33:44.3228459Z",
"lastModifiedDateTime": "2020-11-27T11:36:55.8037415Z",
"id": "DELETED",
"linkedResources": [
{
"error": {
"code": "InternalServerError",
"message": "Invalid object within the collection response from workload for navigation property linkedResources with declaring type microsoft.graph.todoTask. Expected a JObject, but got Jtoken type - Null",
"innerError": {
"date": "2021-05-14T03:13:36",
"request-id": "5b9445b0-7405-436a-8179-cac92a8af087",
"client-request-id": "5b9445b0-7405-436a-8179-cac92a8af087"
}
}
}
How can I resolve this issue?

Related

Microsoft Graph API - Using postman to update the created task in microsoft planner

I am trying to update the task in Microsoft planner using Graph API in postman. I have already created a blank task and I am updating the created task using PATCH function to attach a file.
PATCH Request:
PATCH https://graph.microsoft.com/v1.0/planner/tasks/{task-id}/details
Content-type: application/json
Prefer: return=representation
If-Match: W/\"JzEtVGFza0RldGFpbHMgQEBAQEBAQEBAQEBAQEBAVCc=\"
{
"#odata.etag": "W/\"JzEtVGFza0RldGFpbHMgQEBAQEBAQEBAQEBAQEBAVCc=\"",
"previewType": "noPreview",
"references": {
"https%3A//my%2Esharepoint%2Ecom/sites/Test12/Shared Documents/Sample%2Edocx":
{
"#odata.type": "microsoft.graph.plannerExternalReference",
"alias": "Sample.docx",
"lastModifiedBy": {
"user": {
"id": "5442777a-0440-4a2f-9269-21824464e3a1"
}
},
"lastModifiedDateTime": "2022-09-05T11:06:47.6011074Z",
"previewPriority": "0009005756397228702",
"type": "word"
}
}
}
When i sent it it showed 400 Bad Request.
Response Error Message -
{
"error": {
"code": "",
"message": "The request is invalid:\r\nAn unexpected 'StartObject' node was found for property named 'lastModifiedBy' when reading from the JSON reader. A 'PrimitiveValue' node was expected.",
"innerError": {
"date": "2022-09-06T04:49:34",
"request-id": "37001992-fafb-461e-a4f0-9f1dafa34b21",
"client-request-id": "37001992-fafb-461e-a4f0-9f1dafa34b21"
}
}
}
Is there any issue with the body content?

issue posting #microsoft.graph.exclusionGroupAssignmentTarget

attempting to add an exclusion group via the api in graph explorer.
https://graph.microsoft.com/beta/deviceManagement/deviceConfigurations/da91e7e4-47cf-490a-9b23-4cecacf69d93/assignments
request body
{
"#odata.type": "#microsoft.graph.exclusionGroupAssignmentTarget",
"groupId": "c16283f1-fb74-4e6c-9fc9-27b213b50512"
}
response preview
{
"error": {
"code": "ModelValidationFailure",
"message": "Incompatible type kinds were found. The type 'microsoft.management.services.api.exclusionGroupAssignmentTarget' was found to be of kind 'Complex' instead of the expected kind 'Entity'.",
"innerError": {
"message": "Incompatible type kinds were found. The type 'microsoft.management.services.api.exclusionGroupAssignmentTarget' was found to be of kind 'Complex' instead of the expected kind 'Entity'.",
"date": "2021-10-01T18:10:01",
"request-id": "96cff9fa-bafd-4f87-98e5-69ff814faa8d",
"client-request-id": "f8011c1f-1457-22ae-2e1e-e20842ccec11"
}
}
}

MS graph InvalidDeltaToken on events list next page

I'm getting an error when I call NextLink from the response of first delta.
Any ideas why it's happens?
first call:
https://graph.microsoft.com/beta/users/4ca91597-4091-4cce-856b-7472b3f9ade1/calendars/AAMkAGM3MDdhNGZlLWRjYTUtNGZkYS04NTcxLTU2OTNkZWEwNDlhYQBGAAAAAAAmh2PA4MC8QpGOM1iWfgeZBwCI_1RC5zxoQrQX6X2piZBLAAAAAAEGAACI_1RC5zxoQrQX6X2piZBLAAAAjD53AAA=/events/delta
response:
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(event)",
"#odata.nextLink": "https://graph.microsoft.com/beta/users/4ca91597-4091-4cce-856b-7472b3f9ade1/calendars/AAMkAGM3MDdhNGZlLWRjYTUtNGZkYS04NTcxLTU2OTNkZWEwNDlhYQBGAAAAAAAmh2PA4MC8QpGOM1iWfgeZBwCI_1RC5zxoQrQX6X2piZBLAAAAAAEGAACI_1RC5zxoQrQX6X2piZBLAAAAjD53AAA=/events/delta?$skiptoken=S-9EQM7OmIraj-ou9n4yBgQa6fEPxPaBcX7TFg2kKSyrl9s4t08HSSZnFF-gwy4A9E6Yg7ADWLv-z3JJ4D5p_galSKYHzmiN98EJV1ewagGy4vLP_Ccf6Ry5MQoXRx_NxwVr9hFfl2aiymXlEAMXUSGMaX9Yc7O2q6czmAFcCr_ZEL7TGy0sQqgOA7UzNZ64ocJyQRBMUjvuE19KlhqPkA.XaSRYkwmW-IAiW8ABt7Qi1gz7aHGDe2uF-m2RdF2lLM
...}
and on call NextLink I'm getting error:
{
"error": {
"code": "InvalidDeltaToken",
"message": "The value 'NCZUMk42WmtGWmFqZFdSVXh1VUVkb1EzUkNabkJtWVcxS2EwVnpRVUZPVmtWelJEQkNRVUZCUVE9PQ=='
of parameter '$deltaToken' is invalid.",
"innerError": {
"date": "2020-09-27T19:04:42",
"request-id": "6897b163-5d66-4223-8c01-ab40a0417c35",
"client-request-id": "3455e667-c7e7-9c6d-e18e-5c94c37150c8"
}
} }
UPD.1
problem with header:
rPrefer = odata.maxpagesize=50
if you are MS's developer please open ticket.

Microsoft Graph returns "Internal Server Error" on request?

I am trying to get my Microsoft Teams assignments through Microsoft Graph. I submit this GET request https://graph.microsoft.com/beta/education/me/classes/{id}/assignments as shown in the docs, with my authentication token as a header. However, below is the reply I get. I am doing this with python, however I have also tried from Graph Explorer which yields the same result.
{
"error": {
"code": "InternalServerError",
"message": "Object reference not set to an instance of an object.",
"innerError": {
"date": "2020-09-07T16:44:48",
"request-id": "011086a0-9240-4896-9363-d403a1a0fb05"
}
}
}
Does anybody have any insight? Is this a problem with Microsoft?
You need to remove the /me. The correct URI is https://graph.microsoft.com/beta/education/classes/{id}/assignments.
From the documentation
POST https://graph.microsoft.com/beta/education/classes/11019/assignments
Content-type: application/json
Content-length: 279
{
"dueDateTime": "2014-02-01T00:00:00Z",
"displayName": "Midterm 1",
"instructions": {
"contentType": "text",
"content": "Read chapters 1 through 3"
},
"grading": {
"#odata.type": "#microsoft.education.assignments.api.educationAssignmentPointsGradeType",
"maxPoints": 100
},
"assignTo": {
"#odata.type": "#microsoft.education.assignments.api.educationAssignmentClassRecipient"
},
"status":"draft",
"allowStudentsToAddResourcesToSubmission": true
}

Getting 500 error for https://graph.microsoft.com/beta/me/profile endpoint

I'm getting a 500 error while invoking https://graph.microsoft.com/beta/me/profile endpoint from
Graph explorer (https://developer.microsoft.com/en-us/graph/graph-explorer). When I check the network tab, I can see the error response as below. Any idea why? I tried resetting my birthdate multiple times from account.microsoft.com but that is still not fixing the timestamp & lastModifiedBy issue
{"#odata.context":"https://graph.microsoft.com/beta/$metadata#users('...')/profile/$entity","id":"profileId","addresses#odata.context":"https://graph.microsoft.com/beta/$metadata#users('...')/profile/addresses","addresses":[],"anniversaries#odata.context":"https://graph.microsoft.com/beta/$metadata#users('...')/profile/anniversaries","anniversaries":[{"type":"birthday","date":"...","allowedAudiences":"me","createdDateTime":"2020-06-30T21:52:30.364606Z","inference":null,"lastModifiedDateTime":"2020-06-30T21:52:30.364606Z"{
"error": {
"code": "InternalServerError",
"message": "The property 'lastModifiedBy[Nullable=False]' of type 'microsoft.graph.identitySet' has a null value, which is not allowed.",
"innerError": {
"date": "2020-06-30T22:15:16",
"request-id": "b9402c6b-297d-4190-a829-8297dae69d9d"
}
}
}{
"error": {
"code": "InternalServerError",
"message": "Unexpected end when deserializing object. Path 'anniversaries[0].lastModifiedDateTime', line 1, position 587.",
"innerError": {
"date": "2020-06-30T22:15:16",
"request-id": "b9402c6b-297d-4190-a829-8297dae69d9d"
}
}
}

Resources