ENDPOINT REFERENCE
Endpointler ve çalışan kod örnekleri
Örnekler TEST yollarını kullanır. LIVE için yalnız /test → /api değiştirin. C#, PHP, Python ve Node örneklerinde authentication dahil edilmiştir.
Request
{"phone":"900000000001","template_key":"activation","verification_code":"123456"}
Success response
{"success":true,"request_id":"req_example","status":"accepted","message_id":"msg_example"}
Errors / durumlar: 400 INVALID_REQUEST / INVALID_PHONE / UNSUPPORTED_CALLING_CODE / MESSAGE_TOO_LONG · 402 INSUFFICIENT_SMS_CREDIT · 403 SERVICE_MODE_NOT_ALLOWED / TEMPLATE_NOT_ALLOWED / TEMPLATE_DISABLED · 409 IDEMPOTENCY_CONFLICT / IDEMPOTENCY_IN_PROGRESS · 429 RATE_LIMIT_EXCEEDED / API_UNIT_LIMIT_EXCEEDED / SECURITY_RATE_LIMITED · 422 PROVIDER_REJECTED (TEST/LIVE); TEST ayrıca PROVIDER_TIMEOUT/UNAVAILABLE · LIVE 503 PROVIDER_TIMEOUT / PROVIDER_UNAVAILABLE / GATEWAY_NOT_CONFIGURED · 500 INTERNAL_ERROR
curl
curl --fail-with-body -X POST "${BASE_URL}/test/send" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: example-unique-001" \
--data '{"phone":"900000000001","template_key":"activation","verification_code":"123456"}'
PHP
$ch = curl_init($baseUrl . '/test/send');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json', 'Idempotency-Key: example-unique-001'],
CURLOPT_POSTFIELDS => '{"phone":"900000000001","template_key":"activation","verification_code":"123456"}'
]);
$response = curl_exec($ch);
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
Python
response = requests.post(base_url + '/test/send', headers={'Authorization': 'Bearer ' + api_key, 'Idempotency-Key': 'example-unique-001'}, json={"phone":"900000000001","template_key":"activation","verification_code":"123456"}, timeout=10)
data = response.json()
C# (.NET)
using var request = new HttpRequestMessage(HttpMethod.Post, baseUrl + "/test/send");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
request.Headers.TryAddWithoutValidation("Idempotency-Key", "example-unique-001");
request.Content = new StringContent(@"{""phone"":""900000000001"",""template_key"":""activation"",""verification_code"":""123456""}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();
JavaScript / Node.js 18+
const response = await fetch(baseUrl + '/test/send', {
method: 'POST',
headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json', 'Idempotency-Key': 'example-unique-001' },
body: JSON.stringify({"phone":"900000000001","template_key":"activation","verification_code":"123456"})
});
const data = await response.json();
Postman
POST {{baseUrl}}/test/send · Authorization: Bearer izinli API Key · templateKey=activation örneğini key için izin verilen template ile değiştirin.
n8n HTTP Request
HTTP Request node
Method: POST
URL: {{$env.SMSGONDER_BASE_URL}}/test/send
Header: Authorization = Bearer {{$env.SMSGONDER_API_KEY}}
Header: Idempotency-Key = {{$json.idempotency_key}}
Body Content Type: JSON
JSON Body: {"phone":"900000000001","template_key":"activation","verification_code":"123456"}
Request
{"message_id":"msg_example"}
Success response
{"success":true,"request_id":"req_example","message_id":"msg_example","status":"delivered","environment":"test","provider_report_available":true,"live":true,"status_updated_at":"2026-09-04T10:00:00Z","checked_at":"2026-09-04T10:00:01Z"}
Errors / durumlar: 403 REPORT_DISABLED · 404 MESSAGE_NOT_FOUND · 429 RATE_LIMIT_EXCEEDED / SECURITY_RATE_LIMITED · LIVE 503 GATEWAY_NOT_CONFIGURED · provider query timeout/unavailable normally appears inside HTTP 200 report_error
curl
curl --fail-with-body -X POST "${BASE_URL}/test/report" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
--data '{"message_id":"msg_example"}'
PHP
$ch = curl_init($baseUrl . '/test/report');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"message_id":"msg_example"}'
]);
$response = curl_exec($ch);
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
Python
response = requests.post(base_url + '/test/report', headers={'Authorization': 'Bearer ' + api_key}, json={"message_id":"msg_example"}, timeout=10)
data = response.json()
C# (.NET)
using var request = new HttpRequestMessage(HttpMethod.Post, baseUrl + "/test/report");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
request.Content = new StringContent(@"{""message_id"":""msg_example""}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();
JavaScript / Node.js 18+
const response = await fetch(baseUrl + '/test/report', {
method: 'POST',
headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"message_id":"msg_example"})
});
const data = await response.json();
Postman
POST {{baseUrl}}/test/report · Authorization: Bearer izinli API Key · templateKey=activation örneğini key için izin verilen template ile değiştirin.
n8n HTTP Request
HTTP Request node
Method: POST
URL: {{$env.SMSGONDER_BASE_URL}}/test/report
Header: Authorization = Bearer {{$env.SMSGONDER_API_KEY}}
Body Content Type: JSON
JSON Body: {"message_id":"msg_example"}
POST/api/otp/create/test/otp/createOTP Verification create
Requires OTP_VERIFICATION permission. Generates a secure OTP using the API Key code policy, sends it once and returns opaque otp_id. The customer never receives the generated LIVE code from this endpoint.
Request
{"phone":"900000000001","template_key":"activation"}
Success response
{"success":true,"request_id":"req_example","status":"accepted","otp_id":"otp_example","message_id":"msg_example","expires_in":300,"max_attempts":5}
Errors / durumlar: 400 INVALID_REQUEST / INVALID_PHONE / UNSUPPORTED_CALLING_CODE / MESSAGE_TOO_LONG · 402 INSUFFICIENT_SMS_CREDIT · 403 SERVICE_MODE_NOT_ALLOWED / TEMPLATE_NOT_ALLOWED / TEMPLATE_DISABLED · 409 IDEMPOTENCY_CONFLICT / IDEMPOTENCY_IN_PROGRESS · 429 RATE_LIMIT_EXCEEDED / API_UNIT_LIMIT_EXCEEDED / SECURITY_RATE_LIMITED · 422 PROVIDER_REJECTED (TEST/LIVE); TEST ayrıca PROVIDER_TIMEOUT/UNAVAILABLE · LIVE 503 PROVIDER_TIMEOUT / PROVIDER_UNAVAILABLE / GATEWAY_NOT_CONFIGURED · 500 INTERNAL_ERROR
curl
curl --fail-with-body -X POST "${BASE_URL}/test/otp/create" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: example-unique-001" \
--data '{"phone":"900000000001","template_key":"activation"}'
PHP
$ch = curl_init($baseUrl . '/test/otp/create');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json', 'Idempotency-Key: example-unique-001'],
CURLOPT_POSTFIELDS => '{"phone":"900000000001","template_key":"activation"}'
]);
$response = curl_exec($ch);
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
Python
response = requests.post(base_url + '/test/otp/create', headers={'Authorization': 'Bearer ' + api_key, 'Idempotency-Key': 'example-unique-001'}, json={"phone":"900000000001","template_key":"activation"}, timeout=10)
data = response.json()
C# (.NET)
using var request = new HttpRequestMessage(HttpMethod.Post, baseUrl + "/test/otp/create");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
request.Headers.TryAddWithoutValidation("Idempotency-Key", "example-unique-001");
request.Content = new StringContent(@"{""phone"":""900000000001"",""template_key"":""activation""}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();
JavaScript / Node.js 18+
const response = await fetch(baseUrl + '/test/otp/create', {
method: 'POST',
headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json', 'Idempotency-Key': 'example-unique-001' },
body: JSON.stringify({"phone":"900000000001","template_key":"activation"})
});
const data = await response.json();
Postman
POST {{baseUrl}}/test/otp/create · Authorization: Bearer izinli API Key · templateKey=activation örneğini key için izin verilen template ile değiştirin.
n8n HTTP Request
HTTP Request node
Method: POST
URL: {{$env.SMSGONDER_BASE_URL}}/test/otp/create
Header: Authorization = Bearer {{$env.SMSGONDER_API_KEY}}
Header: Idempotency-Key = {{$json.idempotency_key}}
Body Content Type: JSON
JSON Body: {"phone":"900000000001","template_key":"activation"}
Request
{"otp_id":"otp_example","verification_code":"123456"}
Success response
{"success":true,"request_id":"req_example","otp_id":"otp_example","status":"verified"}
Errors / durumlar: 400 INVALID_REQUEST · 404 OTP_NOT_FOUND · 409 IDEMPOTENCY_CONFLICT / IDEMPOTENCY_IN_PROGRESS · 429 RATE_LIMIT_EXCEEDED / API_UNIT_LIMIT_EXCEEDED / SECURITY_RATE_LIMITED · 500 INTERNAL_ERROR. locked/expired are response status values, not HTTP errors.
curl
curl --fail-with-body -X POST "${BASE_URL}/test/otp/check" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: example-unique-001" \
--data '{"otp_id":"otp_example","verification_code":"123456"}'
PHP
$ch = curl_init($baseUrl . '/test/otp/check');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json', 'Idempotency-Key: example-unique-001'],
CURLOPT_POSTFIELDS => '{"otp_id":"otp_example","verification_code":"123456"}'
]);
$response = curl_exec($ch);
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
Python
response = requests.post(base_url + '/test/otp/check', headers={'Authorization': 'Bearer ' + api_key, 'Idempotency-Key': 'example-unique-001'}, json={"otp_id":"otp_example","verification_code":"123456"}, timeout=10)
data = response.json()
C# (.NET)
using var request = new HttpRequestMessage(HttpMethod.Post, baseUrl + "/test/otp/check");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
request.Headers.TryAddWithoutValidation("Idempotency-Key", "example-unique-001");
request.Content = new StringContent(@"{""otp_id"":""otp_example"",""verification_code"":""123456""}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();
JavaScript / Node.js 18+
const response = await fetch(baseUrl + '/test/otp/check', {
method: 'POST',
headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json', 'Idempotency-Key': 'example-unique-001' },
body: JSON.stringify({"otp_id":"otp_example","verification_code":"123456"})
});
const data = await response.json();
Postman
POST {{baseUrl}}/test/otp/check · Authorization: Bearer izinli API Key · templateKey=activation örneğini key için izin verilen template ile değiştirin.
n8n HTTP Request
HTTP Request node
Method: POST
URL: {{$env.SMSGONDER_BASE_URL}}/test/otp/check
Header: Authorization = Bearer {{$env.SMSGONDER_API_KEY}}
Header: Idempotency-Key = {{$json.idempotency_key}}
Body Content Type: JSON
JSON Body: {"otp_id":"otp_example","verification_code":"123456"}
POST/api/hosted/create/test/hosted/createHosted OTP create
Requires HOSTED_OTP permission. Creates a Hosted OTP session. return_url must exactly match the API Key allowlist; path, query and trailing slash are significant. Terminal result is posted back with HMAC signature.
Request
{"phone":"900000000001","template_key":"activation","return_url":"https://client.example/otp-return","state":"order-000001"}
Success response
{"success":true,"request_id":"req_example","status":"accepted","transaction_id":"hotp_example","message_id":"msg_example","hosted_url":"https://www.smsgonder.com.tr/test/otp/token","expires_in":300}
Errors / durumlar: 400 INVALID_REQUEST / INVALID_RETURN_URL / INVALID_PHONE / UNSUPPORTED_CALLING_CODE / MESSAGE_TOO_LONG · 402 INSUFFICIENT_SMS_CREDIT · 403 SERVICE_MODE_NOT_ALLOWED / TEMPLATE_NOT_ALLOWED / TEMPLATE_DISABLED · 409 idempotency errors · 429 request/unit/security limits · 422 PROVIDER_REJECTED (TEST/LIVE); TEST ayrıca PROVIDER_TIMEOUT/UNAVAILABLE · LIVE 503 PROVIDER_TIMEOUT / PROVIDER_UNAVAILABLE / GATEWAY_NOT_CONFIGURED · 500 INTERNAL_ERROR
curl
curl --fail-with-body -X POST "${BASE_URL}/test/hosted/create" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: example-unique-001" \
--data '{"phone":"900000000001","template_key":"activation","return_url":"https://client.example/otp-return","state":"order-000001"}'
PHP
$ch = curl_init($baseUrl . '/test/hosted/create');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json', 'Idempotency-Key: example-unique-001'],
CURLOPT_POSTFIELDS => '{"phone":"900000000001","template_key":"activation","return_url":"https://client.example/otp-return","state":"order-000001"}'
]);
$response = curl_exec($ch);
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
Python
response = requests.post(base_url + '/test/hosted/create', headers={'Authorization': 'Bearer ' + api_key, 'Idempotency-Key': 'example-unique-001'}, json={"phone":"900000000001","template_key":"activation","return_url":"https://client.example/otp-return","state":"order-000001"}, timeout=10)
data = response.json()
C# (.NET)
using var request = new HttpRequestMessage(HttpMethod.Post, baseUrl + "/test/hosted/create");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
request.Headers.TryAddWithoutValidation("Idempotency-Key", "example-unique-001");
request.Content = new StringContent(@"{""phone"":""900000000001"",""template_key"":""activation"",""return_url"":""https://client.example/otp-return"",""state"":""order-000001""}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();
JavaScript / Node.js 18+
const response = await fetch(baseUrl + '/test/hosted/create', {
method: 'POST',
headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json', 'Idempotency-Key': 'example-unique-001' },
body: JSON.stringify({"phone":"900000000001","template_key":"activation","return_url":"https://client.example/otp-return","state":"order-000001"})
});
const data = await response.json();
Postman
POST {{baseUrl}}/test/hosted/create · Authorization: Bearer izinli API Key · templateKey=activation örneğini key için izin verilen template ile değiştirin.
n8n HTTP Request
HTTP Request node
Method: POST
URL: {{$env.SMSGONDER_BASE_URL}}/test/hosted/create
Header: Authorization = Bearer {{$env.SMSGONDER_API_KEY}}
Header: Idempotency-Key = {{$json.idempotency_key}}
Body Content Type: JSON
JSON Body: {"phone":"900000000001","template_key":"activation","return_url":"https://client.example/otp-return","state":"order-000001"}
Success response
{"success":true,"request_id":"req_example","environment":"test","sms_credits":999,"reserved_sms_credits":0,"package":"Test Sandbox"}
Errors / durumlar: 401 INVALID_API_KEY · 403 API_KEY_DISABLED / ACCOUNT_SUSPENDED / ACCOUNT_CLOSED / SOURCE_IP_NOT_ALLOWED · 429 RATE_LIMIT_EXCEEDED / SECURITY_RATE_LIMITED · 500 INTERNAL_ERROR
curl
curl --fail-with-body \
-H "Authorization: Bearer ${API_KEY}" \
"${BASE_URL}/test/balance"
PHP
$ch = curl_init($baseUrl . '/test/balance');
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey]]);
$response = curl_exec($ch);
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
Python
response = requests.get(base_url + '/test/balance', headers={'Authorization': 'Bearer ' + api_key}, timeout=10)
response.raise_for_status()
data = response.json()
C# (.NET)
using var request = new HttpRequestMessage(HttpMethod.Get, baseUrl + "/test/balance");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
using var response = await client.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();
JavaScript / Node.js 18+
const response = await fetch(baseUrl + '/test/balance', {
method: 'GET',
headers: { 'Authorization': `Bearer ${apiKey}` }
});
const data = await response.json();
Postman
GET {{baseUrl}}/test/balance · Authorization: Bearer izinli API Key · templateKey=activation örneğini key için izin verilen template ile değiştirin.
n8n HTTP Request
HTTP Request node
Method: GET
URL: {{$env.SMSGONDER_BASE_URL}}/test/balance
Header: Authorization = Bearer {{$env.SMSGONDER_API_KEY}}
GET/api/usage/test/usageUsage
Reads account-aggregate request and Unit counters for second, minute, hour and Turkey-time day. The call itself is metered as a request.
Success response
{"success":true,"request_id":"req_example","environment":"test","package":"Test Sandbox","units":{"second":{"used":0,"limit":20},"minute":{"used":0,"limit":600},"hour":{"used":0,"limit":10000},"day":{"used":0,"limit":100000}},"requests":{"second":{"used":1,"limit":10},"minute":{"used":1,"limit":300},"hour":{"used":1,"limit":5000},"day":{"used":1,"limit":50000}}}
Errors / durumlar: 401 INVALID_API_KEY · 403 API_KEY_DISABLED / ACCOUNT_SUSPENDED / ACCOUNT_CLOSED / SOURCE_IP_NOT_ALLOWED · 429 RATE_LIMIT_EXCEEDED / SECURITY_RATE_LIMITED · 500 INTERNAL_ERROR
curl
curl --fail-with-body \
-H "Authorization: Bearer ${API_KEY}" \
"${BASE_URL}/test/usage"
PHP
$ch = curl_init($baseUrl . '/test/usage');
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey]]);
$response = curl_exec($ch);
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
Python
response = requests.get(base_url + '/test/usage', headers={'Authorization': 'Bearer ' + api_key}, timeout=10)
response.raise_for_status()
data = response.json()
C# (.NET)
using var request = new HttpRequestMessage(HttpMethod.Get, baseUrl + "/test/usage");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
using var response = await client.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();
JavaScript / Node.js 18+
const response = await fetch(baseUrl + '/test/usage', {
method: 'GET',
headers: { 'Authorization': `Bearer ${apiKey}` }
});
const data = await response.json();
Postman
GET {{baseUrl}}/test/usage · Authorization: Bearer izinli API Key · templateKey=activation örneğini key için izin verilen template ile değiştirin.
n8n HTTP Request
HTTP Request node
Method: GET
URL: {{$env.SMSGONDER_BASE_URL}}/test/usage
Header: Authorization = Bearer {{$env.SMSGONDER_API_KEY}}