Extended SMS

Legacy APIs - SMS
Starting a new integration? This is a legacy API. It stays available for existing integrations, but new integrations should use the SMS V3 APIs.

Send a message to a phone number, or a different message to many numbers, with a JSON body. The credentials go in the headers.

POSThttps://telcomw.com/api-v2/extended/send

Send from, api_key and password as headers, and the messages as a JSON array in the body.

Parameters

Parameter Sent in Required Description
from header YES The sender ID, for example WGIT.
api_key header YES Your API key.
password header YES Your account password.
[].message body YES The content of the message that you want to send.
[].phone body YES The recipient's phone number in international format.

Example request

curl --location --request POST 'https://telcomw.com/api-v2/extended/send' \
  --header 'from: WGIT' \
  --header 'api_key: YOUR_API_KEY' \
  --header 'password: YOUR_PASSWORD' \
  --header 'Content-Type: application/json' \
  --data '[
  {
    "message": "Hello",
    "phone": "265992026866"
  },
  {
    "message": "Hello 2",
    "phone": "265884113450"
  }
]'
curl --location --request POST "https://telcomw.com/api-v2/extended/send" ^
  --header "from: WGIT" ^
  --header "api_key: YOUR_API_KEY" ^
  --header "password: YOUR_PASSWORD" ^
  --header "Content-Type: application/json" ^
  --data "[{\"message\":\"Hello\",\"phone\":\"265992026866\"},{\"message\":\"Hello 2\",\"phone\":\"265884113450\"}]"
<?php

$headers = [
    'from: WGIT',
    'api_key: YOUR_API_KEY',
    'password: YOUR_PASSWORD',
    'Content-Type: application/json',
];

$data = [
    [
        'message' => 'Hello',
        'phone' => '265992026866'
    ],
    [
        'message' => 'Hello 2',
        'phone' => '265884113450'
    ]
];

$ch = curl_init('https://telcomw.com/api-v2/extended/send');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

print_r(json_decode($response, true));
const axios = require('axios');

axios.request({
  method: 'post',
  url: 'https://telcomw.com/api-v2/extended/send',
  headers: {
    'from': 'WGIT',
    'api_key': 'YOUR_API_KEY',
    'password': 'YOUR_PASSWORD',
    'Content-Type': 'application/json'
  },
  data: [
    {
      "message": "Hello",
      "phone": "265992026866"
    },
    {
      "message": "Hello 2",
      "phone": "265884113450"
    }
  ]
}).then((res) => console.log(res.data))
  .catch((err) => console.error(err.response ? err.response.data : err.message));
import requests

headers = {
    'from': 'WGIT',
    'api_key': 'YOUR_API_KEY',
    'password': 'YOUR_PASSWORD',
    'Content-Type': 'application/json'
}
payload = [
    {
        'message': 'Hello',
        'phone': '265992026866'
    },
    {
        'message': 'Hello 2',
        'phone': '265884113450'
    }
]

response = requests.request('POST', 'https://telcomw.com/api-v2/extended/send', headers=headers, json=payload)
print(response.json())

Response

The response is JSON.

Success

{
  "type": "success",
  "msg": "send",
  "code": "200",
  "advance": "1",
  "feedback": [
    {
      "status": 2,
      "cost": 20,
      "msdn": "265992026866",
      "chars": 5,
      "code": 200,
      "id": "nexp7hdwhmfu"
    },
    {
      "status": 2,
      "cost": 20,
      "msdn": "265884113450",
      "chars": 7,
      "code": 200,
      "id": "iqenjjepnum5"
    }
  ]
}

Fields explained

FieldDescription
typeThe type of response.
msgA message about the status of the request.
codeA code for the outcome of the request.
advanceAdditional information about the request.
feedback[].statusThe status of the message. 2 means the message was sent.
feedback[].costThe cost of the message.
feedback[].msdnAn identifier for the message.
feedback[].charsThe number of characters in the message.
feedback[].codeA code for the result of sending the message.
feedback[].idA unique identifier of the sent message.

Good to know

  • Use the correct international format for the phone numbers so the messages are delivered.
  • The response tells you the status of each message, so you can check it was sent.