I need to query a list located inside a SharePoint hosted app, when located on host web, using JavaScript (REST preferably).
I control both app and host.

It's possible to communicate with an app part using window.addEventListener('message', m => ...), but I need to load the data from several SPWebs, and the app part can't be added to all pages.
SP.AppContextSite does not work, since host web does not have an app context.

1 Answer 1


You do not need to do anything special to access AppWeb resources from the HostWeb. The AppWeb is just a child site of the HostWeb so you can access it that way.

REST API accessing AppWeb

  • 1
    So simple I didn't even think about it. Thanks a bunch :D Note to reach the API I had to do this: /MyWeb/MyAppWeb/_api/Web/....
    – eirikb
    Feb 19, 2016 at 14:33
  • 1
    thank you for this comment! it's more descriptive then the answer itself :D
    – Serhiy
    Mar 6, 2016 at 15:20
  • The answer also shows the URL - it's in the URL bar in the browser. I kinda thought that would be obvious. May 1, 2016 at 21:54
  • @RobWindsor I think there is a slight difference, in your screenshot you call _api on the parent web, while I had to call _apion the app web (sub web). But yeah it's quite obvious
    – eirikb
    May 2, 2016 at 6:55
  • I didn't see that originally. If that's what you did you misunderstood my answer. Code running in the host web can access data stored in app web from the host web's REST API endpoint. The app webs are just children of the host web so you can access them using <host web url>/_api/Web/Webs collection. May 2, 2016 at 14:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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