Overview
Telecom Lookup Tools
Powered By GitBook
Sending
Sending SMS with teleapi is a breeze.

Post/ Get Information

URL:
Argument
Required
Type
source
yes
int
destination
yes
int
message
yes
string

Character Limitations

SMS Messages are limited to 160 characters, however you can send up to 910 characters. teleapi will split the messages into smaller messages, which may increase your message count.
Sending emojis embedded in your messages will cause the character set to be changed and your messages to be split into 70 character chunks.
shell
PHP+CURL
PHP+Plain
RESPONSE
CURL
1
curl -v -X POST "https://api.teleapi.net/sms/send?token=XXXX" \
2
-d "source=13035551212&destination=13038884444&message=hello+there"
Copied!
PHP + Curl
1
<?php
2
$data = array("source" => "13035551212",
3
"destination" => "13038884444",
4
"message" => "hey there");
5
โ€‹
6
$data = http_build_query($data);
7
$baseurl = "https://api.teleapi.net/sms/send?token=XXXX";
8
curl_setopt($ch, CURLOPT_POST, 1);
9
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
10
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
11
$retval = curl_exec($ch);
12
curl_close($ch);
13
โ€‹
14
$object = json_decode($retval);
15
print_r($object);
Copied!
PHP - file_get_contents
1
<?php
2
$data = array("source" => "13035551212",
3
"destination" => "13038884444",
4
"message" => "hey there");
5
โ€‹
6
$data = http_build_query($data);
7
โ€‹
8
$x = file_get_contents("https://api.teleapi.net/sms/send?token=XXXX&$data");
9
$object = json_decode($x);
10
print_r($object);
Copied!

Responses from API

Successfully Sent

data
This is your unique tracking ID for this SMS message. You can track this in delivery notifications.
1
{
2
"code":200,
3
"status":"success",
4
"data":"ea19aa71-4590-4e6b-a8ce-47e2b84c8091"
5
}
Copied!

Failed to Send

1
{
2
"code":400,
3
"status":"error",
4
"data":"Invalid source number"
5
}
Copied!
Last modified 1yr ago