Skip to content
Accueil » API SMS Octopush » Code source API SMS CSHARP

Code source API SMS CSHARP

Fichier de configuration

namespace ConsoleApplicationTestSmsSend
 {
     class ConfigData
     {
         public String user_login = « ** ** ** ** ** * @ ** ** * . ** *»;
         public String api_key = « ** ** ** ** ** ** ** ** ** ** **»;
         public String[] sms_recipients = {«+33600000000»
         };
         public String sms_text = «test text»;
         public String sms_type = QUALITE_PRO;
         public String sms_mode = INSTANTANE;
         public String sms_sender = «Octopush»;
     }
 }

Fichier Main

namespace ConsoleApplicationTestSmsSend
 {
     class SendSMS
     {
         static void Main(string[] args)
         {
             SMS sms = new SMS();
             ConfigData configData = new ConfigData();
             sms.set_user_login(configData.user_login);
             sms.set_api_key(configData.api_key);
             sms.set_sms_type(configData.sms_type);
             sms.set_sms_recipients(configData.sms_recipients);
             sms.set_sms_text(configData.sms_text);
             sms.set_sms_mode(configData.sms_mode);
             string msg = sms.send(configData.DOMAIN, configData.PATH_SMS, configData.PORT);
         }
     }
 }

Objet Principal