"Error code: ErrorInvalidIdMalformed Error message: Id is malformed"

Isha Sharma 5 Reputation points
2023-03-22T19:44:57.47+00:00

I am trying to create an event using Microsoft Calendar Graph API, on a room (resource) calendar. I am providing my email as user id and, object id of the resource from Azure portal as calendar id (also same id when i do GET user for the room). Here is what my URL looks like:

https://graph.microsoft.com/v1.0/users/******@nimbusco.onmicrosoft.com/calendars/71c29970-f4cc-49a2-b05c-60232cf89257/events

Can I please get help in resolving this Error or suggestion on best way to create a meeting on a room calendar with me being the organizer and not the room. As I noticed, whatever you provide in the userid is shown as organizer. Thanks!

This is the response for above URL:

{
    "error": {
        "code": "ErrorInvalidIdMalformed",
        "message": "Id is malformed."
    }
}
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,268 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Siddharth Gautam 860 Reputation points
    2023-03-22T23:01:28.9933333+00:00

    Hello Isha Sharma,

    Thanks for posting!

    As per my Investigation, it seems there is some issue with the Calendar ID which you are using to list the events i.e., object Id you are passing as calendar Id is incorrect. I am able to replicate the error message when I am passing incorrect Calendar-Id.

    Please refer the below steps to get the calendar-Id using graph API.

    1. Run the Graph Endpoint GET /users/{id | userPrincipalName}/calendars.
    2. After executing the first step you can obtain the calendar-Id, please refer below screenshot for same.

    User's image

    Now, you can be able to list the calendars events using below Graph API:

    GET /users/{id | userPrincipalName}/calendars/{id}/events

    Reference link: List events

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.