public static Result DeleteListItem(string listName, string id) { string SiteUrl = Convert.ToString(WebConfigurationManager.AppSettings["SiteUrl"]); string accessToken = (HttpContext.Current.Request.Headers["Authorization"]).Split(' ')[1]; string errorLogPath = Convert.ToString(WebConfigurationManager.AppSettings["ErrorLogPath"]); Result res = new Result(); try { RestAPI.DeleteListItems(SiteUrl, errorLogPath, accessToken, Lists.ListURLs.RestUrlList(listName), Lists.ListURLs.RestUrlListItemWithQuery(listName, false), id); res.StatusCode = StatusCode.Success; res.Message = Messages.MsgSuccessDelete; return(res); } catch (Exception ex) { string guid = RestAPI.WriteException(ex, MethodBase.GetCurrentMethod().Name, MethodBase.GetCurrentMethod().DeclaringType.Name); throw new Exception(string.Format(Lists.Messages.MsgExceptionOccured, guid)); } }