Skip to content

com.microsoft.graph.models.odataerrors.ODataError exception when trying to create Subscription #2421

@loudbyte

Description

@loudbyte

Describe the bug

In our java springboot app we use the following dependency: https://mvnrepository.com/artifact/com.microsoft.graph/microsoft-graph/5.72.0 (also checked on https://mvnrepository.com/artifact/com.microsoft.graph/microsoft-graph/6.42.1)

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('Room_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]

Room_Sandbox%40company.com - I changed this here 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.

We've tried to update to the newest dependencies related to this api but till getting the same error.

Stack trace:

com.microsoft.graph.models.odataerrors.ODataError: Operation: Create; Exception: [Status Code: BadRequest; Reason: The value 'https://outlook.office365.com/api/v2.0/Users('Room_Sandbox%40company.com')/Events' of parameter 'Resource' is invalid.] at com.microsoft.graph.models.odataerrors.ODataError.createFromDiscriminatorValue(ODataError.java:36) at com.microsoft.kiota.serialization.JsonParseNode.getObjectValue(JsonParseNode.java:212) at com.microsoft.kiota.http.OkHttpRequestAdapter.lambda$throwIfFailedResponse$0(OkHttpRequestAdapter.java:704) at com.microsoft.kiota.ApiExceptionBuilder.<init>(ApiExceptionBuilder.java:26) at com.microsoft.kiota.http.OkHttpRequestAdapter.throwIfFailedResponse(OkHttpRequestAdapter.java:703) at com.microsoft.kiota.http.OkHttpRequestAdapter.send(OkHttpRequestAdapter.java:307) at com.microsoft.graph.subscriptions.SubscriptionsRequestBuilder.post(SubscriptionsRequestBuilder.java:100) at com.microsoft.graph.subscriptions.SubscriptionsRequestBuilder.post(SubscriptionsRequestBuilder.java:84)

Expected behavior

The subscription should be created without errors.

How to reproduce

Try to create subscription for meeting room

SDK Version

6.42.1

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:waiting-for-triageAn issue that is yet to be reviewed or assignedtype:bugA broken experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions