SMS Gönder
curl --request POST \
--url https://app.whattalk.ai/api/user/sms \
--header 'Content-Type: application/json' \
--data '
{
"from": 123,
"to": "<string>",
"body": "<string>"
}
'import requests
url = "https://app.whattalk.ai/api/user/sms"
payload = {
"from": 123,
"to": "<string>",
"body": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({from: 123, to: '<string>', body: JSON.stringify('<string>')})
};
fetch('https://app.whattalk.ai/api/user/sms', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.whattalk.ai/api/user/sms",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => 123,
'to' => '<string>',
'body' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.whattalk.ai/api/user/sms"
payload := strings.NewReader("{\n \"from\": 123,\n \"to\": \"<string>\",\n \"body\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.whattalk.ai/api/user/sms")
.header("Content-Type", "application/json")
.body("{\n \"from\": 123,\n \"to\": \"<string>\",\n \"body\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.whattalk.ai/api/user/sms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": 123,\n \"to\": \"<string>\",\n \"body\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "SMS sent successfully",
"data": {
"id": 456,
"phone_number_id": 78,
"to": "+1234567890",
"body": "Hello! This is a test message from Your Company. How can we help you today?",
"user_id": 1,
"segments": 1,
"segment_price": 0.0075,
"total_cost": 0.0075,
"status": "sent",
"sms_sid": "SM1234567890abcdef1234567890abcdef",
"created_at": "2025-08-04 15:30:00",
"updated_at": "2025-08-04 15:30:02"
}
}
{
"message": "From number not found"
}
{
"message": "Invalid to phone number"
}
{
"message": "Insufficient balance"
}
{
"message": "From number is not SMS capable"
}
{
"message": "Failed to send SMS",
"error": "Twilio API error details"
}
SMS
SMS Gönder
Telefon numaranızı kullanarak SMS mesajı gönderin
POST
/
user
/
sms
SMS Gönder
curl --request POST \
--url https://app.whattalk.ai/api/user/sms \
--header 'Content-Type: application/json' \
--data '
{
"from": 123,
"to": "<string>",
"body": "<string>"
}
'import requests
url = "https://app.whattalk.ai/api/user/sms"
payload = {
"from": 123,
"to": "<string>",
"body": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({from: 123, to: '<string>', body: JSON.stringify('<string>')})
};
fetch('https://app.whattalk.ai/api/user/sms', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.whattalk.ai/api/user/sms",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => 123,
'to' => '<string>',
'body' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.whattalk.ai/api/user/sms"
payload := strings.NewReader("{\n \"from\": 123,\n \"to\": \"<string>\",\n \"body\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.whattalk.ai/api/user/sms")
.header("Content-Type", "application/json")
.body("{\n \"from\": 123,\n \"to\": \"<string>\",\n \"body\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.whattalk.ai/api/user/sms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": 123,\n \"to\": \"<string>\",\n \"body\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "SMS sent successfully",
"data": {
"id": 456,
"phone_number_id": 78,
"to": "+1234567890",
"body": "Hello! This is a test message from Your Company. How can we help you today?",
"user_id": 1,
"segments": 1,
"segment_price": 0.0075,
"total_cost": 0.0075,
"status": "sent",
"sms_sid": "SM1234567890abcdef1234567890abcdef",
"created_at": "2025-08-04 15:30:00",
"updated_at": "2025-08-04 15:30:02"
}
}
{
"message": "From number not found"
}
{
"message": "Invalid to phone number"
}
{
"message": "Insufficient balance"
}
{
"message": "From number is not SMS capable"
}
{
"message": "Failed to send SMS",
"error": "Twilio API error details"
}
Bu endpoint, satın aldığınız telefon numaralarını kullanarak SMS mesajları göndermenizi sağlar. SMS, Twilio aracılığıyla gönderilir ve maliyetler otomatik olarak hesap bakiyenizden düşülür.
İstek Gövdesi
integer
gerekli
SMS’in gönderileceği telefon numaranızın kimliği (SMS özellikli olmalıdır)
string
gerekli
Alıcının uluslararası formattaki telefon numarası (ör. “+1234567890”)
string
gerekli
SMS mesaj içeriği (maksimum 300 karakter)
Yanıt
string
SMS’in gönderildiğini onaylayan başarı mesajı
object
Göster özellikler
Göster özellikler
integer
SMS kaydının benzersiz tanımlayıcısı
integer
SMS göndermek için kullanılan telefon numarasının kimliği
string
Alıcının E.164 formatındaki telefon numarası
string
SMS mesaj içeriği
integer
SMS’i gönderen kullanıcının kimliği
integer
SMS segment sayısı (faturalandırma amaçlı)
number
SMS segment başına maliyet
number
SMS’in toplam maliyeti (segment_price * segments)
string
SMS’in mevcut durumu
string
İzleme için Twilio SMS SID’i
string
SMS’in oluşturulma tarihi ve saati
string
SMS’in son güncellenme tarihi ve saati
Hata Yanıtları
Göster Hata Yanıtı
Göster Hata Yanıtı
string
Sorunu açıklayan hata mesajı (geçersiz telefon numarası, yetersiz bakiye vb.)
{
"message": "SMS sent successfully",
"data": {
"id": 456,
"phone_number_id": 78,
"to": "+1234567890",
"body": "Hello! This is a test message from Your Company. How can we help you today?",
"user_id": 1,
"segments": 1,
"segment_price": 0.0075,
"total_cost": 0.0075,
"status": "sent",
"sms_sid": "SM1234567890abcdef1234567890abcdef",
"created_at": "2025-08-04 15:30:00",
"updated_at": "2025-08-04 15:30:02"
}
}
{
"message": "From number not found"
}
{
"message": "Invalid to phone number"
}
{
"message": "Insufficient balance"
}
{
"message": "From number is not SMS capable"
}
{
"message": "Failed to send SMS",
"error": "Twilio API error details"
}
Notlar
- Gönderen telefon numarası kimliği doğrulanmış kullanıcıya ait olmalıdır
- Gönderen telefon numarası SMS özellikli olmalıdır
- Telefon numarası aboneliği aktif olmalıdır (süresi dolmamış)
- SMS maliyetlerini karşılamak için yeterli hesap bakiyesi gereklidir
- Telefon numaraları otomatik olarak E.164 formatına dönüştürülür
- SMS maliyetleri hedef ülkeye göre değişir ve segment başına ücretlendirilir
- Uzun mesajlar birden fazla segmente bölünebilir, bu da maliyeti artırır
- Alıcı telefon numarası uluslararası standartlara göre geçerli olmalıdır
⌘I

