Email

var client = new RestClient("https://api.messageflow.com/v2.1/email?offset=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&smtpAccount=SOME_STRING_VALUE&messageId=SOME_STRING_VALUE&to=SOME_STRING_VALUE");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "REPLACE_KEY_VALUE");
IRestResponse response = client.Execute(request);
var client = new RestClient("https://api.messageflow.com/v2.1/email");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "REPLACE_KEY_VALUE");
request.AddParameter("application/json", "{\"subject\":\"Test email subject\",\"smtpAccount\":\"1.test.smtp\",\"tags\":[\"test-tag\"],\"content\":{\"html\":\"<h1>Hello world</h1>\",\"text\":\"Hello world\",\"templateId\":\"as2sCwq\"},\"bcc\":[{\"email\":\"string\",\"name\":\"string\"}],\"cc\":[{\"email\":\"string\",\"name\":\"string\"}],\"from\":{\"email\":\"string\",\"name\":\"string\"},\"replyTo\":{\"email\":\"string\",\"name\":\"string\"},\"headers\":{\"X-TEST-HEADER\":\"val\"},\"to\":[{\"email\":\"test@domena.pl\",\"name\":\"Test sender\",\"messageId\":\"test0001@domena.pl\",\"vars\":{\"test-var\":\"var-value\"}}],\"attachments\":[{\"fileName\":\"report.txt\",\"fileMime\":\"text/plain\",\"fileContent\":\"c29tZSBmaWxlIGNvbnRlbnQ=\"}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

Last updated