Api reference MessageFlow
  • Welcome
  • Introduction
  • Authentication
  • REST clients samples
  • Long running actions - Retry-After header explained
  • Input compression
  • Using filters
  • Dynamic e-mail content
  • SMS Billing
  • Incoming webhooks
    • Steps to configure webhooks
    • Step 1: Identify the events to monitor
    • Step 2: Create a webhook endpoint
    • Step 3: Handle requests
    • Step 4: Test that your webhook
    • Step 4: Test your webhook
    • Step 5: Save your webhook configuration
  • External resources
  • Current Version
  • License
  • Groups
  • Contacts
  • Emails
  • Sms
  • Blacklist
  • Campaigns
  • Pushes
Powered by GitBook
On this page

Campaigns

PreviousBlacklistNextPushes

Email campaigns API allows you to send emails / smses to a specific group created through Create group method or through the panel.

Send email campaign

post

Use this method to send emails to a group of contacts created through endpoint Create group method.

Authorizations
Body
campaignIdstring · max: 64Optional

The unique ID of the campaign.

Example: first-campaign-idPattern: /^[a-zA-Z-_]+$/
namestring · max: 150Required

The name of the campaign.

Example: firstCampaign
descriptionstring · max: 500Optional

The description of the campaign.

Example: My first campaign
subjectstring · max: 500Required

The subject of the message in the campaign.

Example: Hello world
fromNamestring · max: 150Required

The name of the sender.

Example: John Doe
fromAddressstring · max: 500Required

The email address of the sender.

Example: john.doe@example.pl
replyTostring · max: 500Optional

The email address to reply to.

Example: john.doe@example.pl
htmlFromWebSiteUrlstringRequired

The URL of the website.

htmlContentstringRequired

The html of the message.

Example: <h1> hello there</h1>
textContentstringOptional

The text of the message.

Example: hello there!
groupIdstringRequired

The externalId of the group the message will be sent to. This ID can be found using List group method.

Example: test-group-id
trackLinksbooleanOptional

The URL shortener and tracker. Setting this property to ‘true’ will make the urls shorter and also urls will be tracked.

Example: true
googleAnalyticsbooleanOptional

The optional campaign tracking parameter provided by Google Analytics.

Example: true
scheduleTimestringOptional

The date the message will be set off. Be aware that if the campaign is going to be sent to many of recipients (thousands and more) the schedule date means then preparing all contacts firstly and then sending. For example, there is a campaign scheduled for 2020-01-01 10:00:00 so at 10 o'clock our system will start to collect all contacts from chosen group which can take sometimes more than an hour and then the messages will be sent to recipients.

Example: 2020-09-10 10:15:00Pattern: /^\d{4}-\d{2}-\d{2}\s*(?:\d{2}:\d{2}(?::\d{2})?)?$/
statestring · enumOptional

If set to 'editable' allows to prevent sending email campaign immediately after creation

Default: editableExample: editablePossible values:
testAddressesstring[] · min: 1Required

The email addresses to send the campaign to see if the message is ok.

Example: john.doe@example.pl
confirmationAddressesstring[] · min: 1Optional

The email addresses to send info about campaign end.

Example: john.doe@example.pl
Responses
200
Request was successfully processed
application/json
207
Some of request body items were not processed due to validation errors
application/json
401
Authorization data is invalid
application/json
404
Request was successfully processed but no results were returned
application/json
500
Request was not processed due to server error
application/json
post
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "{\"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\":\"\",\"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\"]}";

        try {
            using var client = new HttpClient{};
            using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.messageflow.com/v2.1/campaign/mail");

            request.Headers.Add("Authorization", "YourAuthorizationKey");
            request.Headers.Add("Application-Key", "YourApplicationKey");
            request.Content = new StringContent(requestBody, null, "application/json");

            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            string content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);

        } catch (HttpRequestException e) {
            Console.WriteLine("\n Exception Caught!\n Message :{0} ", e.Message);
        }
    }
}
{
  "meta": {
    "numberOfErrors": 0,
    "numberOfData": 1,
    "status": 200,
    "uniqId": "00d928f759"
  },
  "data": [
    {
      "externalId": "text"
    }
  ]
}

Get email campaign clicks

get

Use this method to get details of email clicks from a certain date range. Please remember clicks are stored for 90 days.

Authorizations
Path parameters
campaignIdstringRequired

Id of existing campaign

Query parameters
limitinteger · max: 1000Optional

The maximum number of items returned by request. Default ‘100’. Maximum ‘1000’.

Default: 100
offsetintegerOptional

The number of items omitted from the beginning of the list. Default ‘0’.

Default: 0
dateFromstringRequired

Start of the time range.

Example: 2025-01-01 00:00:00
dateTostringRequired

End of the time range.

Example: 2025-01-03 00:00:00
Responses
200
Request was successfully processed
application/json
401
Authorization data is invalid
application/json
404
Request was successfully processed but no results were returned
application/json
500
Request was not processed due to server error
application/json
get
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "";

        try {
            using var client = new HttpClient{};
            using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.messageflow.com/v2.1/campaign/email/{campaignId}/report/click?limit=100&offset=0&dateFrom=2025-01-01 00:00:00&dateTo=2025-01-03 00:00:00");

            request.Headers.Add("Authorization", "YourAuthorizationKey");
            request.Headers.Add("Application-Key", "YourApplicationKey");
            request.Content = new StringContent(requestBody, null, "application/json");

            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            string content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);

        } catch (HttpRequestException e) {
            Console.WriteLine("\n Exception Caught!\n Message :{0} ", e.Message);
        }
    }
}
{
  "meta": {
    "numberOfErrors": 0,
    "numberOfData": 1,
    "status": 200,
    "uniqId": "00d928f759"
  },
  "data": [
    {
      "link": "text",
      "clickTime": "text",
      "email": "text",
      "count": 1,
      "campaignId": "text"
    }
  ]
}

List email campaigns

get

Use this method to list all campaigns and its details from a certain time range.

Authorizations
Query parameters
limitinteger · max: 1000Optional

The maximum number of items returned by request. Default ‘100’. Maximum ‘1000’.

Default: 100
offsetintegerOptional

The number of items omitted from the beginning of the list. Default ‘0’.

Default: 0
dateFromstringRequired

Start of the time range.

Example: 2025-01-01 00:00:00
dateTostringRequired

End of the time range.

Example: 2025-01-03 00:00:00
Responses
200
Request was successfully processed
application/json
401
Authorization data is invalid
application/json
404
Request was successfully processed but no results were returned
application/json
500
Request was not processed due to server error
application/json
get
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "";

        try {
            using var client = new HttpClient{};
            using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.messageflow.com/v2.1/campaign/email?limit=100&offset=0&dateFrom=2025-01-01 00:00:00&dateTo=2025-01-03 00:00:00");

            request.Headers.Add("Authorization", "YourAuthorizationKey");
            request.Headers.Add("Application-Key", "YourApplicationKey");
            request.Content = new StringContent(requestBody, null, "application/json");

            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            string content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);

        } catch (HttpRequestException e) {
            Console.WriteLine("\n Exception Caught!\n Message :{0} ", e.Message);
        }
    }
}
{
  "meta": {
    "numberOfErrors": 0,
    "numberOfData": 1,
    "status": 200,
    "uniqId": "00d928f759"
  },
  "data": [
    {
      "externalId": "text",
      "name": "text",
      "description": "text",
      "subject": "text",
      "fromName": "text",
      "fromAddress": "text",
      "replyTo": "text",
      "groupId": "text",
      "scheduleTime": "text"
    }
  ]
}

Get email campaign opens

get

Use this method to get details of email opens from a certain date range. Please remember opens are stored for 90 days.

Authorizations
Path parameters
campaignIdstringRequired

Id of existing campaign

Query parameters
limitinteger · max: 1000Optional

The maximum number of items returned by request. Default ‘100’. Maximum ‘1000’.

Default: 100
offsetintegerOptional

The number of items omitted from the beginning of the list. Default ‘0’.

Default: 0
dateFromstringRequired

Start of the time range.

Example: 2025-01-01 00:00:00
dateTostringRequired

End of the time range.

Example: 2025-01-03 00:00:00
Responses
200
Request was successfully processed
application/json
401
Authorization data is invalid
application/json
404
Request was successfully processed but no results were returned
application/json
500
Request was not processed due to server error
application/json
get
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "";

        try {
            using var client = new HttpClient{};
            using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.messageflow.com/v2.1/campaign/email/{campaignId}/report/open?limit=100&offset=0&dateFrom=2025-01-01 00:00:00&dateTo=2025-01-03 00:00:00");

            request.Headers.Add("Authorization", "YourAuthorizationKey");
            request.Headers.Add("Application-Key", "YourApplicationKey");
            request.Content = new StringContent(requestBody, null, "application/json");

            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            string content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);

        } catch (HttpRequestException e) {
            Console.WriteLine("\n Exception Caught!\n Message :{0} ", e.Message);
        }
    }
}
{
  "meta": {
    "numberOfErrors": 0,
    "numberOfData": 1,
    "status": 200,
    "uniqId": "00d928f759"
  },
  "data": [
    {
      "readReportTime": "text",
      "email": "text",
      "campaignId": "text"
    }
  ]
}

List email campaign recipients

get

Use this method to get all recipients from the email campaign. You can filter recipients who have got bounce states as well.

Authorizations
Query parameters
campaignIdstringOptional

Search with campaign external ID. The search by campaignId does not work in conjunction with the date search. These two search options are incompatible and must be used separately.

Example: 6F8EB428-0917-4DE7-BE1D-ACCD7432A4B8
bouncesOnlyboolOptional

If true then action will return only bounced recipients

dateTostringOptional

Search with date (UTC timezone). The search by date does not work in conjunction with the search by campaignId. These two search options are incompatible and must be used separately.

Example: 2025-01-03 00:00:00Pattern: /(^\d{4}-\d{2}-\d{2})\s(\d{2}:\d{2}:\d{2})$/
dateFromstringOptional

Search with date (UTC timezone). The search by date does not work in conjunction with the search by campaignId. These two search options are incompatible and must be used separately.

Example: 2025-01-01 00:00:00Pattern: /(^\d{4}-\d{2}-\d{2})\s(\d{2}:\d{2}:\d{2})$/
limitinteger · max: 1000Optional

The maximum number of items returned by request. Default ‘100’. Maximum ‘1000’.

Default: 100
offsetintegerOptional

The number of items omitted from the beginning of the list. Default ‘0’.

Default: 0
Responses
200
Request was successfully processed
application/json
401
Authorization data is invalid
application/json
404
Request was successfully processed but no results were returned
application/json
500
Request was not processed due to server error
application/json
get
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "";

        try {
            using var client = new HttpClient{};
            using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.messageflow.com/v2.1/campaign/email/report/recipient?campaignId=6F8EB428-0917-4DE7-BE1D-ACCD7432A4B8&bouncesOnly=<bool>&dateTo=2025-01-03 00:00:00&dateFrom=2025-01-01 00:00:00&limit=100&offset=0");

            request.Headers.Add("Authorization", "YourAuthorizationKey");
            request.Headers.Add("Application-Key", "YourApplicationKey");
            request.Content = new StringContent(requestBody, null, "application/json");

            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            string content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);

        } catch (HttpRequestException e) {
            Console.WriteLine("\n Exception Caught!\n Message :{0} ", e.Message);
        }
    }
}
{
  "meta": {
    "numberOfErrors": 0,
    "numberOfData": 1,
    "status": 200,
    "uniqId": "00d928f759"
  },
  "data": [
    {
      "code": 1,
      "email": "text"
    }
  ]
}

Get email campaign unsubscribe report

get

Use this method to get date of a click on unsubscribe link and the email address of the unsubscribed.

Authorizations
Path parameters
campaignIdstringRequired

Id of existing campaign

Query parameters
limitinteger · max: 1000Optional

The maximum number of items returned by request. Default ‘100’. Maximum ‘1000’.

Default: 100
offsetintegerOptional

The number of items omitted from the beginning of the list. Default ‘0’.

Default: 0
dateFromstringRequired

Start of the time range.

Example: 2025-01-01 00:00:00
dateTostringRequired

End of the time range.

Example: 2025-01-03 00:00:00
Responses
200
Request was successfully processed
application/json
401
Authorization data is invalid
application/json
404
Request was successfully processed but no results were returned
application/json
500
Request was not processed due to server error
application/json
get
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "";

        try {
            using var client = new HttpClient{};
            using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.messageflow.com/v2.1/campaign/email/{campaignId}/report/unsubscribe?limit=100&offset=0&dateFrom=2025-01-01 00:00:00&dateTo=2025-01-03 00:00:00");

            request.Headers.Add("Authorization", "YourAuthorizationKey");
            request.Headers.Add("Application-Key", "YourApplicationKey");
            request.Content = new StringContent(requestBody, null, "application/json");

            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            string content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);

        } catch (HttpRequestException e) {
            Console.WriteLine("\n Exception Caught!\n Message :{0} ", e.Message);
        }
    }
}
{
  "meta": {
    "numberOfErrors": 0,
    "numberOfData": 1,
    "status": 200,
    "uniqId": "00d928f759"
  },
  "data": [
    {
      "externalId": "text",
      "name": "text",
      "description": "text",
      "subject": "text",
      "fromName": "text",
      "fromAddress": "text",
      "replyTo": "text",
      "groupId": "text",
      "scheduleTime": "text"
    }
  ]
}

List push campaigns

get

Use this method to list all campaigns and its details from a certain time range.

Authorizations
Query parameters
limitinteger · max: 1000Optional

The maximum number of items returned by request. Default ‘100’. Maximum ‘1000’.

Default: 100
offsetintegerOptional

The number of items omitted from the beginning of the list. Default ‘0’.

Default: 0
dateFromstringRequired

Start of the time range.

Example: 2025-01-01 00:00:00
dateTostringRequired

End of the time range.

Example: 2025-01-03 00:00:00
Responses
200
Request was successfully processed
application/json
401
Authorization data is invalid
application/json
404
Request was successfully processed but no results were returned
application/json
500
Request was not processed due to server error
application/json
get
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "";

        try {
            using var client = new HttpClient{};
            using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.messageflow.com/v2.1/campaign/push?limit=100&offset=0&dateFrom=2025-01-01 00:00:00&dateTo=2025-01-03 00:00:00");

            request.Headers.Add("Authorization", "YourAuthorizationKey");
            request.Headers.Add("Application-Key", "YourApplicationKey");
            request.Content = new StringContent(requestBody, null, "application/json");

            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            string content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);

        } catch (HttpRequestException e) {
            Console.WriteLine("\n Exception Caught!\n Message :{0} ", e.Message);
        }
    }
}
{
  "meta": {
    "numberOfErrors": 0,
    "numberOfData": 1,
    "status": 200,
    "uniqId": "00d928f759"
  },
  "data": [
    {
      "name": "text",
      "description": "text",
      "externalId": "text",
      "scheduleTime": "text",
      "number": 1,
      "groupId": "text",
      "title": "text",
      "body": "text",
      "image": "text",
      "silent": true,
      "sound": "text",
      "ttl": 1,
      "iosSubtitle": "text",
      "androidLockscreenVisibility": "text",
      "androidLargeIcon": "/relative-icon-file-path",
      "androidSmallIcon": "/relative-icon-file-path",
      "apps": [
        "text"
      ],
      "externalData": {
        "key1": "value1",
        "kay2": "value2"
      },
      "actions": [
        {
          "mainAction": "true",
          "type": "BROWSER",
          "url": "www.emaillab.io",
          "actionId": "123456",
          "text": "Text",
          "icon": "\\/ikona\\/pl"
        }
      ]
    }
  ]
}

Change email campaign state

patch

Use this method if you want to change the status of an already prepared or launched campaign. You can only start or cancel campaign. Each campaign gets statuses like editing, redytosend, sending and sent. If you cancel campaign that have sending state it will get sent state.

Authorizations
Path parameters
campaignIdstringRequired

Id of existing campaign

Body
statestring · enumOptionalExample: sendablePossible values:
scheduleTimestringOptional

The date the message will be set off. Be aware that if the campaign is going to be sent to many of recipients (thousands and more) the schedule date means then preparing all contacts firstly and then sending. For example, there is a campaign scheduled for 2020-01-01 10:00:00 so at 10 o'clock our system will start to collect all contacts from chosen group which can take sometimes more than an hour and then the messages will be sent to recipients.

Example: 2020-09-10 10:15:00Pattern: /^\d{4}-\d{2}-\d{2}\s*(?:\d{2}:\d{2}(?::\d{2})?)?$/
testAddressesstring[] · min: 1Optional

The email addresses to send the campaign to see if the message is ok.

Example: john.doe@example.pl
Responses
200
Request was successfully processed
application/json
401
Authorization data is invalid
application/json
404
Request was successfully processed but no results were returned
application/json
500
Request was not processed due to server error
application/json
patch
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "{\"state\":\"sendable\",\"scheduleTime\":\"2020-09-10 10:15:00\",\"testAddresses\":[\"john.doe@example.pl\"]}";

        try {
            using var client = new HttpClient{};
            using var request = new HttpRequestMessage(HttpMethod.Patch, "https://api.messageflow.com/v2.1/campaign/mail/{campaignId}");

            request.Headers.Add("Authorization", "YourAuthorizationKey");
            request.Headers.Add("Application-Key", "YourApplicationKey");
            request.Content = new StringContent(requestBody, null, "application/json");

            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            string content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);

        } catch (HttpRequestException e) {
            Console.WriteLine("\n Exception Caught!\n Message :{0} ", e.Message);
        }
    }
}
{
  "meta": {
    "numberOfErrors": 0,
    "numberOfData": 1,
    "status": 200,
    "uniqId": "00d928f759"
  }
}

Get single email campaign

get

Use this method to get all details of certain email campaign such as subject, fromAddress, groupId, scheduleTime and more.

Authorizations
Path parameters
campaignIdstringRequired

Id of existing campaign

Responses
200
Request was successfully processed
application/json
401
Authorization data is invalid
application/json
404
Request was successfully processed but no results were returned
application/json
500
Request was not processed due to server error
application/json
get
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "";

        try {
            using var client = new HttpClient{};
            using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.messageflow.com/v2.1/campaign/email/{campaignId}");

            request.Headers.Add("Authorization", "YourAuthorizationKey");
            request.Headers.Add("Application-Key", "YourApplicationKey");
            request.Content = new StringContent(requestBody, null, "application/json");

            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            string content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);

        } catch (HttpRequestException e) {
            Console.WriteLine("\n Exception Caught!\n Message :{0} ", e.Message);
        }
    }
}
{
  "meta": {
    "numberOfErrors": 0,
    "numberOfData": 1,
    "status": 200,
    "uniqId": "00d928f759"
  },
  "data": [
    {
      "externalId": "text",
      "name": "text",
      "description": "text",
      "subject": "text",
      "fromName": "text",
      "fromAddress": "text",
      "replyTo": "text",
      "groupId": "text",
      "scheduleTime": "text",
      "state": "sent"
    }
  ]
}

Get single SMS campaign

get

Use this method to get all details of certain SMS campaign such as campaignId, senderId, message, scheduleTime and more.

Authorizations
Path parameters
campaignIdstringRequired

Id of existing campaign

Responses
200
Request was successfully processed
application/json
401
Authorization data is invalid
application/json
404
Request was successfully processed but no results were returned
application/json
500
Request was not processed due to server error
application/json
get
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "";

        try {
            using var client = new HttpClient{};
            using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.messageflow.com/v2.1/campaign/sms/{campaignId}");

            request.Headers.Add("Authorization", "YourAuthorizationKey");
            request.Headers.Add("Application-Key", "YourApplicationKey");
            request.Content = new StringContent(requestBody, null, "application/json");

            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            string content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);

        } catch (HttpRequestException e) {
            Console.WriteLine("\n Exception Caught!\n Message :{0} ", e.Message);
        }
    }
}
{
  "meta": {
    "numberOfErrors": 0,
    "numberOfData": 1,
    "status": 200,
    "uniqId": "00d928f759"
  },
  "data": [
    {
      "campaignId": "text",
      "name": "text",
      "description": "text",
      "message": "text",
      "senderId": "text",
      "priority": true,
      "recipientsCount": 1,
      "unicode": true,
      "validity": 1,
      "flash": true,
      "trackLinks": true,
      "scheduleTime": "text"
    }
  ]
}

Get sms campaign clicks

get

Use this method to get details of SMS clicks from a certain date range. Please remember clicks are stored for 90 days.

Authorizations
Path parameters
campaignIdstringRequired

Id of existing campaign

Query parameters
limitinteger · max: 1000Optional

The maximum number of items returned by request. Default ‘100’. Maximum ‘1000’.

Default: 100
offsetintegerOptional

The number of items omitted from the beginning of the list. Default ‘0’.

Default: 0
dateFromstringRequired

Start of the time range.

Example: 2025-01-01 00:00:00
dateTostringRequired

End of the time range.

Example: 2025-01-03 00:00:00
Responses
200
Request was successfully processed
application/json
401
Authorization data is invalid
application/json
404
Request was successfully processed but no results were returned
application/json
500
Request was not processed due to server error
application/json
get
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "";

        try {
            using var client = new HttpClient{};
            using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.messageflow.com/v2.1/campaign/sms/{campaignId}/report/click?limit=100&offset=0&dateFrom=2025-01-01 00:00:00&dateTo=2025-01-03 00:00:00");

            request.Headers.Add("Authorization", "YourAuthorizationKey");
            request.Headers.Add("Application-Key", "YourApplicationKey");
            request.Content = new StringContent(requestBody, null, "application/json");

            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            string content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);

        } catch (HttpRequestException e) {
            Console.WriteLine("\n Exception Caught!\n Message :{0} ", e.Message);
        }
    }
}
{
  "meta": {
    "numberOfErrors": 0,
    "numberOfData": 1,
    "status": 200,
    "uniqId": "00d928f759"
  },
  "data": [
    {
      "link": "text",
      "clickTime": "text",
      "number": "text",
      "count": 1
    }
  ]
}

List sms campaigns

get

Use this method to list all campaigns and its details from a certain time range.

Authorizations
Query parameters
limitinteger · max: 1000Optional

The maximum number of items returned by request. Default ‘100’. Maximum ‘1000’.

Default: 100
offsetintegerOptional

The number of items omitted from the beginning of the list. Default ‘0’.

Default: 0
dateFromstringRequired

Start of the time range.

Example: 2025-01-01 00:00:00
dateTostringRequired

End of the time range.

Example: 2025-01-03 00:00:00
Responses
200
Request was successfully processed
application/json
401
Authorization data is invalid
application/json
404
Request was successfully processed but no results were returned
application/json
500
Request was not processed due to server error
application/json
get
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "";

        try {
            using var client = new HttpClient{};
            using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.messageflow.com/v2.1/campaign/sms?limit=100&offset=0&dateFrom=2025-01-01 00:00:00&dateTo=2025-01-03 00:00:00");

            request.Headers.Add("Authorization", "YourAuthorizationKey");
            request.Headers.Add("Application-Key", "YourApplicationKey");
            request.Content = new StringContent(requestBody, null, "application/json");

            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            string content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);

        } catch (HttpRequestException e) {
            Console.WriteLine("\n Exception Caught!\n Message :{0} ", e.Message);
        }
    }
}
{
  "meta": {
    "numberOfErrors": 0,
    "numberOfData": 1,
    "status": 200,
    "uniqId": "00d928f759"
  },
  "data": [
    {
      "externalId": "example-id",
      "name": "test",
      "description": "test descr",
      "message": "Hello world",
      "senderId": "TEST",
      "groupId": "test-group-id",
      "scheduleTime": "2020-09-10 10:15:00",
      "api": "1"
    }
  ]
}

List sms campaign recipients

get

Use this method to get all recipients details from SMS campaign. Possible SMS status values: SMS_SEND, SMS_ERROR, SMS_WAITING, SMS_CANCELED, SMS_BAD_NUMBER, SMS_MESSAGE_TOO_LONG, SMS_MESSAGE_INCORRECT, SMS_MESSAGE_TOO_SHORT, SMS_UNKNOWN_ERROR

Authorizations
Path parameters
campaignIdstringRequired

Id of existing campaign

Query parameters
limitinteger · max: 1000Optional

The maximum number of items returned by request. Default ‘100’. Maximum ‘1000’.

Default: 100
offsetintegerOptional

The number of items omitted from the beginning of the list. Default ‘0’.

Default: 0
Responses
200
Request was successfully processed
application/json
401
Authorization data is invalid
application/json
404
Request was successfully processed but no results were returned
application/json
500
Request was not processed due to server error
application/json
get
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "";

        try {
            using var client = new HttpClient{};
            using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.messageflow.com/v2.1/campaign/sms/{campaignId}/report/recipient?limit=100&offset=0");

            request.Headers.Add("Authorization", "YourAuthorizationKey");
            request.Headers.Add("Application-Key", "YourApplicationKey");
            request.Content = new StringContent(requestBody, null, "application/json");

            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            string content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);

        } catch (HttpRequestException e) {
            Console.WriteLine("\n Exception Caught!\n Message :{0} ", e.Message);
        }
    }
}
{
  "meta": {
    "numberOfErrors": 0,
    "numberOfData": 1,
    "status": 200,
    "uniqId": "00d928f759"
  },
  "data": [
    [
      {
        "Number": "text",
        "ReceivedTime": "text",
        "ResultCode": "text"
      }
    ]
  ]
}

Get sms campaign state

get

Use this method to get sms campaign state. Available values: editing, readytosend, sending, sent and deliveredtosend.

Authorizations
Path parameters
campaignIdstringRequired

Id of existing campaign

Responses
200
Request was successfully processed
application/json
401
Authorization data is invalid
application/json
404
Request was successfully processed but no results were returned
application/json
500
Request was not processed due to server error
application/json
get
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "";

        try {
            using var client = new HttpClient{};
            using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.messageflow.com/v2.1/campaign/sms/{campaignId}/report/state");

            request.Headers.Add("Authorization", "YourAuthorizationKey");
            request.Headers.Add("Application-Key", "YourApplicationKey");
            request.Content = new StringContent(requestBody, null, "application/json");

            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            string content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);

        } catch (HttpRequestException e) {
            Console.WriteLine("\n Exception Caught!\n Message :{0} ", e.Message);
        }
    }
}
{
  "meta": {
    "numberOfErrors": 0,
    "numberOfData": 1,
    "status": 200,
    "uniqId": "00d928f759"
  },
  "data": [
    {
      "state": "sent"
    }
  ]
}
  • POSTSend email campaign
  • GETGet email campaign clicks
  • GETList email campaigns
  • GETGet email campaign opens
  • GETList email campaign recipients
  • GETGet email campaign unsubscribe report
  • GETList push campaigns
  • PATCHChange email campaign state
  • GETGet single email campaign
  • GETGet single SMS campaign
  • GETGet sms campaign clicks
  • GETList sms campaigns
  • GETList sms campaign recipients
  • GETGet sms campaign state