C# Toplu SMS API Kodları

C# ile TOPLU SMS API Kod ve Hazır Script Örnekleri

  • C# - XML POST - BİR MESAJI ÇOK KİŞİYE GÖNDERME
     private void gonder_Click(object sender, EventArgs e)
            {
                //kno.Text= MÜŞTERİ NUMARASI
                //kad.Text= KULLANICI ADI
                //ksifre.Text= ŞİFRE
                //orjinator.Text= ORJİNATÖR (ONAYLI VE TAM DOĞRU OLMALIDIR)
                
                //xml içerisinde aşağıdaki gibi değerleri gönderebilirsiniz..
                //<zaman>2014-04-17 08:30:00</zaman>//sms gitmeye başlama zamanı 
                //<zamanasimi>2014-04-17 10:30:00</zamanasimi>//son gönderim deneme zamanı 
                string tur="Normal";
                if (turkce.Checked==true)tur="Turkce";
                string sms1N = "data=<sms><kno>" + kno.Text + "</kno><kulad>" + kad.Text + "</kulad><sifre>" + ksifre.Text + "</sifre>" +
                    "<gonderen>" + orjinator.Text + "</gonderen>" +
                    "<mesaj>" + mesaj.Text + "</mesaj>" +
                    "<numaralar>" + numaralar.Text + "</numaralar>" +
                    "<tur>" + tur + "</tur></sms>";
                cevap.Text = XmlPost("http://panel.vatansms.com/panel/smsgonder1Npost.php", sms1N);
            }
    
            private string XmlPost(string PostAddress, string xmlData)
            {
                using (WebClient wUpload = new WebClient())
                {
                    wUpload.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
                    Byte[] bPostArray = Encoding.UTF8.GetBytes(xmlData);
                    Byte[] bResponse = wUpload.UploadData(PostAddress, "POST", bPostArray);
                    Char[] sReturnChars = Encoding.UTF8.GetChars(bResponse);
                    string sWebPage = new string(sReturnChars);
                    return sWebPage; 
                }        
            }
    
  • C# - XML POST - N MESAJI N KİŞİYE GÖNDERME
    private void gonder_Click(object sender, EventArgs e)
            {
                //kno.Text= MÜŞTERİ NUMARASI
                //kad.Text= KULLANICI ADI
                //ksifre.Text= ŞİFRE
                //orjinator.Text= ORJİNATÖR (ONAYLI VE TAM DOĞRU OLMALIDIR)
                
                //xml içerisinde aşağıdaki gibi değerleri gönderebilirsiniz..
                //<zaman>2014-04-17 08:30:00</zaman>//sms gitmeye başlama zamanı 
                //<zamanasimi>2014-04-17 10:30:00</zamanasimi>//son gönderim deneme zamanı 
                string tur = "Normal";
                if (turkce.Checked == true) tur = "Turkce";
                string smsNN = "data=<sms><kno>" + kno.Text + "</kno><kulad>" + kad.Text + "</kulad><sifre>" + ksifre.Text + "</sifre>" +
                "<gonderen>" + orjinator.Text + "</gonderen>" +
                "<telmesajlar>" +
                "<telmesaj><tel>" + numara1.Text + "</tel><mesaj>" + mesaj1.Text + "</mesaj></telmesaj>" +
                "<telmesaj><tel>" + numara2.Text + "</tel><mesaj>" + mesaj2.Text + "</mesaj></telmesaj>" +
                "</telmesajlar>" +
                "<tur>" + tur + "</tur></sms>";
                cevap.Text = XmlPost("http://panel.vatansms.com/panel/smsgonderNNpost.php", smsNN);
            }
            private string XmlPost(string PostAddress, string xmlData)
            {
                using (WebClient wUpload = new WebClient())
                {
                    wUpload.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
                    Byte[] bPostArray = Encoding.UTF8.GetBytes(xmlData);
                    Byte[] bResponse = wUpload.UploadData(PostAddress, "POST", bPostArray);
                    Char[] sReturnChars = Encoding.UTF8.GetChars(bResponse);
                    string sWebPage = new string(sReturnChars);
                    return sWebPage;
                }
            }
    
  • C# - XML POST - RAPORLAMA İŞLEMLERİ
    private string XmlPost(string PostAddress, string xmlData)
            {
                using (WebClient wUpload = new WebClient())
                {
                    wUpload.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
                    Byte[] bPostArray = Encoding.UTF8.GetBytes(xmlData);
                    Byte[] bResponse = wUpload.UploadData(PostAddress, "POST", bPostArray);
                    Char[] sReturnChars = Encoding.UTF8.GetChars(bResponse);
                    string sWebPage = new string(sReturnChars);
                    return sWebPage;
                }
            }
    
            private void sorgula_Click(object sender, EventArgs e)
            {
                //kad.Text= KULLANICI ADI
                //ksifre.Text= ŞİFRE
                
                string smsRapor = "data=<smsrapor><kulad>" + kad.Text + "</kulad><sifre>" + ksifre.Text + "</sifre>" +
                "<ozelkod>" + ozelkod.Text + "</ozelkod></smsrapor>";
                cevap.Text = XmlPost("http://panel.vatansms.com/panel/smstakippost.php", smsRapor);
            }
    


  • C# - WERSERVIS - TÜM İŞLEMLER
  • WebServis URL: http://panel.vatansms.com/webservis/service.php?wsdl
    Projenize WebReferences olarak bu URLyi girdiğinizde tüm işlemlere erişim sağlanmaktadır. İndirme merkezinden örnek projeleri indirerek direkt kullanmaya başlayabilirsiniz.

    Aşağıdan WebServisin XML çıktısına göz atabilirsiniz...
    This XML file does not appear to have any style information associated with it. The document tree is shown below.
    <definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:OztekSmsWebService" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:OztekSmsWebService">
    <types>
    <xsd:schema targetNamespace="urn:OztekSmsWebService">
    <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
    <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/>
    </xsd:schema>
    </types>
    <message name="TekSmsiBirdenCokNumarayaGonderRequest">
    <part name="kullanicino" type="xsd:integer"/>
    <part name="kullaniciadi" type="xsd:string"/>
    <part name="sifre" type="xsd:string"/>
    <part name="orjinator" type="xsd:string"/>
    <part name="numaralar" type="xsd:string"/>
    <part name="mesaj" type="xsd:string"/>
    <part name="zaman" type="xsd:DateTime"/>
    <part name="zamanasimi" type="xsd:DateTime"/>
    <part name="tip" type="xsd:string"/>
    </message>
    <message name="TekSmsiBirdenCokNumarayaGonderResponse">
    <part name="return" type="xsd:string"/>
    </message>
    <message name="HerBirNumarayaFarkliSmsGonderRequest">
    <part name="kullanicino" type="xsd:integer"/>
    <part name="kullaniciadi" type="xsd:string"/>
    <part name="sifre" type="xsd:string"/>
    <part name="orjinator" type="xsd:string"/>
    <part name="numaramesaj" type="xsd:string"/>
    <part name="zaman" type="xsd:DateTime"/>
    <part name="zamanasimi" type="xsd:DateTime"/>
    <part name="tip" type="xsd:string"/>
    </message>
    <message name="HerBirNumarayaFarkliSmsGonderResponse">
    <part name="return" type="xsd:string"/>
    </message>
    <message name="SmsiptaletRequest">
    <part name="kullanicino" type="xsd:integer"/>
    <part name="kullaniciadi" type="xsd:string"/>
    <part name="sifre" type="xsd:string"/>
    <part name="ozelid" type="xsd:string"/>
    </message>
    <message name="SmsiptaletResponse">
    <part name="return" type="xsd:string"/>
    </message>
    <message name="OrjinatorGonderRequest">
    <part name="kullanicino" type="xsd:integer"/>
    <part name="kullaniciadi" type="xsd:string"/>
    <part name="sifre" type="xsd:string"/>
    <part name="orjinator" type="xsd:string"/>
    <part name="aciklama" type="xsd:string"/>
    </message>
    <message name="OrjinatorGonderResponse">
    <part name="return" type="xsd:string"/>
    </message>
    <message name="RaporSorgulaRequest">
    <part name="kullanicino" type="xsd:integer"/>
    <part name="kullaniciadi" type="xsd:string"/>
    <part name="sifre" type="xsd:string"/>
    <part name="ozelid" type="xsd:string"/>
    <part name="numara" type="xsd:string"/>
    </message>
    <message name="RaporSorgulaResponse">
    <part name="return" type="xsd:string"/>
    </message>
    <message name="UyeBilgisiSorgulaRequest">
    <part name="kullanicino" type="xsd:integer"/>
    <part name="kullaniciadi" type="xsd:string"/>
    <part name="sifre" type="xsd:string"/>
    </message>
    <message name="UyeBilgisiSorgulaResponse">
    <part name="return" type="xsd:string"/>
    </message>
    <message name="OrjinatorSorgulaRequest">
    <part name="kullanicino" type="xsd:integer"/>
    <part name="kullaniciadi" type="xsd:string"/>
    <part name="sifre" type="xsd:string"/>
    <part name="orjinator" type="xsd:string"/>
    </message>
    <message name="OrjinatorSorgulaResponse">
    <part name="return" type="xsd:string"/>
    </message>
    <message name="GunlukRaporSorgulaRequest">
    <part name="kullanicino" type="xsd:integer"/>
    <part name="kullaniciadi" type="xsd:string"/>
    <part name="sifre" type="xsd:string"/>
    <part name="tarih" type="xsd:Date"/>
    </message>
    <message name="GunlukRaporSorgulaResponse">
    <part name="return" type="xsd:string"/>
    </message>
    <message name="ikitariharasisorgulaXMLverRequest">
    <part name="kullanicino" type="xsd:integer"/>
    <part name="kullaniciadi" type="xsd:string"/>
    <part name="sifre" type="xsd:string"/>
    <part name="baslangictarih" type="xsd:Date"/>
    <part name="bitistarih" type="xsd:Date"/>
    </message>
    <message name="ikitariharasisorgulaXMLverResponse">
    <part name="return" type="xsd:string"/>
    </message>
    <portType name="OztekSmsWebServicePortType">
    <operation name="TekSmsiBirdenCokNumarayaGonder">
    <documentation>
    Aciklama bir adet sabit mesaj bir yada birden cok kisiye gonderilir. Örneğin 5354447711,5415524155,5457851144... bu numaralara bir seferde "Merhabalar sayin musterimiz" Şeklinde sms yollayabilirsiniz. <br> Zaman:yyyy-mm-dd hh-dd-ss
    </documentation>
    <input message="tns:TekSmsiBirdenCokNumarayaGonderRequest"/>
    <output message="tns:TekSmsiBirdenCokNumarayaGonderResponse"/>
    </operation>
    <operation name="HerBirNumarayaFarkliSmsGonder">
    <documentation>
    Aciklama: Her bir mesaj farklı kullanicilara iletilme durumudur. Musteriye ozel mesaj yada benzeri durumlarda kullanilir. Ornek gonderim: <br>{[5354447711][Merhaba bu ilk kisiye gideecek mesaj]}<br>{[5415524155][Bu da ikinci kisiye gidecek olan mesaj]}
    </documentation>
    <input message="tns:HerBirNumarayaFarkliSmsGonderRequest"/>
    <output message="tns:HerBirNumarayaFarkliSmsGonderResponse"/>
    </operation>
    <operation name="Smsiptalet">
    <documentation>
    ileri tarihli gonderilen smsleri iptal etmek icin kullaniniz
    </documentation>
    <input message="tns:SmsiptaletRequest"/>
    <output message="tns:SmsiptaletResponse"/>
    </operation>
    <operation name="OrjinatorGonder">
    <documentation>
    Uzerinize kayitli kullaniciya yeni bir Orjinator tanimlama islemidir. 11 karakterden az belgeleyebileceginiz ve turkce karakter icermeyen gonderen adi gonderiniz
    </documentation>
    <input message="tns:OrjinatorGonderRequest"/>
    <output message="tns:OrjinatorGonderResponse"/>
    </operation>
    <operation name="RaporSorgula">
    <documentation>
    Mesaj gonderiminde sonlanan id den sonraki zamanlarda gidisatini sorgulama servisidir.
    </documentation>
    <input message="tns:RaporSorgulaRequest"/>
    <output message="tns:RaporSorgulaResponse"/>
    </operation>
    <operation name="UyeBilgisiSorgula">
    <documentation>
    Kullanicinin Uye bilgilerini ve kalan kontor sayisini verir
    </documentation>
    <input message="tns:UyeBilgisiSorgulaRequest"/>
    <output message="tns:UyeBilgisiSorgulaResponse"/>
    </operation>
    <operation name="OrjinatorSorgula">
    <documentation>Gonderilen Orjinatorun durumunu sorgular</documentation>
    <input message="tns:OrjinatorSorgulaRequest"/>
    <output message="tns:OrjinatorSorgulaResponse"/>
    </operation>
    <operation name="GunlukRaporSorgula">
    <documentation>
    yyyy-MM-dd formatinda verilen gun icersindeki tum mesajlariniz durumlariyla beraber listelenir. Bu durum zaman alabilir.
    </documentation>
    <input message="tns:GunlukRaporSorgulaRequest"/>
    <output message="tns:GunlukRaporSorgulaResponse"/>
    </operation>
    <operation name="ikitariharasisorgulaXMLver">
    <documentation>
    yyyy-MM-dd formatinda verilen 2 tarih arasında ki tum mesajlariniz durumlariyla beraber listelenir. Bu durum zaman alabilir.
    </documentation>
    <input message="tns:ikitariharasisorgulaXMLverRequest"/>
    <output message="tns:ikitariharasisorgulaXMLverResponse"/>
    </operation>
    </portType>
    <binding name="OztekSmsWebServiceBinding" type="tns:OztekSmsWebServicePortType">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="TekSmsiBirdenCokNumarayaGonder">
    <soap:operation soapAction="urn:testnamespace#TekSmsiBirdenCokNumarayaGonder" style="rpc"/>
    <input>
    <soap:body use="encoded" namespace="urn:TekSmsiBirdenCokNumarayaGonder" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </input>
    <output>
    <soap:body use="encoded" namespace="urn:TekSmsiBirdenCokNumarayaGonder" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </output>
    </operation>
    <operation name="HerBirNumarayaFarkliSmsGonder">
    <soap:operation soapAction="urn:testnamespace#HerBirNumarayaFarkliSmsGonder" style="rpc"/>
    <input>
    <soap:body use="encoded" namespace="urn:HerBirNumarayaFarkliSmsGonder" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </input>
    <output>
    <soap:body use="encoded" namespace="urn:HerBirNumarayaFarkliSmsGonder" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </output>
    </operation>
    <operation name="Smsiptalet">
    <soap:operation soapAction="urn:testnamespace#Smsiptalet" style="rpc"/>
    <input>
    <soap:body use="encoded" namespace="urn:Smsiptalet" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </input>
    <output>
    <soap:body use="encoded" namespace="urn:Smsiptalet" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </output>
    </operation>
    <operation name="OrjinatorGonder">
    <soap:operation soapAction="urn:testnamespace#OrjinatorGonder" style="rpc"/>
    <input>
    <soap:body use="encoded" namespace="urn:OrjinatorGonder" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </input>
    <output>
    <soap:body use="encoded" namespace="urn:OrjinatorGonder" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </output>
    </operation>
    <operation name="RaporSorgula">
    <soap:operation soapAction="urn:testnamespace#RaporSorgula" style="rpc"/>
    <input>
    <soap:body use="encoded" namespace="urn:RaporSorgula" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </input>
    <output>
    <soap:body use="encoded" namespace="urn:RaporSorgula" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </output>
    </operation>
    <operation name="UyeBilgisiSorgula">
    <soap:operation soapAction="urn:testnamespace#UyeBilgisiSorgula" style="rpc"/>
    <input>
    <soap:body use="encoded" namespace="urn:UyeBilgisiSorgula" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </input>
    <output>
    <soap:body use="encoded" namespace="urn:UyeBilgisiSorgula" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </output>
    </operation>
    <operation name="OrjinatorSorgula">
    <soap:operation soapAction="urn:testnamespace#OrjinatorSorgula" style="rpc"/>
    <input>
    <soap:body use="encoded" namespace="urn:OrjinatorSorgula" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </input>
    <output>
    <soap:body use="encoded" namespace="urn:OrjinatorSorgula" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </output>
    </operation>
    <operation name="GunlukRaporSorgula">
    <soap:operation soapAction="urn:testnamespace#GunlukRaporSorgula" style="rpc"/>
    <input>
    <soap:body use="encoded" namespace="urn:GunlukRaporSorgula" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </input>
    <output>
    <soap:body use="encoded" namespace="urn:GunlukRaporSorgula" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </output>
    </operation>
    <operation name="ikitariharasisorgulaXMLver">
    <soap:operation soapAction="urn:testnamespace#ikitariharasisorgulaXMLver" style="rpc"/>
    <input>
    <soap:body use="encoded" namespace="urn:ikitariharasisorgulaXMLver" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </input>
    <output>
    <soap:body use="encoded" namespace="urn:ikitariharasisorgulaXMLver" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </output>
    </operation>
    </binding>
    <service name="OztekSmsWebService">
    <port name="OztekSmsWebServicePort" binding="tns:OztekSmsWebServiceBinding">
    <soap:address location="http://panel.vatansms.com/webservis/service.php"/>
    </port>
    </service>
    </definitions>