Products

Solutions

Products

Solutions

SMS API

Flowstates Messaging API

Getting Started

Welcome to the SMS Messaging API! This API allows you to send SMS messages, manage webhooks, and query the status of sent messages. Before you can start using the API, you need to have an active account and an API key.

  1. Create an Account

To use the SMS Messaging API, you must first have an active account. Please contact our team at https://flowstates.net/contact. Once your account is active, you will be able to generate an API key.

  1. Obtain an API Key

After activating your account, log in to the Portal to generate your API key. This key is required to authenticate all your API requests.

  1. Setup Authentication

All API requests require the

Authorization

header with your API key:

Authorization: X-Api-key {your_api_key}

  1. API Base URL

All API endpoints are relative to the base URL:

https://api.flowstates.net

Error Handling

The API uses standard HTTP status codes to indicate the success or failure of an API request. Common status codes include:

200 OK

: The request was successful.

201 Created

: The resource was created successfully.

400 Bad Request

: The request was invalid or cannot be otherwise served.

401 Unauthorized

: Authentication failed or API key is missing.

404 Not Found

: The requested resource could not be found.

500 Internal Server Error

: An error occurred on the server.

Best Practices

Rate limiting:

Respect the rate limits specified in your account settings to avoid being throttled.

Security:

Always use HTTPS to encrypt your API requests and responses.

Validation:

Validate all input data on your side before sending it to the API to avoid errors.

Support

If you have any questions or need assistance, please visit our Contact Page or contact our support team at dev.support@flowstates.net.

For the full SMS API documentation

Add some text here to talk about the full API documentation, maybe something about sending and receiving SMS??

Send SMS message

http://flowstates.net/messages/send

This method allows you to generate a send message request.uest is using an authorization helper from collection Flowstates Messaging API

A successful POST request typically returns a

200 OK

or

201 Created

response code.

Authorization

API Key

This request is using an authorization helper from collection Flowstates Messaging API

Body

raw JSON

{

"to":"+6141234567890", //Desnitation mobile phone number, must be in international format with leading '+'

"message": "Hello world!", //Message to send*

"sender": "Flowstates" //Sender text or shortcode to be displayed on the user's phone*

}

Example Request

cURL

curl --location 'https://api.flowstates.net/messages/send' \

--data '{

"to":"+6141234567890", //Desnitation mobile phone number, must be in international format with leading '\''+'\''

"message": "Hello world!", //Message to send*

"sender": "Flowstates" //Sender text or shortcode to be displayed on the user'\''s phone*

}

'

NodeJS

var http = require('follow-redirects').http;

var fs = require('fs');


var options = {

'method': 'POST',

'hostname': 'https://api.flowstates.net',

'port': 5132,

'path': '/messages/send',

'headers': {

},

'maxRedirects': 20

};


var req = http.request(options, function (res) {

var chunks = [];


res.on("data", function (chunk) {

chunks.push(chunk);

});


res.on("end", function (chunk) {

var body = Buffer.concat(chunks);

console.log(body.toString());

});


res.on("error", function (error) {

console.error(error);

});

});


var postData = "{\n\t\t\"to\":\"+6141234567890\",\t\t\t//Desnitation mobile phone number, must be in international format with leading

'+'\n\t\t\"message\": \"Hello world!\", //Message to send* \n\t\t\"sender\": \"Flowstates\"\t\t\t//Sender text or shortcode to be displayed

on the user's phone*\t\n}\n\n";


req.write(postData);


req.end();

Python

import http.client


conn = http.client.HTTPSConnection(https://api.flowstates.net, 5132)

payload = "{\n\t\t\"to\":\"+6141234567890\",\t\t\t//Desnitation mobile phone number, must be in international format with leading

'+'\n\t\t\"message\": \"Hello world!\", //Message to send* \n\t\t\"sender\": \"Flowstates\"\t\t\t//Sender text or shortcode to be displayed

on the user's phone*\t\n}\n\n"

headers = {}

conn.request("POST", "/messages/send", payload, headers)

res = conn.getresponse()

data = res.read()

print(data.decode("utf-8"))

C#

var client = new HttpClient();

var request = new HttpRequestMessage(HttpMethod.Post, "https://api.flowstates.net/messages/send");

var content = new StringContent("{\n\t\t\"to\":\"+6141234567890\",\t\t\t//Desnitation mobile phone number, must be in international

format with leading '+'\n\t\t\"message\": \"Hello world!\", //Message to send* \n\t\t\"sender\": \"Flowstates\"\t\t\t//Sender text or

shortcode to be displayed on the user's phone*\t\n}\n\n", null, "text/plain");

request.Content = content;

var response = await client.SendAsync(request);

response.EnsureSuccessStatusCode();

Console.WriteLine(await response.Content.ReadAsStringAsync());

Start a Conversation with Us Today

Let's discuss your needs and how we can help you leverage the power and effectiveness of SMS and mobile messaging for your business.