برای خرید سامانه پیامک همین الان در پیامک آموت ثبت نام کنید
متد وب سرویس
محاسبه هزینه پیامک (CalculateMessagePrice)
آخرین بروزرسانی
دوشنبه 6 دی 1400 10:44
Loading
آدرس وب سرویس
non-wsdl
wsdl
متد CalculateMessagePrice
از طریق این متد می توانید با وارد کردن متن پیامک به همراه شماره خط ارسال و شماره های دریافت کنندگان هزینه ارسال خود را محاسبه نمایید.
Loading
نام | نوع | توضیحات |
UserName | String الزامی | نام کاربری شما در سامانه پیامک آموت |
Password | String الزامی | رمز عبور شما در سامانه پیامک آموت |
SMSMessageText | String الزامی | متن پیامک |
LineNumber | String الزامی | شماره خط |
Mobiles | Object الزامی | لیست موبایل های دریافت کنندگان پیامک |
Loading
نام | نوع | توضیحات |
ReturnValue | Int | |
Loading
string UserName = "MyUserName";
string Password = "MyPassword";
string SMSMessageText = "پیامک تستی من";
string LineNumber = "public";
string[] Mobiles = new string[]
{
"9120000000",
"9150000000",
};
SMS.WebService2SoapClient client = new SMS.WebService2SoapClient("WebService2Soap12");
int result = client.CalculateMessagePrice(UserName, Password, SendDateTime,
$url = "https://portal.amootsms.com/webservice2.asmx/CalculateMessagePrice_REST";
$url = $url."?"."UserName=".urlencode("MyUserName");
$url = $url."&"."Password=".urlencode("MyPassword");
$SMSMessageText = urlencode("پیامک تستی من");
$url = $url."&"."SMSMessageText =".$SMSMessageText ;
$url = $url."&"."LineNumber=public";
$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";
$parameters['SMSMessageText'] = "پیامک تستی من";
$parameters['LineNumber'] = "public";
$parameters['Mobiles'] =array("9120000000", "9150000000");
$result = $sms_client->CalculateMessagePrice($parameters)->CalculateMessagePriceResult;
echo $result;