I am trying to get parent site calendar list data from SharePoint app page.
I have used one function for getting data. THe function name is GetParentSiteListData()
. I can call this function when loading mainController
in Angularjs
s.
Code is,
function GetParentSiteListData() {
var getParentListurl = "https://sharepointsite.sharepoint.com/sites/mysitename" + "/_api/web/lists/getbytitle('projectCalendar')/items?$select = Id, Title";
return $.ajax({
url: getParentListurl,
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
success: function (data) {
console.log("GetParentSiteListData ", data);
},
error: function (data) {
console.log("GetParentSiteListData Error ", JSON.stringify(data));
}
});
}
After loading GetParentSiteListData()
function, I am getting error message like,
"GetParentSiteListData Error
{
"readyState":4,
"responseText":"{\"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.\"}}}",
"status":403,
"statusText":"Forbidden"
}"
What can I do to get parent site list items to display in SharePoint app page?