Error while creating task. "Does not support untyped value in non-open type"

Daniele Morelli 116 Reputation points
2022-07-04T11:42:00.833+00:00

Hi.
We have a proprietary software that syncs with MS Tasks.
The code used to work fine, but recently we receive an error while saving a new task on graph.microsoft.com.

The API url is the following one: https://graph.microsoft.com/beta/me/todo/lists/<<id>>/tasks
We make a POST call passing the data as follows:

{
"title":"MY TASK TITLE",
"body":
{
"contentType":"html",
"content":"<div>test</div>"
},
"startDateTime":{"dateTime":"2022-07-04T13:00:00","timeZone":"Europe/Rome"},
"dueDateTime":{"dateTime":"2022-07-04T17:00:00","timeZone":"Europe/Rome"},
"isReminderOn":true,
"reminderDateTime":{"dateTime":"2022-07-04T15:00:00","timeZone":"Europe/Rome"}
}

The response is (ids changed for privacy):

{"error":{"code":"invalidRequest","message":"Does not support untyped value in non-open type.","innerError":{"code":"InvalidModel","date":"2022-07-04T11:33:03","request-id":"12345","client-request-id":"67890"}}}

What exactly does "Does not support untyped value in non-open type." mean? What model exactly is invalid?
I tried various variations of the request, adding other fields (categories, importance, status, linkedResources) and trying again. No change in the response error.

Any help would be very appreciated,
thanks in advance.

Daniele

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,724 questions
0 comments No comments
{count} votes

Accepted answer
  1. Zehui Yao_MSFT 5,831 Reputation points
    2022-07-04T12:51:45.16+00:00

    Hi @Daniele Morelli , I noticed that you are using the beta version to make a request, since the beta is mainly used for internal testing of the product, there may be instability, I used beta version to reproduce your problem.

    217279-untitled2.png

    And I tested it locally with the v1.0 version and it can run successfully, so I recommend using the v1.0 version.

    217335-untitled.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful