Client state is not updated when we are calling the update subscription Graph API.

Sanket Chavan 0 Reputation points
2024-04-23T19:18:58.6166667+00:00

We are using this subscription API to update the subscription details where the expiration date and notification URL are getting updated but not the client state.

https://graph.microsoft.com/v1.0/subscriptions/{subscription_id}

We used the following Get Subscription API to get the subscription details. But we are getting the client state value as null even after updating it.

Because of this, when we get the incoming email on the notification URL, we are getting a null value for the client state.

https://graph.microsoft.com/v1.0/subscriptions/{subscription_id}

When we delete this subscription and create a new subscription, then the client state value is properly set.

We would like to know what could be the problem while updating the client state.

Following is the sample request body used for updating the client's state

{
    "expirationDateTime": "2024-04-29T18:28:47.512Z",
    "notificationUrl": "some.url.com",
    "clientState": "{some_secret_value}"
}

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

1 answer

Sort by: Most helpful
  1. Azizkhon Ishankhonov 195 Reputation points
    2024-04-25T10:02:14.59+00:00

    Hi Sanket

    According to documentation, there are a few properties that might be updated for existing subscriptions and client state field not in the list: https://learn.microsoft.com/en-us/graph/api/subscription-update?view=graph-rest-1.0&tabs=http#request-body

    If it is helpful, please accept the answer

    0 comments No comments