0

I'm trying to access the SharePoint REST service and trying to upload objects using the curl command. I have followed the steps from this blog.

I was able to get pass through steps until getting the access token. After that when I tried to access the REST point https://<domain_name>.sharepoint.com/Internal_Documents/_api/web/. I'm getting access denied error with HTTP status code 403 Forbidden.

Response 
{
    "odata.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."
        }
    }
}
  • Check if you have at least read permission on that site – Akshay Randive Sep 21 '20 at 4:43
  • I understand that you are referring to this one. I have given this value as full control. <AppPermissionRequests AllowAppOnlyPolicy="true"> <AppPermissionRequest Scope="sharepoint/content/sitecollection/web" Right="FullControl" /> </AppPermissionRequests> Please point me. If there is any method to test whether access is there or not? – Ramkumar R Sep 21 '20 at 5:47
  • there web where you are trying to use API is it a subsite? If yes add read permission to SiteCollection scope sharepoint/content/sitecollection – Akshay Randive Sep 21 '20 at 7:33
  • No, I am not trying to access any subsites. Trying to access(Read/Write) only the main site contents. – Ramkumar R Sep 21 '20 at 7:55
  • Do I need to provide any user credentials with the request? Or will it be based on the registered app's authorization scope? – Ramkumar R Sep 21 '20 at 9:49
-1

According to the error message, the required resources are not properly authorized. Check whether your authorized web and the web requested by your rest are the same.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.