0

I need help to finish my code. I have an application on the homepage of PWA and must seek project site data of certain projects. My problem is that I can not access the data because it always returns 403 Forbidden.

The code I'm using is as follows:

function getProjects(){
    var siteurl = 'https:/contoso.sharepoint.com/sites/pwa/' + projectSiteName + '/_api/web/lists/getbytitle(' + listName + ')/Items'; 
    $http({
        method: 'GET',
        headers: { "Accept": "application/json; odata=verbose" },
        url: siteurl,
    }).then(function successCallback(response) {
        $scope.listaProjetos = response.data.d.results;
    }, function errorCallback(response) {
        console.log(response);
    });
}

1 Answers1

0

Are you missing a forward slash in your URL?