Unable to upload .XSN file using createUploadSession API. It returns 403 - Access Denied response

Ayush Jain 20 Reputation points

I am trying to upload a .xsn file to OneDrive using Graph API with resumable upload [/me/drive/root:/{item-path}:/createUploadSession]

But the createUploadSession API returns a 403 response with this Json response:
{'error': {'code': 'accessDenied', 'message': 'Access denied',

Can anyone tell me how to make it work?

P.S. -> I tried another .txt file with same code, and it got uploaded successfully, so its not a token issue

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,040 questions
{count} votes