I have an access for subsite in sharepoint online 2013 site. I am able to access and modify the lists and objects in that.

I want to access lists in subsite through the rest API.

for that I followed the below blog, http://www.ktskumar.com/2017/01/access-sharepoint-online-using-postman/

but I am facing the below issue, {"error_description":"Exception of type 'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException' was thrown."} status: 401 Unauthorized.

Could any one please help me.

my question is,

  1. Can we able to access the sub site through rest api, if we don't have permission for parent site.

  2. if we able to access, how to provide app access xml for subsite. I used below.

 <AppPermissionRequests AllowAppOnlyPolicy="true">  
      <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" />

let me know if anything I missed.

| improve this question | | | | |

What permissions you currently provided in xml is enough to access the site. Because you are providing AppOnly Context permissions. It does not depend on users permission. User can access the site elements with REST API with App permissions. For reference click here.

Hope this helps to you.

| improve this answer | | | | |
  • thanks for the reply.. but it throws unauthorized error. so what I need to update. to understand the above, I have access for sub site not for parent site. in xml I defined the parent site. how can I define the subsite (I didn't found this in your referenced link) – srinu Mar 13 '18 at 11:59
  • Can you please provide the code to know how you building the context. – Nagababu Annamdasu Mar 13 '18 at 12:11
  • I followed the code same as like this blog, ktskumar.com/2017/01/access-sharepoint-online-using-postman I am accessing through postman. are we need any permissions for the parent site to access the sub site lists and objects – srinu Mar 13 '18 at 12:28
  • I tried with all this xml lines <AppPermissionRequests AllowAppOnlyPolicy="true"> <AppPermissionRequest Scope="sharepoint/content/sitecollection" Right="FullControl" /> <AppPermissionRequest Scope="sharepoint/content/sitecollection/web" Right="FullControl" /> <AppPermissionRequest Scope="sharepoint/sites/site" Right="FullControl" /> <AppPermissionRequest Scope="sharepoint/sites/site/web" Right="FullControl" /> <AppPermissionRequest Scope="sharepoint/sites/site/lists" Right="FullControl" /> </AppPermissionRequests> – srinu Mar 13 '18 at 12:30

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.