Send SMS

Send text messages through the CloudMessage API.

curl  -X POST 'https://account.cloudmessage.co/api/v1/send-message' \ 
 -H  'apiKey: your_api_key' \  
 -H  'Content-Type: application/json' \ 
 -d $'{ 
 "recipient": "+254711225552",
 "message": "Test message",
 "sender_id": "CloudMsg"
}'
200: Success
{
  "status": "success",
  "recipient": "+254711225552",
  "message": "Test message"
}
403: Forbidden
{
  "status": "error",
  "message": "The API Key is not allowed to access the resource"
}
500: Server error
{
  "status": "error",
  "message": "The request failed"
}

View Balance

Get the CloudMessage account's SMS credits balance.

curl 'https://account.cloudmessage.co/api/v1/balance' \ 
 -H  'apiKey: your_api_key' 
200: Success
{
  "status": "success",
  "message": "Account balance",
  "data": {
    "account": 100
  }
}

View Account

Get the CloudMessage account's details.

curl 'https://account.cloudmessage.co/api/v1/account' \ 
 -H  'apiKey: your_api_key' 
200: Success
{
  "status": "success",
  "message": "Account details",
  "data": {
    "account": {
      "name": "CloudMessage Account",
      "sms_rate": 0.8,
      "payment_details": {
        "mpesa": {
          "paybill": "4098615",
          "account_number": "CMXXXXX"
        }
      }
    }
  }
}