I'm trying to read the items from a list via REST within a SharePoint-hosted app, but in response I get 403 - Forbidden so I wonder which permissions do i need, I thought that web - read in the appManifest would be enough but it seems like it doesn´t, or maybe i missing something else, the endpoint i'm using is http://site url/_api/web/lists/GetByTitle(‘Test')/items, by the way I'm using angular 2 http module for this, like so:

 private url= "https://URL/_api/web/lists/GetByTitle('test')/items";  // URL to web API
          getItems(): Observable<any[]> {
            let headers = new Headers();
            headers.append('accept', 'application/json;odata=verbose');

            return this.http.get(this.url, {headers: headers})

         private extractData(res: Response) {
           let body = res.json();
           return body || { };

So if somebody knows what's happening and how can I get the data it will be great

Thanks in advance

  • Comments are not for extended discussion; this conversation has been moved to chat. Commented Aug 17, 2016 at 20:37

1 Answer 1


In order to access host data from a SharePoint-hosted add-in, you must use the AppContextSite endpoint, or the cross-domain library, RequestExecutor. The former can be done by changing your url to the following:

appUrl + "/_api/SP.AppContextSite(@target)/web/lists/GetByTitle('test')/items?@target='" + encodeURIComponent(hostUrl) + "'"

More details, including how to use the cross-domain library, can be found here.

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.