// DELETE api/<controller>/5 public void Delete(int id) { var accessTokenInfo = WebAPIHelper.GetAccessTokenInfo(ControllerContext); using (var appClientContext = accessTokenInfo.CreateAppOnlyClientContextForSPHost()) { Utilities.DeleteJsLink(appClientContext); } }
public void Post([FromBody] string value) { var accessTokenInfo = WebAPIHelper.GetAccessTokenInfo(ControllerContext); using (var appClientContext = accessTokenInfo.CreateAppOnlyClientContextForSPHost()) { Utilities.AddCssAndScripts(appClientContext, this.Request); Utilities.AddWebParts(appClientContext); } }
public string Get(int id) { var accessTokenInfo = WebAPIHelper.GetAccessTokenInfo(ControllerContext); var ctx = accessTokenInfo.CreateUserClientContextForSPHost(); ctx.Load(ctx.Web, w => w.Title); ctx.ExecuteQuery(); return(ctx.Web.Title); //return "value"; }