1 TÜRKHOST WEBSERVİSLERİ API URL http://smsportal.turkhost.net.tr/index.php?app=ws Parameterler Listed in the below table are webservices for individual tasks. Parametre h u p op from to footer nofooter msg schedule type unicode queue src dst dt smslog_id last c kwd login_key query webservices token, configured by user from Preferences menu username password, supplied for op=get_token operation or type of action output selection SMS sender ID (for op=pv) destination numbers, @username or #groupcode, may use commas SMS footer (for op=pv) remove SMS footer message (+ or %20 for spaces, urlencode for non ascii chars) schedule message delivery, : YYYY-MM-DD hh:mm:ss message type (flash or text) whether message unicode or not (1=unicode, 0=not unicode) queue code sender number or ID destination number (single number) send SMS date/time SMS Log ID last SMS log ID (this number not included on result) number of delivery status that will be retrieved keyword login key sets by admin through webservices call op=loginkeyset query server for useful inion
2 Admin Protokolü görevleri için Webservis i Parametre recvnum smsc data_* receiver number (for op=inject) SMSC (for op=inject) admin tasks related supplied data Lütfen tüm değerlerin URL encode yapılmış olmasını dikkat edin. Dönüş Kodları Below table listed return coded after unsuccessful call to a webservices operation. Successful operation will returns an OK data in the response message. Please note that by default the response message is a JSON encoded message. Hata Kodları ERR 100 ERR 101 ERR 102 ERR 103 ERR 104 ERR 105 ERR 106 ERR 200 ERR 201 ERR 400 ERR 401 ERR 402 ERR 501 ERR 600 ERR 601 ERR 602 ERR 603 ERR 604 ERR 605 ERR 606 ERR 607 ERR 608 ERR 609 ERR 610 ERR 611 authentication failed type of action is invalid or unknown one or more field empty not enough credit for this operation webservice token is not available webservice token not enable for this user webservice token not allowed from this IP address send message failed destination number or message is empty no delivery status available no delivery status retrieved and SMS still in queue no delivery status retrieved and SMS has been processed from queue no data returned or result is empty admin level authentication failed inject message failed sender id or message is empty account addition failed due to missing data fail to add account account removal failed due to unknown username fail to remove account set parent failed due to unknown username fail to set parent get parent failed due to unknown username fail to get parent account ban failed due to unknown username
3 Hata Kodları ERR 612 ERR 613 ERR 614 ERR 615 ERR 616 ERR 617 ERR 618 ERR 619 ERR 620 ERR 621 ERR 622 ERR 623 ERR 624 ERR 625 ERR 626 fail to ban account account unban failed due to unknown username fail to unban account editing account preferences failed due to missing data fail to edit account preferences editing account configuration failed due to missing data fail to edit account configuration viewing credit failed due to missing data fail to view credit adding credit failed due to missing data fail to add credit deducting credit failed due to missing data fail to deduct credit setting login key failed due to missing data fail to set login key İleride yeni hata kodları eklenebilir bu kodlar sürekli değişebilir genel olarak hata kodları sıralamassı aşağıdadır: Hata Kodu ERR 1xx ERR 2xx ERR 4xx ERR 5xx ERR 6xx authentication or parameter erorrs specific pv errors delivery status errors others administrative tasks Admin protokolü dışındaki görevler SMS Gönderme SMS gönderme bir veya birden fazla mobil numara için, @username veya #groupcode İsim veya lar pv u h to msg type unicode from footer nofooter Parametre uluslararası biçimlendirilmiş cep telefonu numarası, #groupcode veya @ KullanıcıAdı veya bunların bir karışımı olabilir. Birden fazla değer için virgül ile ayırın.
4 Gönderilen Smslerin Teslim Durumu Giden Sms Listesi ve teslimat durumunu. ds u h queue src dst dt smslog_id c last data or Parameter c will retrieve as many as c value, last will retrieves data from last SMS log ID. Kredi İşlemleri Kullanıcı kredi bilgilerini alma. cr u h user's credit or Get token Oturum açma mekanızması için kullanıcılarınızın webservis token bilgilerini alma get_token u p webservices token or Set token Oturum açma mekanızması için kullanıcılarınıza webservis token oluşturma. set_token u h new webservices token or
5 Adres Defteri Listeleme Adres defteri sorgulama isim, mobil numara veya email get_contact u h kwd c list of contacts similar or the same as kwd or Adres Defteri Gruplarını Listleme Grup kodunu veya ismini getirir get_contact_group u h kwd c list of contact groups similar or the same as kwd or Webservislerine Giriş (login) İşlemi Authenticate user via webservices and redirect to index.php upon authentication, successful or failed or invalid ws_login u login_key none none, web redirect to index.php Parameter login_key is set by admin accounts through webservices call using operation loginkeyset Query Query server for useful inion such as user's data, user's credit, last smslog_id for inbox, incoming and outgoing SMS query u h server's inion
6 Admin için Görev Protokolü Inject message Inject message to the system inject u h from msg recvnum smsc Injected message will be treated as a valid incoming SMS. Yeni Kullanıcı Ekleme accountadd u h data_status data_username data_password data_name data_email data_parent data_mobile data_datetime_timezone data_language_module and info Notlar: most mandatory and optional query are prefixed with data_ data_status 2 is for admin level account data_status 3 is for user level account data_status 4 is for subuser level account data_parent may need to be set when adding subuser level account Kullanıcı Silme accountremove and info Alt kullanıcılarınız için Yönetici Tanımlama parentset data_parent
7 Alt kullanıcılarınız için Yönetici Getirme parentget and data parent Kullanıcı Ban İşlemi accountban Kullanıcı Ban Kaldırma accountunban Kullanıcı Tercihlerini Güncelleme accountpref data_name data_email data_mobile data_address data_city data_state data_country data_zipcode data_password and info Notlar: most mandatory and optional query are prefixed with data_ this command may be used to update account's password
8 Kullanıcı Ayarlarını Güncelleme accountconf data_footer datetime_timezone data_language_module data_fwd_to_inbox data_fwd_to_email data_fwd_to_mobile data_local_length data_replace_zero data_sender and info Notlar: most mandatory and optional query are prefixed with data_ this command may be used to update account's default sender ID only valid sender ID may be selected data_fwd_to_inbox data_fwd_to_email data_fwd_to_mobile are boolean variables, fill with 0 to disable and 1 to enable data_local_length used to detect local destination number by its length data_replace_zero is a numeric only prefix number to replace prefix 0 Akont Kredisini Getir creditview and balance Akont Kredi Ekleme creditadd data_amount, updated balance and amount Kredi düşürme creditdeduct data_amount, updated balance and amount Login key Oluşturma Set login key for an account loginkeyset and login key
9 Örnekler SMS Gönderme Örnek Webservis URL: http://smsportal.turkhost.net.tr/index.php?app=ws&u=kullaniciadiniz&h=a45a02791b2fe2fedb078c39fd83637 a&op=pv&to=905320000000&msg=test+only : Türkhost SMS Websislerini için operasyonu op sms gönderim kodu pv login olabilmek için username u, webservis token h gönderileck numara to 905320000000, mesaj kodu msg 'test only' ve çıktı varsayılan olarak, JSON ındadır. JSON ında dönen kod OK ise gönderim başarılıdır: Örnek dönüş kodu {"data":[{"status":"ok","error":"0","smslog_id":"30","queue":"afb5f34575e30ec4efe4471cf5d1bee4","to": "0987654321"}],"error_string":null} Örnek Adres Defteri Listesi Örnek Webservis URL: http://www.turkhost.net.tr/index.php?app=ws&u=kullaniciadi&h=482ac0069592c647289e52dfef88be68&op=get_ contact&kwd=ali : Operasyon op get_contact hangi kullanciya ait liste getirilecek ise o kullanıcı adı u and webservis token h aranacak veri kwd. Dönen sonuç JSON ında olacaktır JSON ında başarılı bi sorgulama sonucu: {"status":"ok","error":"0","data":[{"pid":"13674","gpid":"2","p_desc":"ali Alkan","p_num":"08901230659","email":"","group_name":"Test Group","code":"TESTGROUP"}],"multi":true}