نمونه کد برای ارسال پیامک
const string username = "username";
const string password = "password";
const string from = "5000...";
const string to = "09123456789";
const string text = "تست وب سرویس سات اس ام اس";
const bool isFlash = false;
SendSoapClient soapClient = new SendSoapClient();
soapClient.SendSimpleSMS2(username, password, to, from, text, isFlash);
//یا برای ارسال به مجموعه ای از مخاطبین
soapClient.SendSimpleSMS(username, password, new string[] { to }, from, text, isFlash);
از آنجا که وب سرویس سات اس ام اس تنها محدود به ارسال پیامک نیست شما از طریق زیر میتوانید به وب سرویس ها دسترسی کامل داشته باشید:
// وب سرویس پیامک
RestClient restClient = new RestClient(username, password);
SendSoapClient soapClient = new SendSoapClient();
// وب سرویس تیکت پشتیبانی
TicketsSoapClient ticketSoapClient = new TicketsSoapClient();
// وب سرویس برای مدیریت کامل ارسال انبوه پیامک
ActionsSoapClient actionSoapClient = new ActionsSoapClient();
//وب سرویس کاربران
UsersSoapClient usersSoapClient = new UsersSoapClient();
//وب سرویس دفترچه تلفن
ContactsSoapClient contactSoapClient = new ContactsSoapClient();
//وب سرویس زمان بندی
ScheduleSoapClient scheduleSoapClient = new ScheduleSoapClient();
//وب سرویس پیام صوتی
VoiceSoapClient voiceSoapClient = new VoiceSoapClient();
//وب سرویس دریافت
ReceiveSoapClient receiveSoapClient = new ReceiveSoapClient();
ارسال
restClient.Send(to, from, text, isFlash);
soapClient.SendSimpleSMS(username, password, new string[] { to }, from, text, isFlash);
ارسال از خط خدماتی اشتراکی
restClient.SendByBaseNumber(text, to, bodyId);
soapClient.SendByBaseNumber2(username, password, text, to, bodyId);
ریافت وضعیت ارسال
restClient.GetDelivery(recId);
soapClient.GetDelivery(recId);
soapClient.GetDeliveries(recIds[], username, password);
لیست پیامک ها
restClient.GetMessages(location, index, count, from);
soapClient.getMessages(username, password, location, from, index, count);
// جهت دریافت به صورت رشته ای
receiveSoapClient.GetMessagesByDate(username, password, location, from, index, count, dateFrom, dateTo);
//جهت دریافت بر اساس تاریخ
receiveSoapClient.GetUsersMessagesByDate(username, password, location, from, index, count, dateFrom, dateTo);
// جهت دریافت پیام های کاربران بر اساس تاریخ
موجودی
restClient.GetCredit();
soapClient.GetCredit(username, password);
تعرفه پایه / دریافت قیمت قبل از ارسال
restClient.GetBasePrice();
soapClient.GetSmsPrice(username, password, irancellCount, mtnCount, from, text);
لیست شماره اختصاصی
usersSoapClient.GetUserNumbers(username, password);
بررسی تعداد پیامک های دریافتی
soapClient.GetInboxCount(username, password, isRead);
//پیش فرض خوانده نشده
ارسال پیامک پیشرفته
soapClient.SendSms(username, password, to[], from, text, isflash, udh, recId[], status[]);
مشاهده مشخصات پیام
receiveSoapClient.GetMessagesReceptions(username, password, msgId, fromRows);
حذف پیام دریافتی
receiveSoapClient.RemoveMessages2(username, password, location, msgIds);
تماس انبوه زماندار با انتخاب فایل
voiceSoapClient.SendBulkVoiceSMS(username, password, title, fileId, receivers, DateToSend, repeatCount);