Hi Kanwal Singh,
Thanks for reaching out to Microsoft!
I tried to reproduce the issue on my end and received a success response.
Please ensure your access token is valid and hasn't expired. Also, ensure the scopes in your token match the required permissions. Files.ReadWrite
should be sufficient for delegated permissions, but sometimes Sites.ReadWrite.All
might be needed and consented in the Azure portal.
If you are using Application permissions "Files.ReadWrite.All
" is required.
Decode the Token by using jwt.io, scp (scope) or roles: Should include the permissions your app needs, like "Files.ReadWrite.All
".
Hope this helps!
If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.