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

Sms

PreviousEmailsNextBlacklist

Transactional SMS API allows you to send SMS to a single or an array of phone numbers.

Get statuses of SMS

get

Use this method to get all SMS statuses. By default, you can only access data from the last month

Authorizations
Query parameters
offsetintegerOptional

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

Default: 0
limitinteger · max: 1000Optional

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

Default: 100
dateTostringOptional

Start of the UTC time range. Use RFC 3339 standard or simpler "YYYY-MM-DD hh:mm:ii" format.

Example: 2025-01-03 00:00:00
dateFromstringOptional

End of the UTC time range. Use RFC 3339 standard or simpler "YYYY-MM-DD hh:mm:ii" format.

Example: 2025-01-01 00:00:00
senderstringOptional

List of senders. (max 10)

Example: Sender1,Sender2,Sender3
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/sms/statuses?offset=0&limit=100&dateTo=2025-01-03 00:00:00&dateFrom=2025-01-01 00:00:00&sender=Sender1,Sender2,Sender3");

            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": "121212121-12121212-121212-2121212",
      "status": 1,
      "statusDesc": "DELIVERED",
      "statusTime": 1643723643,
      "webhookUrl": "text"
    }
  ]
}

Get list of sender IDs

options

Use the method to get all sender IDs assigned to the current API KEY.

Authorizations
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
options
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.Options, "https://api.messageflow.com/v2.1/sms/senders");

            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 list of SMS

get

Use this method to get all sent sms

Authorizations
Path parameters
externalIdstringOptional

externalId of SMS preceded by a sign 'C-' f.e. C-extid_3-0001

Query parameters
offsetintegerOptional

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

Default: 0
limitinteger · max: 1000Optional

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

Default: 100
senderstringOptional

Allows to filtrate list of sent sms by sender id ( you can add up to 10 sender id separated by , )

phoneNumberstringOptional

Allows to find sent sms by phone number

Example: +01230123123
statusintegerOptional

You can find sms by status ( 1 - new, 2 - move to send, 9 - rejected, 21 - delivered )

orderBystringOptional

You can order by externalId, status and createTime. This only works if you don't pass the externalId parameter.

orderDirectionstringOptional

You can set ascending('ASC') or descending('DESC') direction. This only works if you don't pass the externalId parameter.

dateTostringOptional

Search with UTC time. Use RFC 3339 standard or simpler "YYYY-MM-DD hh:mm:ii" format

Example: 2025-01-03 00:00:00
dateFromstringOptional

Search with UTC time up to a month ago. Use RFC 3339 standard or simpler "YYYY-MM-DD hh:mm:ii" format

Example: 2025-01-01 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/sms/{externalId}?offset=0&limit=100&sender=<string>&phoneNumber=+01230123123&status=<integer>&orderBy=<string>&orderDirection=<string>&dateTo=2025-01-03 00:00:00&dateFrom=2025-01-01 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": [
    {
      "id": 1,
      "sender": "text",
      "message": "text",
      "phoneNumber": "text",
      "scheduleTime": 1,
      "type": 1,
      "shortLink": true,
      "externalId": "text",
      "status": 1,
      "statusTime": 1,
      "subscribeUrl": "text",
      "createTime": 1,
      "smsPrice": 1,
      "currency": 1,
      "numberOfParts": 1,
      "encoding": 1
    }
  ]
}

Hlr

post

Use this method to check if a phone number is available.

Authorizations
Body
phonestringRequired

The phone number.

Example: +48111222333
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
post
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "{\"phone\":\"+48111222333\"}";

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

            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": [
    {
      "phone": "text",
      "status": "text",
      "imsi": null,
      "network": "text",
      "ported": "text",
      "networkPorted": "text",
      "description": "text"
    }
  ]
}

Send SMS

post

Use this method to send SMS to any phone numbers you provide. If you want to send SMS to the group created through POST /v2/group use the send sms campaign method. Remember that the use of characters other than the GSM-7 standard will shorten individual text messages, which may increase the cost of sending messages. If You want more information, check SMS Billing section in this documentation.

Authorizations
Body
senderstring · max: 15Required

The sender ID that was previously added through the user panel and then accepted by our support team.

messagestringRequired

The content of the SMS

Example: Hello world!
phoneNumbersstring[] · max: 200Required

The phone numbers of receivers.

Example: ["+48111222333","+48111222444"]
validitynumber · max: 4320Optional

The number of minutes the SMS will be valid (Max value = 4320) / 3 days

scheduleTimenumberOptional

SMS dispatch date set in the future, up to a maximum of 14 days.

typenumberOptional

Type of SMS ( 0 - regular SMS, 1 - Flash SMS )

Default: 0
shortLinkbooleanOptional

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

Default: falseExample: true
webhookUrlstring · max: 255Optional

The URL for DLR (Delivery Report). DLR is a feature that reports if the message has been delivered. If you want more information check section DLR in this documentation.

externalIdstring · max: 64Optional

The unique identifier of the message. After sending a text message with external ID, it cannot be resent for next 24 hours. Cannot be longer than 64 characters.

Example: xxxx-xxxx-xxxx
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
post
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "{\"sender\":\"\",\"message\":\"Hello world!\",\"phoneNumbers\":[\"\"],\"validity\":0,\"scheduleTime\":0,\"type\":0,\"shortLink\":true,\"webhookUrl\":\"\",\"externalId\":\"xxxx-xxxx-xxxx\"}";

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

            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": [
    {
      "sender": "text",
      "message": "text",
      "phoneNumber": "text",
      "scheduleTime": 1,
      "type": 1,
      "shortLink": true,
      "externalId": "text",
      "status": 1,
      "statusTime": 1,
      "createTime": 1,
      "smsPrice": 1,
      "currency": 1,
      "numberOfParts": 1,
      "encoding": 1
    }
  ]
}
  • GETGet statuses of SMS
  • OPTIONSGet list of sender IDs
  • GETGet list of SMS
  • POSTHlr
  • POSTSend SMS