SMS senden
curl --request POST \
--url https://app.autocalls.ai/api/user/sms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": 123,
"to": "<string>",
"body": "<string>"
}
'import requests
url = "https://app.autocalls.ai/api/user/sms"
payload = {
"from": 123,
"to": "<string>",
"body": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({from: 123, to: '<string>', body: JSON.stringify('<string>')})
};
fetch('https://app.autocalls.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.autocalls.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 => [
"Authorization: Bearer <token>",
"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.autocalls.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("Authorization", "Bearer <token>")
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.autocalls.ai/api/user/sms")
.header("Authorization", "Bearer <token>")
.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.autocalls.ai/api/user/sms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
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 senden
Eine SMS-Nachricht mit Ihrer Telefonnummer senden
POST
/
user
/
sms
SMS senden
curl --request POST \
--url https://app.autocalls.ai/api/user/sms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": 123,
"to": "<string>",
"body": "<string>"
}
'import requests
url = "https://app.autocalls.ai/api/user/sms"
payload = {
"from": 123,
"to": "<string>",
"body": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({from: 123, to: '<string>', body: JSON.stringify('<string>')})
};
fetch('https://app.autocalls.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.autocalls.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 => [
"Authorization: Bearer <token>",
"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.autocalls.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("Authorization", "Bearer <token>")
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.autocalls.ai/api/user/sms")
.header("Authorization", "Bearer <token>")
.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.autocalls.ai/api/user/sms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
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"
}
Dieser Endpunkt ermöglicht es Ihnen, SMS-Nachrichten mit Ihren gekauften Telefonnummern zu senden. Die SMS wird über Twilio gesendet und die Kosten werden automatisch von Ihrem Kontoguthaben abgezogen.
Anfragekörper
integer
erforderlich
Die ID Ihrer Telefonnummer, von der die SMS gesendet werden soll (muss SMS-fähig sein)
string
erforderlich
Die Telefonnummer des Empfängers im internationalen Format (z. B. “+1234567890”)
string
erforderlich
Der SMS-Nachrichteninhalt (max. 300 Zeichen)
Antwort
string
Erfolgsmeldung, die bestätigt, dass die SMS gesendet wurde
object
Anzeigen Eigenschaften
Anzeigen Eigenschaften
integer
Die eindeutige Kennung des SMS-Datensatzes
integer
Die ID der zum Senden der SMS verwendeten Telefonnummer
string
Die Telefonnummer des Empfängers im E.164-Format
string
Der SMS-Nachrichteninhalt
integer
Die ID des Benutzers, der die SMS gesendet hat
integer
Anzahl der SMS-Segmente (für Abrechnungszwecke)
number
Kosten pro SMS-Segment
number
Gesamtkosten der SMS (segment_price * segments)
string
Der aktuelle Status der SMS
string
Twilio-SMS-SID zur Nachverfolgung
string
Datum und Uhrzeit der Erstellung der SMS
string
Datum und Uhrzeit der letzten Aktualisierung der SMS
Fehlerantworten
Anzeigen Fehlerantwort
Anzeigen Fehlerantwort
string
Fehlermeldung, die das Problem beschreibt (ungültige Telefonnummer, unzureichendes Guthaben usw.)
{
"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"
}
Hinweise
- Die Absender-Telefonnummer muss dem authentifizierten Benutzer gehören
- Die Absender-Telefonnummer muss SMS-fähig sein
- Das Telefonnummern-Abonnement muss aktiv sein (nicht abgelaufen)
- Ausreichendes Kontoguthaben ist erforderlich, um die SMS-Kosten zu decken
- Telefonnummern werden automatisch in das E.164-Format formatiert
- SMS-Kosten variieren je nach Zielland und werden pro Segment berechnet
- Lange Nachrichten können in mehrere Segmente aufgeteilt werden, wodurch die Kosten steigen
- Die Empfänger-Telefonnummer muss den internationalen Standards entsprechen
⌘I
