I have been working on sharepoint recently. I have created a site collection for my testing purpose, in which I have to upload documents in a library. I used REST API and CSOM to upload the documents and it's working fine.

Now the same code I have been using on another site collection which one of collegue have created, where I have full control, but every time I tried to upload the document I am getting an error of "Access Denied. You do not have permission to perform this action." I tried to use POSTMAN to upload the document by passing Bearer access token, still same 403 error. I used CSOM code to check if I can access the site or not, but I can access the site and print its list names or library or title name and all. Can anyone please help me for this scenario, I'm all lost.

  • Can you share the code? – Ankit Katiyar Jun 24 '19 at 4:21
  • I have checked the code thrice for different site collection. It's working fine. I am specifically getting error code - 2147024891. – user11099777 Jun 24 '19 at 5:45
  • I can share for your reference if you want. – user11099777 Jun 24 '19 at 5:45
  • POST /_api/web/GetFolderByServerRelativeUrl('/sites/<SiteName>/<Library Name>')/files/add(overwrite=true,url='test.txt') HTTP/1.1 Host: SITE.sharepoint.com Authorization: Bearer TOKEN Accept: application/json;odata=verbose – user11099777 Jun 24 '19 at 7:05
  • Try to manually upload the document in the library just to check if there is any unique permissions in it. And are you including the Request Digest Value in your header "X-RequestDigest": $("#__REQUESTDIGEST").val() ?? – Ankit Katiyar Jun 24 '19 at 8:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.