I'm trying to subscribe to OneDrive changes by sending a POST request to .0/subscriptions
in Spring with the following body:
{
"changeType": "updated",
"notificationUrl": "%s",
"resource": "/me/drive/root",
"expirationDateTime": "%s"
}
The problem is this sometimes returns a 401 unauthorized
error, and at other times works fine. So I can't really tell what could be wrong given that this works sometimes or throws an error randomly.
All my other API calls to list folders for example work fine with the same access token.
Has anyone faced a similar issue ?
Tried to refresh the access token each time I call the subscription endpoint, and also tested my notification URL using Postman to check that it's working as intended.