To send a message via API, you should create an API Token first. You can generate your API Token from Communication Platform by following the below steps:

  1. Click on Developers in the Platform’s Homepage.
  2. Click on Create API Key.
  3. Enter a name to your API Key in the Label field.
  4. Choose an Expiration Date or check the Never Expire box.
  5. Click Create.
  6. Copy your API token and check the box.
  7. Click Done.

Needs More details, please check the below Step:

To send a message using Cequens' SMS API, you must first authenticate by obtaining an access token using the OAuth2 password grant method. Then, you can call the POST /api/sms/v1/messages endpoint to submit your message.


Step 1: Generate an Access Token

Before calling the SMS API, you must authenticate your client and retrieve an access token.

Endpoint:

nginx
CopyEdit
POST https://developer.cequens.com/oauth/token

Request Example:

json
CopyEdit
{ "grant_type": "password", "username": "your_username", "password": "your_password", "client_id": "your_client_id", "client_secret": "your_client_secret" }

Response Example:

json
CopyEdit
{ "access_token": "eyJ0eXAiOiJKV1QiLCJhbGci...", "token_type": "Bearer", "expires_in": 3600 }

? Use this token in the Authorization header for all SMS API requests.


Step 2: Send a Message via the SMS API

Endpoint:

bash
CopyEdit
POST https://developer.cequens.com/api/sms/v1/messages

Required Headers:

http
CopyEdit
Authorization: Bearer YOUR_ACCESS_TOKEN Content-Type: application/json

Sample Request Body:

json
CopyEdit
{ "recipient": "201234567890", "sender": "CEQUENS", "message": "Hello from Cequens!" }

Successful Response:

json
CopyEdit
{ "message_id": "a1b2c3d4-e5f6-7890-abcd-1234567890ef", "status": "accepted" }

Tips

  • Phone numbers must be in international E.164 format (e.g. 201234567890)

  • Ensure your Sender ID is approved and allowed for the target country

  • The access_token is valid for a limited time — refresh it as needed

After creating your Token, please refer to our API Documentation via this link.