Sending - w/ URL
This will help you send an MMS message if the media you want to send us located at a URL.
URL:
Argument | Required | Type |
source | yes | int |
destination | yes | int |
file_url | yes | string |
message | no | string |
shell
PHP+CURL
PHP+PLAIN
RESPONSE
Shell/CURL
Note: Be sure to convert / in your image url to %2F (urlencoded)
curl -v -X POST "https://api.teleapi.net/mms/send?token=XXXX" \
-d "source=13035551212&destination=13038884444&file_url=http%3A%2F%2Fsample.s3.amazon.com%2Ffile.jpg"
PHP + CURL
<?php
$file_url = urlencode("http://sample.s3.amazon.com/file.jpg");
$data = array("source" => "13035551212",
"destination" => "13038884444",
"file_url" => $file_url
);
$data = http_build_query($data);
$baseurl = "https://api.teleapi.net/mms/send?token=XXXX";
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$retval = curl_exec($ch);
curl_close($ch);
$object = json_decode($retval);
print_r($object);
PHP - file_get_contents
<?php
$file_url = urlencode("http://sample.s3.amazon.com/file.jpg");
$data = array("source" => "13035551212",
"destination" => "13038884444",
"file_url" => $file_url
);
$data = http_build_query($data);
$url = "https://api.teleapi.net/mms/send?token=XXXX&".$data;
$url .= "&file_url=$file_url";
$x = file_get_contents($url);
$object = json_decode($x);
print_r($object);
Last modified 2yr ago