Documentation

For developers who are looking to integrate SMSTech with an existing system, our comprehensive documentation provides all the information required to get you up and running.

Numbers

get-number

Get detailed information about a response number you have leased.

PARAMETER DESCRIPTION REQUIRED
number The virtual number to retrieve YES

Example

curl https://api.transmitsms.com/get-number.json \
-u 2e24c1cbdd987221e165d543f34b84bf:secret \
-d number=61414000009

JSON RESPONSE

{
number: "61491570110",
next_charge: "2013-08-14",
auto_renew: true,
price: "29",
status: "active",
forward_url: "http://example.com/sms"
}

XML RESPONSE

<?xmlversion="1.0"encoding="UTF-8"?> <response> <number>61491570110</number> <next_charge>2013-08-14</next_charge> <auto_renew>true</auto_renew> <status>active</status> <price>29</status> <forward_url>http://example.com/sms</forward_url> </response>

PHP Example

<?php include'../../APIClient2.php'; $api=new transmitsmsAPI("API_KEY",'API_SECRET'); $result=$api->getNumber('6140000000'); if($result->error->code=='SUCCESS') { echo"This number is {$result->status} and valid up to {$result->next_charge}"; } else { echo"Error: {$result->error->description}"; }

lease-number

Lease a dedicated virtual number.

PARAMETER DESCRIPTION REQUIRED
number The virtual number to lease. Omit this field to be given a random number. Use get-numbers to find out which numbers are currently available. NO

Example

lease a number and have all responses sent to your server

curl https://api.transmitsms.com/lease-number.json \
-u 2e24c1cbdd987221e165d543f34b84bf:secret \
-d number=61414000013 \
-d 'forward_url=https://example.com/sms-responses.php'

JSON RESPONSE

{
number: "61491570156",
next_charge: "2014-09-25",
auto_renew: true,
status: "active",
price: "29",
forward_url: "https://example.com/sms"
}

XML RESPONSE

<?xmlversion="1.0"encoding="UTF-8"?> <response> <number>61491570156</number> <next_charge>2014-09-25</next_charge> <auto_renew>true</auto_renew> <status>active</status> <price>29</status> <forward_url>https://example.com/sms</forward_url> </response>

PHP Example

<?php include'../../APIClient2.php'; $api=new transmitsmsAPI("API_KEY",'API_SECRET'); $result=$api->leaseNumber('6140000000'); if($result->error->code=='SUCCESS') { echo"This number is {$result->status} and valid up to {$result->next_charge}"; } else { echo"Error: {$result->error->description}"; }

get-numbers

Get a list of numbers either leased by you or available to be leased.

PARAMETER DESCRIPTION REQUIRED
filter Possible values are
owned – retrieve your own response numbers (default)
available – retrieve response numbers available for purchase
NO
page Page number, for pagination NO
max Maximum results returned per page NO

Example

get a list of numbers you have leased

curl https://api.transmitsms.com/get-numbers.json \
-u 2e24c1cbdd987221e165d543f34b84bf:secret

JSON RESPONSE

{
filter: "owned",
numbers_total: 1,
numbers: [
{
number: "61491570110",
next_charge: "2013-08-14",
auto_renew: true,
status: "active",
price: "29",
forward_url: "http://example.com/sms"
}
],
page: {
count: 1,
number: 1
}
}

XML RESPONSE

<?xmlversion="1.0"encoding="UTF-8"?> <response> <filter>owned</filter> <numbers_total>1</numbers_total> <numbers> <number>61491570110</number> <next_charge>2013-08-14</next_charge> <auto_renew>true</auto_renew> <status>active</status> <price>29</status> <forward_url>http://example.com/sms</forward_url> </numbers> <page> <count>1</count> <number>1</number> </page> </response>

Example

get a list of numbers available for lease

curl https://api.transmitsms.com/get-numbers.json \
-u 2e24c1cbdd987221e165d543f34b84bf:secret \
-d filter=available

JSON RESPONSE

{
filter: "available",
numbers_total: 134,
numbers: [
{
number: "61491570156",
next_charge: null,
auto_renew: true,
status: "inactive",
forward_url: "http://example.com/sms"
}
],
page: {
count: 14,
number: 1
}
}

XML RESPONSE

<?xmlversion="1.0"encoding="UTF-8"?> <response> <filter>available</filter> <numbers_total>134</numbers_total> <numbers> <number>61491570156</number> <next_charge>null</next_charge> <auto_renew>true</auto_renew> <status>inactive</status> <forward_url>http://example.com/sms</forward_url> </numbers> <page> <count>14</count> <number>1</number> </page> </response>

PHP Example

<?php include'../../APIClient2.php'; $api=new transmitsmsAPI("API_KEY",'API_SECRET'); $offset=0; $limit=10; $result=$api->getNumbers($offset,$limit); if($result->error->code=='SUCCESS') { echo"There are {$result->numbers_total} numbers, showing page {$result->page->number} of {$result->page->count} <hr>"; foreach($result->numbersas$number){ echo"Number {$number->number} is {$number->status} and valid up to {$number->next_charge}<br>"; } } else { echo"Error: {$result->error->description}"; }