Skip to content

SMS API

Is possible to send individual SMS or campaigns to several contacts

Send to multiple contacts

Sending an SMS campaign to a group of contacts

  • Required:
    • src: Sender (From)
    • gid: Group Id
    • text: SMS Text
    • name: Name to identify the shipment
  • Optional:
    • date: Date/time schedule
    • custom_field: Name of the field to use to customize the text
    • custom_field_length: Field length
export TE_TOKEN='Your token'

curl -X POST https://app.teenvio.com/v4/public/api/rest/v3/sms \
-H "X-Token: $TE_TOKEN" \
-H "content-type: application/json" \
-d '{
    "gid" : 1
    "text" : "hello world",
    "src" : "teenvio",
    "name" : "api test from curl"
}'
<?php

$curl = curl_init();

$url_base = 'https://app.teenvio.com/v4/public/api/rest/v3'

curl_setopt_array($curl, array(
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_URL => $url_base.'/sms/',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array(
        'Accept: application/json',
        'X-Token: $token',
        'Content-Type: application/json'
    ),
    CURLOPT_POSTFIELDS => '{
        "gid" : 1
        "text" : "hello world",
        "src" : "teenvio",
        "name" : "api test from curl"
    }'
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

token = 'Your token'

url_base = 'https://app.teenvio.com/v4/public/api/rest/v3'

my_headers = {
    'Accept' : 'application/json',
    'X-Token' : token,
    'Content-Type' : 'application/json'
}
post_request = {
    "gid" : 1
    "text" : "hello world",
    "src" : "teenvio",
    "name" : "api test from curl"
}

response = requests.post(url_base+"/sms/", json=post_request, headers=my_headers)

print(response.json())
const axios= require('axios');

const token = 'Your token';

const url_base = 'https://app.teenvio.com/v4/public/api/rest/v3';

const my_headers = {
    'Accept' : 'application/json',
    'X-Token' : token
};

const post_request = {
    "gid" : 1
    "text" : "hello world",
    "src" : "teenvio",
    "name" : "api test from curl"
};

axios.post(url_base+'/sms/', post_request, {headers:my_headers}).then(resp => {
    console.log(resp.data);
});

More information: