Hi Sruthi Kurup, Thanks for reaching out!
Could you please try use the following subscription object while creating the new subscription.
DateTimeOffset expirationDateTime = DateTimeOffset.UtcNow.AddDays(2);
var Subscription = new Subscription
{
ChangeType = "created",
NotificationUrl = $"{notificationHost}/api/{endpoint where notification will come}/",
Resource = $"/users/{payload.UserId}//messages",
ExpirationDateTime = expirationDateTime,
ClientState = "my notification service",
};
var CreatedSubscription = await graphClient.Subscriptions.Request().AddAsync(Subscription);
Also, you need to renew this subscription every 2 days based upon what is the expiry time. Feel free to reply again in case you need more specific help.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment"