API Dokümantasyon
Numara satın alma ve SMS alımı süreçlerini otomatikleştirmek için API'mizi kullanın.
Nasıl başlanır
API, SMS-Activate protokolü ile uyumludur: yazılımınız bununla zaten çalışıyorsa ayarlarındaki host’u değiştirmeniz yeterli. Tüm istekler tek bir adrese GET ile gider, işlem ise action parametresiyle iletilir.
Adres
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getBalanceAnahtar api_key parametresiyle iletilir. Hesabınızdaki «API Erişimi» bölümünden oluşturabilirsiniz.
Hesabın güncel bakiyesi.
Yanıtlar
ACCESS_BALANCE:100.5
{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Deneyin
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getBalanceNumara satın alır ve bakiyeden düşer. Aktivasyon ID’si döner — durumu bununla sorarsınız. Tarifeyi biz seçeriz: maxPrice sınırı içinde ucuzdan pahalıya doğru deneriz, numara bulunana kadar. NO_NUMBERS yalnızca hiçbir sağlayıcıda numara kalmadığında döner.
Parametreler
servicestringzorunlugetServicesList’ten alınan hizmet kodu.countryintegerzorunlugetCountries’ten alınan ülke ID’si.maxPricenumberFiyat tavanı. Bunun üzerinde numara satın alınmaz; belirtilmezse en ucuz tarife kullanılır.Yanıtlar
Номер куплен
ACCESS_NUMBER:123456:+79001234567
Номеров нет
NO_NUMBERS
{
"title": "WRONG_MAX_PRICE",
"details": "The maximum price is less than the permitted price",
"info": {
"min": 0.5
}
}{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "NO_BALANCE",
"details": "Payment Required"
}{
"title": "CHANNELS_LIMIT",
"details": "You have reached the maximum number of concurrent threads (purchases) allowed for your account. Contact the technical support."
}{
"title": "UNPROCESSABLE_ENTITY",
"details": "Validation failed",
"info": {
"field": "service",
"code": "REQUIRED",
"message": "Param 'service' is required."
}
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Deneyin
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getNumberBu işlem veriyi değiştirir ve para harcar, bu yüzden bu sayfadan çalıştırılamaz. Adresi kopyalayıp kendi kodunuzdan çağırın.
getNumber ile aynı, ancak yanıt bir nesne olarak gelir. Parametreler ve hatalar aynıdır.
Parametreler
servicestringzorunlugetServicesList’ten alınan hizmet kodu.countryintegerzorunlugetCountries’ten alınan ülke ID’si.maxPricenumberFiyat tavanı. Bunun üzerinde numara satın alınmaz; belirtilmezse en ucuz tarife kullanılır.Yanıtlar
Номер куплен
{
"activationId": "123456",
"phoneNumber": "+79001234567",
"activationCost": 0.5,
"currency": 840,
"countryCode": 123,
"canGetAnotherSms": true,
"activationTime": "2026-07-17T12:00:00+00:00",
"activationEndTime": "2026-07-17T12:20:00+00:00",
"activationOperator": "any"
}Номеров нет — приходит строкой
NO_NUMBERS
{
"title": "WRONG_MAX_PRICE",
"details": "The maximum price is less than the permitted price",
"info": {
"min": 0.5
}
}{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "NO_BALANCE",
"details": "Payment Required"
}{
"title": "UNPROCESSABLE_ENTITY",
"details": "Validation failed",
"info": {
"field": "service",
"code": "REQUIRED",
"message": "Param 'service' is required."
}
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Deneyin
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getNumberV2Bu işlem veriyi değiştirir ve para harcar, bu yüzden bu sayfadan çalıştırılamaz. Adresi kopyalayıp kendi kodunuzdan çağırın.
Aktivasyonun güncel durumu. Kod, STATUS_OK içinde iki noktadan sonra gelir.
Parametreler
idintegerzorunluAktivasyon ID’si — getNumber’ın döndürdüğü değer.Yanıtlar
Ждём SMS
STATUS_WAIT_CODE
Ждём повторную SMS
STATUS_WAIT_RESEND
Код получен
STATUS_OK:123456
Активация отменена
STATUS_CANCEL
{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "NOT_FOUND",
"details": "Activation Not Found"
}{
"title": "UNPROCESSABLE_ENTITY",
"details": "Validation failed",
"info": {
"field": "service",
"code": "REQUIRED",
"message": "Param 'service' is required."
}
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Deneyin
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getStatusgetStatus ile aynı, ancak SMS metni ve zamanıyla birlikte. SMS gelene kadar yanıt, getStatus’taki gibi düz metin olarak döner.
Parametreler
idintegerzorunluAktivasyon ID’si — getNumber’ın döndürdüğü değer.Yanıtlar
Код получен
{
"verificationType": 1,
"sms": {
"dateTime": "2026-07-17 12:05:00",
"code": "123456",
"text": "Your code is 123456"
}
}SMS ещё нет — приходит строкой
STATUS_WAIT_CODE
{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "NOT_FOUND",
"details": "Activation Not Found"
}{
"title": "UNPROCESSABLE_ENTITY",
"details": "Validation failed",
"info": {
"field": "service",
"code": "REQUIRED",
"message": "Param 'service' is required."
}
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Deneyin
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getStatusV2Yeniden SMS ister, aktivasyonu tamamlar veya iade ederek iptal eder.
Parametreler
idintegerzorunluAktivasyon ID’si — getNumber’ın döndürdüğü değer.statusintegerzorunlu3 — yeniden SMS iste, 6 — aktivasyonu tamamla, 8 — iptal et ve iade al.Yanıtlar
status=3
ACCESS_RETRY_GET
status=6
ACCESS_ACTIVATION
status=8
ACCESS_CANCEL
{
"title": "BAD_STATUS",
"details": "Wrong status code"
}{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "NOT_FOUND",
"details": "Activation Not Found"
}Отменять ещё рано
{
"title": "EARLY_CANCEL_DENIED",
"details": "Activation cannot be cancelled at this time. Minimum activation period must pass."
}Код уже пришёл — отмена невозможна
{
"title": "OTP_RECEIVED",
"details": "Cannot terminate activation - OTP has been received on this number"
}Активация уже завершена
{
"title": "ACTIVATION_NOT_ACTIVE",
"details": "Activation is terminated/refunded and Otp cannot be retrieved"
}{
"title": "UNPROCESSABLE_ENTITY",
"details": "Validation failed",
"info": {
"field": "service",
"code": "REQUIRED",
"message": "Param 'service' is required."
}
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Deneyin
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=setStatusBu işlem veriyi değiştirir ve para harcar, bu yüzden bu sayfadan çalıştırılamaz. Adresi kopyalayıp kendi kodunuzdan çağırın.
setStatus status=6 ile aynı. Başarılı olduğunda gövdesiz 204 döner.
Parametreler
idintegerzorunluAktivasyon ID’si — getNumber’ın döndürdüğü değer.Yanıtlar
{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "NOT_FOUND",
"details": "Activation Not Found"
}{
"title": "ACTIVATION_NOT_ACTIVE",
"details": "Activation is terminated/refunded and Otp cannot be retrieved"
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Deneyin
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=finishActivationBu işlem veriyi değiştirir ve para harcar, bu yüzden bu sayfadan çalıştırılamaz. Adresi kopyalayıp kendi kodunuzdan çağırın.
setStatus status=8 ile aynı: aktivasyonu iptal eder ve parayı iade eder. Başarılı olduğunda gövdesiz 204 döner.
Parametreler
idintegerzorunluAktivasyon ID’si — getNumber’ın döndürdüğü değer.Yanıtlar
{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "NOT_FOUND",
"details": "Activation Not Found"
}Отменять ещё рано
{
"title": "EARLY_CANCEL_DENIED",
"details": "Activation cannot be cancelled at this time. Minimum activation period must pass."
}Код уже пришёл
{
"title": "OTP_RECEIVED",
"details": "Cannot terminate activation - OTP has been received on this number"
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Deneyin
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=cancelActivationBu işlem veriyi değiştirir ve para harcar, bu yüzden bu sayfadan çalıştırılamaz. Adresi kopyalayıp kendi kodunuzdan çağırın.
Fiyatlar ve numara adetleri: ülke → hizmet → tarife. Ülke başına en ucuz fiyat gösterilir.
Parametreler
servicestringgetServicesList’ten alınan hizmet kodu.countryintegergetCountries’ten alınan ülke ID’si.Yanıtlar
Цены получены
{
"123": {
"tg": {
"cost": 0.5,
"count": 200,
"physicalCount": 200
}
}
}Неизвестный сервис
{
"status": "false",
"msg": "service is incorrect"
}Неизвестная страна
{
"status": "false",
"msg": "country is incorrect"
}Неверный ключ — строкой
BAD_KEY
Deneyin
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getPricesSatın almaya açık ülkeler. id alanı, getNumber’a iletilen değerdir.
Yanıtlar
[
{
"id": 123,
"rus": "Казахстан",
"eng": "Казахстан",
"chn": "Казахстан",
"visible": 1,
"retry": 1
}
]Неверный ключ — строкой
BAD_KEY
Deneyin
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getCountriesSatın almaya açık hizmetler. code alanı, getNumber’a iletilen değerdir.
Yanıtlar
{
"status": "success",
"services": [
{
"code": "tg",
"name": "Telegram"
}
]
}Неверный ключ — строкой
BAD_KEY
Deneyin
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getServicesListŞu anda SMS bekleyen numaralar.
Parametreler
startintegerListenin başından kayma; getHistory’de ise dönemin başlangıcı (Unix timestamp).limitintegerKaç kayıt döneceği, en fazla 100.Yanıtlar
{
"status": "success",
"data": [
{
"activationId": "123456",
"serviceCode": "tg",
"phoneNumber": "+79001234567",
"activationCost": 0.5,
"activationStatus": "4",
"smsCode": null,
"smsText": null,
"activationTime": "2026-07-17 12:00:00",
"discount": "0.00",
"repeated": "0",
"countryCode": "123",
"countryName": "Казахстан",
"canGetAnotherSms": "1",
"currency": 840
}
]
}{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Deneyin
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getActiveActivationsTamamlanan ve iptal edilenler dahil tüm aktivasyonlarınız.
Parametreler
startintegerListenin başından kayma; getHistory’de ise dönemin başlangıcı (Unix timestamp).endintegerDönemin sonu, Unix timestamp.offsetintegerListenin başından kayma.sizeintegerKaç kayıt döneceği, en fazla 100.Yanıtlar
[
{
"id": "123456",
"date": "2026-07-17 12:00:00",
"phone": "+79001234567",
"sms": "Your code is 123456",
"cost": 0.5,
"status": "6",
"currency": 840
}
]{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Deneyin
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getHistoryNumaraya gelen mesajlar.
Parametreler
idintegerzorunluAktivasyon ID’si — getNumber’ın döndürdüğü değer.sizeintegerKaç kayıt döneceği, en fazla 100.pageintegerSayfa numarası, birden başlar.Yanıtlar
{
"data": [
{
"id": "1",
"phoneFrom": "Telegram",
"code": "123456",
"text": "Your code is 123456",
"service": "tg",
"date": "2026-07-17T12:05:00+00:00",
"type": "sms"
}
],
"meta": {
"total": 1,
"service": "tg"
}
}{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "NOT_FOUND",
"details": "Activation Not Found"
}{
"title": "ACTIVATION_NOT_ACTIVE",
"details": "Activation is terminated/refunded and Otp cannot be retrieved"
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Deneyin
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getAllSms