I'm trying to use the Reputation.js setLike method in a sharepoint hosted app/add-in which in theory is possible with the following snippet:
var ctx = new SP.ClientContext(webAppUrl);
Microsoft.Office.Server.ReputationModel.Reputation.setLike(ctx, "73eaae6a-9839-43bd-b509-ddc64989536a", "40", true);
ctx.executeQueryAsync(
//Success
Function.createDelegate(this, function () {
alert("Everything OK!");
}),
//Failed to execute, log this in console.
Function.createDelegate(this, function (e, args) {
alert("Failed! " + args.get_message());
})
);
As a result I get an alert with "The assembly Microsoft.SharePoint.Portal.Proxy, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c does not support app authentication."
Is it not possible to Like/Unlike through JSOM? Any pointers or other ways to do this in an app?