List Senders
A list of all senders may be obtained using this endpoint. For emphasis on specific results, you can add filters based on sender status, either approved or not approved.
Last updated
A list of all senders may be obtained using this endpoint. For emphasis on specific results, you can add filters based on sender status, either approved or not approved.
Last updated
GET
https://sms.textcus.com/api/v2/senders
Authorization: Bearer API_KEY
Parameters | Type | Description |
---|---|---|
<?php
$url = 'https://sms.textcus.com/api/v2/senders';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer API_KEY' // Replace 'API_KEY' with your actual API key
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
const axios = require('axios');
const config = {
method: 'get',
url: `https://sms.textcus.com/api/v2/senders`,
headers: {
'Authorization': 'Bearer API_KEY' // Replace 'API_KEY' with your actual API key
}
};
axios(config).then(function(response) {
console.log(JSON.stringify(response.data));
}).catch(function(error) {
console.error(error);
});
import requests
url = f'https://sms.textcus.com/api/v2/senders'
headers = {
"Authorization": "Bearer API_KEY" # Replace 'API_KEY' with your actual API key
}
try:
response = requests.get(url, headers=headers)
print(response.json())
except requests.exceptions.RequestException as e:
print(e)
import 'dart:convert';
import 'package:http/http.dart' as http;
void main() async {
String url = 'https://sms.textcus.com/api/v2/senders';
try {
final response = await http.get(
Uri.parse(url),
headers: {
'Authorization': 'Bearer API_KEY', // Replace 'API_KEY' with your actual API Key
},
);
if (response.statusCode == 200) {
// If the server returns an OK response, parse the JSON
print(response.body);
} else {
// If the server did not return a 200 OK response, throw an exception.
print('Failed to load balance. Status code: ${response.statusCode}');
}
} catch (e) {
print('Error: $e');
}
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpHeaders;
import java.net.http.HttpResponse.BodyHandlers;
public class CheckBalance {
public static void main(String[] args) {
String url = "https://sms.textcus.com/api/v2/senders/";
try {
// Create HttpClient
HttpClient client = HttpClient.newHttpClient();
// Build the GET request
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer API_KEY") // Replace 'API_KEY' with your actual API Key
.GET()
.build();
// Send the request and get the response
HttpResponse<String> response = client.send(request, BodyHandlers.ofString());
// Check if the request was successful
if (response.statusCode() == 200) {
System.out.println("Response: " + response.body());
} else {
System.out.println("Failed to retrieve balance. Status code: " + response.statusCode());
System.out.println("Response: " + response.body());
}
} catch (Exception e) {
System.out.println("Error: " + e.getMessage());
}
}
}
Imports System.Net.Http
Imports System.Threading.Tasks
Module Module1
Sub Main()
Dim url As String = "https://sms.textcus.com/api/v2/senders"
Dim response As String = GetApiResponseAsync(url, apiKey).GetAwaiter().GetResult()
Console.WriteLine(response)
End Sub
Async Function GetApiResponseAsync(url As String, apiKey As String) As Task(Of String)
Using client As New HttpClient()
client.DefaultRequestHeaders.Add("Authorization", "Bearer " & apiKey) ' Replace 'API_KEY' with your actual API key
Dim response As HttpResponseMessage = Await client.GetAsync(url)
If response.IsSuccessStatusCode Then
Return Await response.Content.ReadAsStringAsync()
Else
Return "Error: " & response.StatusCode.ToString()
End If
End Using
End Function
End Module
{
"status": 200,
"message": "Senders retrieved",
"data": {
"sender_name": "TextCus",
"status": "yes"
},
...
}
{
"status": 401,
"error": "Authentication invalid"
},
{
"status": 401,
"error": "Unauthorized: Invalid API Key"
}
apikey
string
Required
Your unique API key is required to retrieve your TextCus Sender IDs