0

I am developing sharepoint hosted app and i am using rest api by angular.js or jquery.So I dont accept the app list give an error 403 Forbidden

Rest call looks like

$http({
        method: "GET",
        url: appweburl + "/_api/SP.AppContextSite(@target)/web/lists/getbytitle('SurveyManager')/items?@target='" + hostweburl + "'",
        headers: {
            "accept": "application/json;odata=verbose",
            "content-type": "application/json;odata=verbose",
            "X-RequestDigest": angular.element(document.querySelector('#__REQUESTDIGEST')).val()
        }
    });

Response is

{
    "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."
         }
    }
}
acebisli
  • 106
  • 2
  • 9

1 Answers1

0

You need to pass an access token to authenticate the request.

Graham
  • 336
  • 1
  • 13