I'm developing an add-in part (app part) for SharePoint in which I would like to do some CRUD operations. I've already added FullControl permission to SiteCollection in the manifest.
So far I've been able to successfully read list data using oData but I'm getting 403 (Access denied. You do not have permission to perform this action or access this resource.) while trying to post any changes.
Also, I'm getting the same response code when trying to get current user info by using:
$(document).ready(function () {
var search = query.parse()
$.ajax({
url: search.SPAppWebUrl + '/_api/contextinfo',
method: 'POST',
headers: { 'Accept': 'application/json; odata=verbose' }
}).done(function (data) {
var requestDigest = data.d.GetContextWebInformation.FormDigestValue
$.ajax({
url: search.SPHostUrl + "/_api/SP.UserProfiles.PeopleManager/GetMyProperties?$select=PictureUrl,DisplayName,Email",
method: "GET",
headers: {
'Accept': 'application/json; odata=verbose'
},
complete: function () {
console.log(arguments)
}
})
})
})
Is it even possible to it from inside app web? Am I missing something?