Sharepoint upload document using REST API with Jquery.

New Contributor

Hello experts, 


I have used below link code for uploading documents on sharepoint,  

but I am getting error when I upload any document,


{"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":{"lang":"en-US","value":"Access denied. You do not have permission to perform this action or access this resource."}}}


please help me out of this issue.


Thanks in advance

4 Replies
Which example you tried from the link?

@Sudharsan K I have create HTML web resource on CRM form and I have added <input type="file"> and on click of button I am calling function from code. But getting error.

The example shown in the below link explains the use of SharePoint server and SharePoint online and then to communicate using REST API. From CRM I need to check how to access the SharePoint repositories. May I know which CRM version you are using, is it On-Prem or Online?

@Sudharsan K I am working with MS D365 CRM online v9.1