0
votes

I have an Office365 Web API to fetch mail from the following URL:

https://graph.microsoft.com/v1.0/me

I have created a subscription for getting notifications from the graph service. However, I can not set the expiration time for the subscription to more than 4230 minutes. While I searched in Microsoft website I got this default time. While I add more than 4230 minutes in the request to the Graph I get BadRequest error code.

Following is the request code:

Subscription subscription = new Subscription
{
    Resource = "me/mailFolders('Inbox')/messages",
    ChangeType = "created",
    NotificationUrl = ConfigurationManager.AppSettings["ida:NotificationUrl"],
    ClientState = Guid.NewGuid().ToString(), ExpirationDateTime = DateTime.UtcNow + 
                  new TimeSpan(0, 0, 11115, 0) // shorter duration useful for testing
};

Can anyone suggest me how to override the default time in the graph API?

1

1 Answers

1
votes

If you read the documentation, it tells you that the maximum expiration time is 4230 minutes

enter image description here