Mail

var client = new RestClient("https://api.messageflow.com/v2.1/campaign/mail");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "REPLACE_KEY_VALUE");
request.AddParameter("application/json", "{\"campaignId\":\"first-campaign-id\",\"name\":\"firstCampaign\",\"description\":\"My first campaign\",\"subject\":\"Hello world\",\"fromName\":\"John Doe\",\"fromAddress\":\"john.doe@example.pl\",\"replyTo\":\"john.doe@example.pl\",\"htmlFromWebSiteUrl\":\"string\",\"htmlContent\":\"<h1> hello there</h1>\",\"textContent\":\"hello there!\",\"groupId\":\"test-group-id\",\"trackLinks\":true,\"googleAnalytics\":true,\"scheduleTime\":\"2020-09-10 10:15:00\",\"state\":\"editable\",\"testAddresses\":[\"john.doe@example.pl\"],\"confirmationAddresses\":[\"john.doe@example.pl\"]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var client = new RestClient("https://api.messageflow.com/v2.1/campaign/mail/%7BcampaignId%7D");
var request = new RestRequest(Method.PATCH);
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "REPLACE_KEY_VALUE");
request.AddParameter("application/json", "{\"state\":\"sendable\",\"scheduleTime\":\"2020-09-10 10:15:00\",\"testAddresses\":[\"john.doe@example.pl\"]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

Last updated