ارسال از طریق بانک اطلاعاتی (SendBank)

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

متد وب سرویس ارسال از طریق بانک اطلاعاتی (SendBank)

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

متد SendBank

از طریق این متد می توانید پیامک های خود را با استفاده از بانک های اطلاعاتی موجود در سامانه ارسال نمایید.

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

Loading
نام نوع توضیحات
UserNameString الزامینام کاربری شما در سامانه پیامک آموت
PasswordString الزامیرمز عبور شما در سامانه پیامک آموت
SendDateTimeObject الزامیزمان ارسال پیامک
SMSMessageTextString الزامیمتن پیامک
LineNumberString الزامیشماره خط
BankIDLong الزامیکد بانک اطلاعاتی
OrderTypeString الزامیترتیب انتخاب
Sequential = 0, Random = 1,
FromRowInt الزامیاز ردیف
CountInt الزامیتعداد

مقدار خروجی

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

نمونه کد

Loading
string UserName = "MyUserName";
string Password = "MyPassword";
DateTime SendDateTime = DateTime.Now;
string SMSMessageText = "پیامک تستی من";
string LineNumber = "public";

long BankID = 0;
SMS.SendOrderType SendOrderType = SMS.SendOrderType.Sequential;
int FromRow = 0;
int Count = 100;

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

SMS.SendResult result = client.SendBank(UserName, Password, SendDateTime, SMSMessageText, LineNumber,

    BankID, SendOrderType, FromRow, Count);

if (result.Status == SMS.Status.Success)
{
    //خروجی
}
$url = "https://portal.amootsms.com/webservice2.asmx/SendBank_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."&"."BankID=0";
$url = $url."&"."SendOrderType=Sequential";
$url = $url."&"."FromRow=0";
$url = $url."&"."Count=0";

$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['BankID'] = 0;
$parameters['SendOrderType'] = "Sequential";
$parameters['FromRow'] =0;
$parameters['Count'] = 100;

$result = $sms_client->SendBank($parameters)->SendBankResult;
echo $result;

وضعیت

Loading
Status Title
0Failed
1Success
2AccountIsDemo
4CreditNotEnough
5LineNumber_NotExist
6BackupLineNumber_NotExist
7Avanak_NotAvailable
10UserName_Empty
11Password_Empty
12LineNumber_Empty
13BackupLineNumber_Empty
14SMSMessageText_Empty
15AvanakMessageText_Empty
16Mobile_Empty
17Mobiles_Empty
18Title_Empty
19FirstNameOrLastName_Empty
20URLAddress_Empty
100UserNameOrPassword_Invalid
101Mobile_Invalid
102Mobiles_Invalid
103Count_Invalid
104FromRow_Invalid
105FromDate_Invalid
106FromDateTime_Invalid
107ToDate_Invalid
108ToDateTime_Invalid
109FromDateIsAfterThanToDate
110FromDateTimeIsAfterThanToDateTime
111MessageID_Invalid
112BulkID_Invalid
113ContactID_Invalid
114ContactGroupID_Invalid
115CourseID_Invalid
116CourseGroupID_Invalid
117URLAddress_Duplicate
118RelayMessageDeliveryID_Invalid
119RelayRecieveMessageID_Invalid
120Length_Invalid
121Length_Exceeded
500ServerError
-300System_Disabled
-208Token_NotAllowMethod
-207Token_NotAllowIP
-204Token_Expired
-203Token_Disabled
-202Token_Invalid
-201Token_NotExists
-108User_NotAllowMethod
-107User_NotAllowIP
-106User_NotAllowWebService
-105User_WebServiceBanned
-104User_Expired
-103User_Disabled
-102User_MobileNotVerified
-1User_NotExists