TextPort SMS API

A simple REST-based text messaging API. Easily integrate SMS messaging into your apps.


View API Documentation »



Features


Easy Integration

A simple, industry-standard RESTful API. Support for all development languages and platforms.

Affordable Pricing

Pay-as-you-go pricing. Pay for only what you need. No monthly minimums or recurring charges.

Choose Your Number

Selet an area code, then choose your own dedicated virtual number. Use multiple numbers if you require a localized presence.



Pricing


Pay as You Go

Purchase a number, then purchase only the messaging credit you need.

No minimums or expirations

Purchase as little as $1.00. Messaging credit never expires

No recurring fees

No auto-bill, monthly minimums, or recurring fees


Virtual Numbers

$6.00 per month

Outbound SMS

Starting at $0.015 per message

Inbound SMS

FREE


 

Outbound MMS

Start at $.0.025 per message

Inbound MMS

FREE




Sample Code



Sample Request Payloads
[
    {
        "From": "12135551212",
        "To": "13035555323",
        "MessageText": "Sample message from TextPort SMS API"
    }
]
<ArrayOfMessage>
    <Message>
        <From>12135551212</From>
        <To>13035555323</To>
        <MessageText>Sample message from TextPort SMS API</MessageText>
    </Message>
</ArrayOfMessage>
[
    {
        "From": "12135551212",
        "To": "13035555323",
        "MessageText": "FIRST message from TextPort SMS API"
    },
    {
        "From": "12135551212",
        "To": "13035555323",
        "MessageText": "SECOND message"
    },
    {
        "From": "12135551212",
        "To": "13035555323",
        "MessageText": "THIRD message"
    }
]
<ArrayOfMessage>
    <Message>
        <From>12135551212</From>
        <To>13035555323</To>
        <MessageText>FIRST message from TextPort SMS API</MessageText>
    </Message>
    <Message>
        <From>12135551212</From>
        <To>13035555323</To>
        <MessageText>SECOND message</MessageText>
    </Message>
    <Message>
        <From>12135551212</From>
        <To>13035555323</To>
        <MessageText>THIRD message</MessageText>
    </Message>
</ArrayOfMessage>
Code Examples (using JSON payload)
POST /api/v1/messages/send HTTP/1.1
Host: textport.com
Content-Type: application/json
Authorization: Basic MS1vcVk0OUNFRzhzOldqTk1ya2t6ZnFLbnQwV2c1bVdk
[
    {
        "From": "12135551212",
        "To": "13035555323",
        "MessageText": "Sample text message from TextPort SMS API"
    }
]
var client = new RestClient("https://textport.com/api/v1/messages/send");
var request = new RestRequest(Method.POST);

request.AddHeader("Authorization", "Basic MS1vcVk0OUNFRzhzOldqTk1ya2t6ZnFLbnQwV2c1bVdk");
request.AddHeader("Content-Type", "application/json");

request.AddParameter("undefined", "[\n    {\n        \"From\": \"12135551212\",\n        \"To\": \"13035555323\",\n        \"MessageText\": \"Sample text message from TextPort SMS API\"\n    }\n]", ParameterType.RequestBody);

IRestResponse response = client.Execute(request);
setUrl('https://textport.com/api/v1/messages/send');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
    'Authorization' => 'Basic MS1vcVk0OUNFRzhzOldqTk1ya2t6ZnFLbnQwV2c1bVdk',
    'Content-Type' => 'application/json'
));

$request->setBody('[
    {
        "From": "12135551212",
        "To": "13035555323",
        "MessageText": "Sample text message from TextPort SMS API"
    }
]');

try {
    $response = $request->send();

    echo $response->getBody();
} catch (HttpException $ex) {
    echo $ex;
}
curl -X POST \
https://textport.com/api/v1/messages/send \
-H 'Authorization: Basic MS1vcVk0OUNFRzhzOldqTk1ya2t6ZnFLbnQwV2c1bVdk' \
-H 'Content-Type: application/json' \
-d '[
        {
            "From": "12135551212",
            "To": "13035555323",
            "MessageText": "Sample text message from TextPort SMS API"
        }
]'
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://textport.com/api/v1/messages/send",
    "method": "POST",
    "headers": {
    "Content-Type": "application/json",
    "Authorization": "Basic MS1vcVk0OUNFRzhzOldqTk1ya2t6ZnFLbnQwV2c1bVdk"
    },
    "processData": false,
    "data": "[\n    {\n        \"From\": \"12135551212\",\n        \"To\": \"13035555323\",\n        \"MessageText\": \"Sample text message from TextPort SMS API\"\n    }\n]"
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
import http.client

conn = http.client.HTTPConnection("textport,com")

payload = "[\n    {\n        \"From\": \"12135551212\",\n        \"To\": \"13035555323\",\n        \"MessageText\": \"Sample text message from TextPort SMS API\"\n    }\n]"

headers = {
'Content-Type': "application/json",
'Authorization': "Basic MS1vcVk0OUNFRzhzOldqTk1ya2t6ZnFLbnQwV2c1bVdk"
}

conn.request("POST", "api,v1,messages,send", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://textport.com/api/v1/messages/send")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Authorization"] = 'Basic MS1vcVk0OUNFRzhzOldqTk1ya2t6ZnFLbnQwV2c1bVdk'
request.body = "[\n    {\n        \"From\": \"12135551212\",\n        \"To\": \"13035555323\",\n        \"MessageText\": \"Sample text message from TextPort SMS API\"\n    }\n]"

response = http.request(request)
puts response.read_body
Confirmation/Response
[
    {
        "From": "12135551212",
        "To": "13035555323",
        "MessageText": "Sample text message from TextPort SMS API",
        "Status": "OK",
        "ErrorMessage": "",
        "MessageId": 1190269079,
        "Balance": 9.53
    }
]
<ArrayOfMessagesResult>
    <MessagesResult>
        <From>12135551212</From>
        <To>13035555323</To>
        <MessageText>Sample message from TextPort SMS API</MessageText>
        <Status>OK</Status>
        <ErrorMessage />
        <MessageId>10269080</MessageId>
        <Balance>9.5150</Balance>
    </MessagesResult>
</ArrayOfMessagesResult>

Note: The default format for response content is JSON. Adding an HTTP header Accept: application/xml will set the response format to XML.