Issue with renew operation in Microsoft Graph Webhook Java SDK

yusvanth Subramanian 5 Reputation points
2025-01-23T13:18:15.99+00:00

Official Webhook documentation says that in the patch request only expirationDateTime is required to be set in subscription object to renew the subscription.

long with ExpirationDateTime, NotificationUrl is also required in new subscription object which is used in patch request to renew a subscription. When a patch request is made without a notificationUrl in subscription object, the patch request gets failed with message :

Subscription must contain either the 'expirationDateTime' or 'notificationUrl' property and its value.

Although the message states that the subscription must include either 'expirationDateTime' or 'notificationUrl', the patch request succeeds only when both fields are populated in the subscription object. This issue occurs when using the Java SDK for the request, but not when using curl or Postman.

Im not sure whether this issue exists in other languages. If this is not a bug in SDK side, it would be helpful if the solution to this issue is addressed in the documentation.

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

1 answer

Sort by: Most helpful
  1. Saranya Madhu-MSFT 1,340 Reputation points Microsoft Vendor
    2025-01-29T08:24:38.6666667+00:00

    Hi @yusvanth Subramanian,

    Thanks for reaching out to Microsoft!

    As mentioned in the documentation,

    The following table specifies the properties that can be updated.

    User's image The request body must include either expirationDateTime or notificationUrl for updating subscription.

    Since it works fine with curl or postman, we suggest you approach GitHub repository for the Java SDK. This will bring it to the attention of the maintainers who can investigate and potentially fix the issue.

    Microsoft Graph - Java SDK

    As a temporary solution, ensure that both expirationDateTime and notificationUrl are included in your patch requests.

    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.