| [ Web Proxy ] |
| Viewing: https://docs.httpsms.com | [Back] [Original] |
// 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(); 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));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())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"
}'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",
})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());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());npm install httpsms
# or
yarn install httpsms# install the go package using the "go get" command
go get github.com/NdoleStudio/httpsms-go| Web Proxy Viewer | New URL | Original Page |