Ücretsiz Python SMS API Entegrasyonu

Güvenlik, bilgilendirme ve tanıtım mesajlarınız otomatikleştirin. Müşterilerinizi her durumda otomatik olarak gidecek mesajlarla anında haberdar edin, iletişiminiz ve marka değeriniz yükselsin. En çok kullanılan yazılım dillerine göre hazırladığımız örnek kodlarımızı inceleyin.

Python dilinde oluşturduğumuz SMS API servisimizi Toplu SMS Paketleri kullanıcı ad ve şifre bilgilerinizi girerek kolayca sisteminize entegre edebilir ve mesaj gönderimini otomatik hale getirebilirsiniz.


Kod Örnekleri

Sisteminize kolayca entegre edebileceğiniz Python SMS API servisimiz ile müşterilerinize ifre doğrulama, otomatik onay veya bilgi mesajları gönderin. Toplu SMS gönderimi gibi birçok avantaj elde edeceğiniz Python SMS API scripti örnek ve dokümanlarımızı inceleyin.

1 - N

sender olarak hesabınıza tanımlanmış olan gönderici adını göndermelisiniz. Türkçe SMS gnderimi için 'message_type': turkce olarak gönderilmelidir.

İleri tarihli SMS göndermek için datanın içerisine 'send_time' : '2021-05-25 12:00:00' (Y-m-d H:i:s) şeklinde gönderilmedilir. Hemen gönderim yapmak için send_time'ı göndermemelisiniz.

                            
                            
import requests
import json

url = "https://api.toplusmspaketleri.com/api/v1/1toN"

data = json.dumps({
  "api_id" : "sizin api idniz",
  "api_key" : "sizin api keyiniz",
  "sender" : "SMSBASLIGINIZ",
  "message_type" : "turkce",
  "message" : "Bu bir test mesajidir",
  "message_content_type": "bilgi", // ticari smsler için "ticari"
  "phones" : [
    "5xxxxxxxxx"
  ]
})
headers = {'Content-Type': 'application/json'}

response = requests.post(url, headers=headers, data=data, verify=False)

print(response.json())                            
                            

N - N

sender olarak hesabınıza tanımlanmış olan gönderici adını göndermelisiniz. Türkçe SMS gönderimi için 'message_type': turkce olarak gönderilmelidir.

İleri tarihli SMS göndermek için datanın içerisine 'send_time' : '2021-05-25 12:00:00' (Y-m-d H:i:s) şeklinde gönderilmedilir. Hemen gönderim yapmak için send_time'ı göndermemelisiniz.

                            
                            
import requests
import json

url = "https://api.toplusmspaketleri.com/api/v1/NtoN"

data = json.dumps({
  "api_id" : "sizin api idniz",
  "api_key" : "sizin api keyiniz",
  "sender" : "SMSBASLIGINIZ",
  "message_type" : "turkce",
  "message" : "Bu bir test mesajidir",
  "message_content_type": "bilgi", // ticari smsler için "ticari"
  "phones" : [
    {
      "phone" : "5xxxxxxxxx",
      "message" : "Bu bir test mesajidir."
    },
    {
      "phone" : "5xxxxxxxxx",
      "message" : "Bu bir test mesajidir."
    }
  ]
})

headers = {'Content-Type': 'application/json'}

response = requests.post(url, headers=headers, data=data, verify=False)

print(response.json())                            
                            

Gönderici Adı Sorgulama

                            
                            
import requests
import json

url = "https://api.toplusmspaketleri.com/api/v1/senders"

data = json.dumps({
  "api_id" : "sizin api idniz",
  "api_key" : "sizin api keyiniz"
})

headers = {'Content-Type': 'application/json'}

response = requests.post(url, headers=headers, data=data, verify=False)

print(response.json())                            
                            

Kullanıcı Bilgilerini Alma

                            
                            
import requests
import json

url = "https://api.toplusmspaketleri.com/api/v1/user/information"

data = json.dumps({
  "api_id" : "sizin api idniz",
  "api_key" : "sizin api keyiniz"
})

headers = {'Content-Type': 'application/json'}

response = requests.post(url, headers=headers, data=data, verify=False)

print(response.json())                            
                            

Rapor Sorgulama - Rapor Detayı

report_id her SMS gönderimi sonrasında dönen id değeridir.

Eğer datanın sayfalamalı dönmesini istiyorsana url içerisinde page'i göndermeniz gerekmektedir. Sayfalar default olarak 20 şerli dönmektedir. Eğer isterseniz 1-100 arasında bir değeri pageSize'da göndererek değiştirebilirsiniz.

Eğer direkt sayfalamasız olarak bütün datayı almak istemiyorsanız page ve pageSize göndermemelisiniz.

                            
                            
import requests
import json

url = "https://api.toplusmspaketleri.com/api/v1/report/detail?page=1&pageSize=20"

data = json.dumps({
  "api_id" : "sizin api idniz",
  "api_key" : "sizin api keyiniz",
  "report_id" : 12345
})

headers = {'Content-Type': 'application/json'}

response = requests.post(url, headers=headers, data=data, verify=False)

print(response.json())                            
                            

Rapor Sorgulama - Tarih Bazlı

                            
                            
import requests
import json

url = "https://api.toplusmspaketleri.com/api/v1/report/between"

data = json.dumps({
  "api_id" : "sizin api idniz",
  "api_key" : "sizin api keyiniz",
  "start_date" : "2021-05-17 11:22:00",
  "end_date" : "2021-06-17 11:22:00"
})

headers = {'Content-Type': 'application/json'}

response = requests.post(url, headers=headers, data=data, verify=False)

print(response.json())                            
                            

Rapor Sorgulama - Sonuç Sorgusu

report_id her SMS gönderimi sonrasında dönen id değeridir.

                            
                            
import requests
import json

url = "https://api.toplusmspaketleri.com/api/v1/report/single"

data = json.dumps({
  "api_id" : "sizin api idniz",
  "api_key" : "sizin api keyiniz",
  "report_id" : 12345
})

headers = {'Content-Type': 'application/json'}

response = requests.post(url, headers=headers, data=data, verify=False)

print(response.json())