spring - Why is Graph MS API randomly returning 401 upon subscription creation? - Stack Overflow

admin2025-04-21  1

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.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745215450a290820.html

最新回复(0)