-
API DOCUMENTATION
GETTING STARTED -
MESSAGES
- POSTSend a Message
-
NUMBER MANAGEMENT
- GETActive Numbers
- GETSearch Numbers
- POSTGet a Number
-
ACCOUNT
- GETGet Balance
-
TEST METHODS
- GETPing
-
CALLBACK EVENTS
- POSTInbound Message
- POSTDelivery Receipt
Get Active Numbers on Account/v1/numbers/active
Description
Gets a list of numbers that are active on the account.
GET
Endpoint
https://api.textport.com/v1/numbers/active
Request
GET /v1/numbers/active HTTP/1.1
Host: api.textport.com
Authorization: Basic MS13OFBHczdPY09KOkVnbkJDZnh5N2txMXdHVkpycFJn
var client = new RestClient("https://api.textport.com/v1/numbers/active");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Basic MS13OFBHczdPY09KOkVnbkJDZnh5N2txMXdHVkpycFJn");
IRestResponse response = client.Execute(request);
$request = new HttpRequest();
$request->setUrl('https://api.textport.com/v1/numbers/active');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'Authorization' => 'Basic MS13OFBHczdPY09KOkVnbkJDZnh5N2txMXdHVkpycFJn'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
curl -X GET \
https://api.textport.com/v1/numbers/active \
-H 'Authorization: Basic MS13OFBHczdPY09KOkVnbkJDZnh5N2txMXdHVkpycFJn'
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.textport.com/v1/numbers/active",
"method": "GET",
"headers": {
"Authorization": "Basic MS13OFBHczdPY09KOkVnbkJDZnh5N2txMXdHVkpycFJn"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
import http.client
conn = http.client.HTTPConnection("api,textport,com")
payload = ""
headers = {
'Authorization': "Basic MS13OFBHczdPY09KOkVnbkJDZnh5N2txMXdHVkpycFJn"
}
conn.request("GET", "v1,numbers,active", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.textport.com/v1/numbers/active")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic MS13OFBHczdPY09KOkVnbkJDZnh5N2txMXdHVkpycFJn'
response = http.request(request)
puts response.read_body
[
{
"Number": "12135551212",
"DateAssigned": "2019-06-21T15:43:19.48",
"ExpirationDate": "2019-09-21T15:43:19",
"RenewalCount": 2,
"APIApplicationName": "TextPort API Demo App"
},
{
"Number": "12135551214",
"DateAssigned": "2018-09-29T06:20:09.21",
"ExpirationDate": "2020-09-29T06:20:09",
"RenewalCount": 1,
"APIApplicationName": "TextPort API Demo App"
}
]
<ArrayOfNumberDetail>
<NumberDetail>
<Number>12135551212</Number>
<DateAssigned>2019-06-21T15:43:19.48</DateAssigned>
<ExpirationDate>2019-09-21T15:43:19</ExpirationDate>
<RenewalCount>2</RenewalCount>
<APIApplicationName>TextPort API Demo App</APIApplicationName>
</NumberDetail>
<NumberDetail>
<Number>12135551214</Number>
<DateAssigned>2018-09-29T06:20:09.21</DateAssigned>
<ExpirationDate>2020-09-29T06:20:09</ExpirationDate>
<RenewalCount>1</RenewalCount>
<APIApplicationName>TextPort API Demo App</APIApplicationName>
</NumberDetail>
</ArrayOfNumberDetail>
Note: The default format for response content is JSON. Adding an HTTP header Accept: application/xml will set the response format to XML.