Getting Started | httpSMS
Copy
POST /v1/messages/send HTTP/1.1
Host: api.httpsms.com
x-api-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 273
{
"attachments": [
"https://example.com/image.jpg",
"https://example.com/video.mp4"
],
"content": "This is a sample text message",
"encrypted": false,
"from": "+18005550199",
"request_id": "153554b5-ae44-44a0-8f4f-7bbac5657ad4",
"send_at": "2025-12-19T16:39:57-08:00",
"to": "+18005550100"
}Copy
{
"data": {
"attachments": [
"https://example.com/image.jpg",
"https://example.com/video.mp4"
],
"contact": "+18005550100",
"content": "This is a sample text message",
"created_at": "2022-06-05T14:26:02.302718+03:00",
"delivered_at": "2022-06-05T14:26:09.527976+03:00",
"encrypted": false,
"expired_at": "2022-06-05T14:26:09.527976+03:00",
"failed_at": "2022-06-05T14:26:09.527976+03:00",
"failure_reason": "UNKNOWN",
"id": "32343a19-da5e-4b1b-a767-3298a73703cb",
"last_attempted_at": "2022-06-05T14:26:09.527976+03:00",
"max_send_attempts": 1,
"order_timestamp": "2022-06-05T14:26:09.527976+03:00",
"owner": "+18005550199",
"received_at": "2022-06-05T14:26:09.527976+03:00",
"request_id": "153554b5-ae44-44a0-8f4f-7bbac5657ad4",
"request_received_at": "2022-06-05T14:26:01.520828+03:00",
"scheduled_at": "2022-06-05T14:26:09.527976+03:00",
"scheduled_send_time": "2022-06-05T14:26:09.527976+03:00",
"send_attempt_count": 0,
"send_time": 133414,
"sent_at": "2022-06-05T14:26:09.527976+03:00",
"sim": "DEFAULT",
"status": "pending",
"type": "mobile-terminated",
"updated_at": "2022-06-05T14:26:10.303278+03:00",
"user_id": "WB7DRDWrJZRGbYrv2CKGkqbzvqdC"
},
"message": "Request handled successfully",
"status": "success"
}Copy
// initialize guzzle client https://github.com/guzzle/guzzle
$client = new GuzzleHttp\Client();
$apiKey = "Get API Key from https://httpsms.com/settings";
$res = $client->request('POST', 'https://api.httpsms.com/v1/messages/send', [
'headers' => [
'x-api-key' => $apiKey,
],
'json' => [
'content' => 'This is a sample text message',
'from' => "+18005550199",
'to' => '+18005550100'
]
]);
echo $res->getBody(); Copy
let apiKey = "Get API Key from https://httpsms.com/settings";
fetch('https://api.httpsms.com/v1/messages/send', {
method: 'POST',
headers: {
'x-api-key': apiKey,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"content": "This is a sample text message",
"from": "+18005550199",
"to": "+18005550100"
})
})
.then(res => res.json())
.then((data) => console.log(data));Copy
import requests
import json
api_key = "Get API Key from https://httpsms.com/settings"
url = 'https://api.httpsms.com/v1/messages/send'
headers = {
'x-api-key': api_key,
'Accept': 'application/json',
'Content-Type': 'application/json'
}
payload = {
"content": "This is a sample text message",
"from": "+18005550199",
"to": "+18005550100"
}
response = requests.post(url, headers=headers, data=json.dumps(payload))
print(response.json())Copy
curl --location --request POST 'https://api.httpsms.com/v1/messages/send' \
--header 'x-api-key: Get API Key from https://httpsms.com/settings' \
--header 'Content-Type: application/json' \
--data-raw '{
"from": "+18005550199",
"to": "+18005550100",
"content": "This is a sample text message"
}'Copy
import "github.com/NdoleStudio/httpsms-go"
client := htpsms.New(htpsms.WithAPIKey(/* API Key from https://httpsms.com/settings */))
client.Messages.Send(context.Background(), &httpsms.MessageSendParams{
Content: "This is a sample text message",
From: "+18005550199",
To: "+18005550100",
})Copy
var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", ""/* Get API Key from https://httpsms.com/settings */);
var response = await client.PostAsync(
"https://api.httpsms.com/v1/messages/send",
new StringContent(
JsonSerializer.Serialize(new {
from = "+18005550199",
To = "+18005550100",
Content = "This is a sample text message",
}),
Encoding.UTF8,
"application/json"
)
);
Console.WriteLine(await response.Content.ReadAsStringAsync());Copy
var client = HttpClient.newHttpClient();
var apiKey = "Get API Key from https://httpsms.com/settings";
JSONObject request = new JSONObject();
request.put("content", "This is a sample text message");
request.put("from", "+18005550199")
request.put("to", "+18005550100")
// create a request
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.httpsms.com/v1/messages/send"))
.header("accept", "application/json")
.header("x-api-key", apiKey)
.setEntity(new StringEntity(request.toString()))
.POST()
.build();
// use the client to send the request
var response = client.send(request, new JsonBodyHandler<>(APOD.class));
// the response:
System.out.println(response.body().get());Copy
npm install httpsms
# or
yarn install httpsmsCopy
# install the go package using the "go get" command
go get github.com/NdoleStudio/httpsms-go