ارسال با گارانتی خط تبلیغاتی (SendWithBackupLine)

برای خرید سامانه پیامک همین الان در پیامک آموت ثبت نام کنید

متد وب سرویس ارسال با گارانتی خط تبلیغاتی (SendWithBackupLine)

آخرین بروزرسانی دوشنبه 6 دی 1400 10:56
Loading

متد SendWithBackupLine

از طریق این متد می توانید پیامک های خود را با گارانتی خط تبلیغاتی (98) ارسال نمایید ، در صورتی که شماره دریافت کننده در لیست سیاه باشد از طریق خط تبلیغاتی (98) به ایشان ارسال انجام میگردد.

پارامترهای ورودی

Loading
نام نوع توضیحات
UserNameString الزامینام کاربری شما در سامانه پیامک آموت
PasswordString الزامیرمز عبور شما در سامانه پیامک آموت
SendDateTimeObject الزامیزمان ارسال پیامک
SMSMessageTextString الزامیمتن پیامک
LineNumberString الزامیشماره خط
BackupLineNumberString الزامیشماره خط پشتیبان
MobilesObject الزامیلیست موبایل های دریافت کنندگان پیامک

مقدار خروجی

Loading
نام نوع توضیحات
ReturnValueObject

نمونه کد

Loading
string UserName = "MyUserName";
string Password = "MyPassword";
DateTime SendDateTime = DateTime.Now;
string SMSMessageText = "پیامک تستی من";
string LineNumber = "public";
string BackupLineNumber = "98";
string[] Mobiles = new string[]
{
"9120000000",
"9150000000",
};

SMS.WebService2SoapClient client = new SMS.WebService2SoapClient("WebService2Soap12");

SMS.SendResult result = client.SendWithBackupLine(UserName, Password, SendDateTime, SMSMessageText, LineNumber, BackupLineNumber, Mobiles);

if (result.Status == SMS.Status.Success)
{
    //خروجی
}
$url = "https://portal.amootsms.com/webservice2.asmx/SendWithBackupLine_REST";

$url = $url."?"."UserName=".urlencode("MyUserName");
$url = $url."&"."Password=".urlencode("MyPassword");

$nowIran = new DateTime('now', new DateTimeZone('IRAN'));
$url = $url."&"."SendDateTime=".urlencode($nowIran->format('c'));

$url = $url."&"."SMSMessageText=".urlencode("پیامک تستی من");
$url = $url."&"."LineNumber=public";
$url = $url."&"."BackupLineNumber=98";

$url = $url."&"."Mobiles=9120000000,9150000000";

$json = file_get_contents($url);
echo $json;

//$result = json_decode($json);
//echo $result->Status;
ini_set("soap.wsdl_cache_enabled", "0");

$sms_client = new SoapClient('https://portal.amootsms.com/webservice2.asmx?wsdl', array('encoding'=>'UTF-8'));

$parameters['UserName'] = "MyUserName";
$parameters['Password'] = "MyPassword";

$nowIran = new DateTime('now', new DateTimeZone('IRAN'));
$parameters['SendDateTime'] = $nowIran->format('c');

$parameters['SMSMessageText'] = "پیامک تستی من";
$parameters['LineNumber'] = "public";
$parameters['BackupLineNumber'] = "98";
$parameters['Mobiles'] =array("9120000000", "9150000000");

$result = $sms_client->SendWithBackupLine($parameters)->SendWithBackupLineResult;
echo $result;