public GetMergeVarsResult GetMergeVars(string apiKey, IEnumerable <string> listIds) { GetMergeVarsResult result = null; var parameters = new Dictionary <string, object>(); parameters.Add("apikey", apiKey); parameters.Add("id", listIds); RestResponse response = RestClient.Post("[VER]/lists/merge-vars.[FORMAT]", parameters.ToJSON()); if (response.HasError) { if (response.HasData) { ErrorResponseInfo e = response.Get <ErrorResponseInfo>(); throw new Exception(string.Format("{0} ({1}) {2}", e.name, e.code, e.error)); } throw new Exception(response.Message); } if (response.HasData) { result = response.Get <GetMergeVarsResult>(); } return(result); }
private void button4_Click(object sender, EventArgs e) { GetMergeVarsResult result = _api.GetMergeVars(new string[] { "ed84e944ac" }); }