Graph Api create subscription returns Status Code: BadRequest; Reason: The value 'https://outlook.office365.com/api/v2.0/Users('Sandbox%40company.com')/Events' of parameter 'Resource' is invalid.]\n\nPOST

Mikhail 1 Reputation point
2025-06-27T14:12:45.7933333+00:00

In our java springboot app we use dependency https://mvnrepository.com/artifact/com.microsoft.graph/microsoft-graph/5.72.0

When we try to create eventhub subscription for meeting room via that API we are getting error:

com.microsoft.graph.http.GraphServiceException: Error code: ExtensionError\nError message: Operation: Create; Exception: [Status Code: BadRequest; Reason: The value 'https://outlook.office365.com/api/v2.0/Users('Sandbox%40company.com')/Events'of parameter 'Resource' is invalid.]\n\nPOST[https://graph.microsoft.com/v1.0/subscriptions\nSdkVersion] : graph-java/v5.72.0\nSdkVersion : graph-java/v5.72.0\n[...]\n\n400 : \n[...]\n\n[Some information was truncated for brevity, enable debug logging for more details]

Sandbox%40company.com - I changed this intentionally, in the original response there is a different email.

But the error is only for particular emails, not for all. Other emails work fine.

Azure Event Hubs
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Mikhail 1 Reputation point
    2025-07-03T16:11:46.8366667+00:00

    The issue was related to the permissions of rooms and the service account that is used in the MS Graph API. However, the error message is confusing because it refers to invalid parameters and "ErrorItemNotFound." It would be better to receive a message about permission issues.

    0 comments No comments

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.