برای خرید سامانه پیامک همین الان در پیامک آموت ثبت نام کنید
نام | نوع | توضیحات |
---|---|---|
Token | String الزامی | توکن ثبت شده در سامانه پیامک آموت |
ContactID | Long الزامی | کد مخاطب جهت ویرایش |
ContactGroupID | Long الزامی | کد گروه مخاطب |
Active | Bool الزامی | فعال |
Mobile | String الزامی | شماره همراه مخاطب |
FName | String الزامی | نام |
LName | String الزامی | نام خانوادگی |
GenderType | Bool الزامی | False = خانم , True = آقا |
CompanyTitle | String الزامی | عنوان شرکت |
JobTitle | String الزامی | عنوان سمت/شغل |
String الزامی | ایمیل | |
CityName | String الزامی | نام شهر |
AddressText | String الزامی | آدرس |
BornDate | Object الزامی | تاریخ تولد |
AnniversaryDate | Object الزامی | تاریخ سالگرد |
CustomText1 | String الزامی | فیلد سفارشی 1 |
CustomText2 | String الزامی | فیلد سفارشی 2 |
CustomText3 | String الزامی | فیلد سفارشی 3 |
CustomText4 | String الزامی | فیلد سفارشی 4 |
CustomText5 | String الزامی | فیلد سفارشی 5 |
CustomText6 | String الزامی | فیلد سفارشی 6 |
CustomDate1 | Object الزامی | تاریخ سفارشی 1 |
CustomDate2 | Object الزامی | تاریخ سفارشی 2 |
CustomDate3 | Object الزامی | تاریخ سفارشی 3 |
نام | نوع | توضیحات |
---|---|---|
ReturnValue | Object |
string Token = "MyToken";
long ContactID = 0;
long ContactGroupID = 0;
bool Active = true;
string Mobile = "09120000000";
string FName = "";
string LName = "";
bool GenderType = true;
string CompanyTitle = "";
string JobTitle = "";
string Email = "";
string CityName = "";
string AddressText = "";
DateTime? BornDate = null;
DateTime? AnniversaryDate = null;
string CustomText1 = "";
string CustomText2 = "";
string CustomText3 = "";
string CustomText4 = "";
string CustomText5 = "";
string CustomText6 = "";
DateTime? CustomDate1 = null;
DateTime? CustomDate2 = null;
DateTime? CustomDate3 = null;
using (var client = new System.Net.WebClient())
{
client.Headers.Add(System.Net.HttpRequestHeader.Authorization, Token);
var data = new System.Collections.Specialized.NameValueCollection()
{
{ "ContactID", ContactID.ToString() },
{ "Mobile", Mobile },
{ "FName", FName },
{ "LName", LName },
{ "GenderType", GenderType.ToString() },
{ "CompanyTitle", CompanyTitle },
{ "JobTitle", JobTitle },
{ "Email", Email },
{ "CityName", CityName },
{ "AddressText", AddressText },
{ "BornDate", BornDate.ToString() },
{ "AnniversaryDate", AnniversaryDate.ToString() },
{ "CustomText1", CustomText1 },
{ "CustomText2", CustomText2 },
{ "CustomText3", CustomText3 },
{ "CustomText4", CustomText4 },
{ "CustomText5", CustomText5 },
{ "CustomText6", CustomText6 },
{ "CustomDate1", CustomDate1.ToString() },
{ "CustomDate2", CustomDate2.ToString() },
{ "CustomDate3", CustomDate3.ToString() },
{ "Labels", string.Join(",",Labels) },
};
byte[] bytes = client.UploadValues("https://portal.amootsms.com/rest/ContactEdit", data);
string json = System.Text.UTF8Encoding.UTF8.GetString(bytes);//خروجی
}
//result.Data => {
ID,
ContactGroupID,
Active,
Mobile,
FName,
LName,
GenderType,
CompanyTitle,
JobTitle,
Email,
CityName,
AddressText,
BornDate,
AnniversaryDate,
CustomText1,
CustomText2,
CustomText3,
CustomText4,
CustomText5,
CustomText6,
CustomDate1,
CustomDate2,
CustomDate3}
$url = "https://portal.amootsms.com/rest/ContactEdit";
$url = $url."?"."Token=".urlencode("MyToken");
$url = $url."&"."ContactID=0";
$url = $url."&"."ContactGroupID=0";
$url = $url."&"."Active=true";
$url = $url."&"."Mobile=09120000000";
$url = $url."&"."FName=";
$url = $url."&"."LName=";
$url = $url."&"."GenderType=";
$url = $url."&"."CompanyTitle=";
$url = $url."&"."JobTitle=";
$url = $url."&"."Email=";
$url = $url."&"."CityName=";
$url = $url."&"."AddressText=";
$url = $url."&"."BornDate=";
$url = $url."&"."AnniversaryDate=";
$url = $url."&"."CustomText1=";
$url = $url."&"."CustomText2=";
$url = $url."&"."CustomText3=";
$url = $url."&"."CustomText4=";
$url = $url."&"."CustomText5=";
$url = $url."&"."CustomText6=";
$url = $url."&"."CustomDate1=";
$url = $url."&"."CustomDate2=";
$url = $url."&"."CustomDate3=";
$json = file_get_contents($url);
echo $json;
//$result = json_decode($json);
//echo $result->Status;
Status | Title |
---|---|
0 | Failed |
1 | Success |
2 | AccountIsDemo |
4 | CreditNotEnough |
5 | LineNumber_NotExist |
6 | BackupLineNumber_NotExist |
7 | Avanak_NotAvailable |
10 | UserName_Empty |
11 | Password_Empty |
12 | LineNumber_Empty |
13 | BackupLineNumber_Empty |
14 | SMSMessageText_Empty |
15 | AvanakMessageText_Empty |
16 | Mobile_Empty |
17 | Mobiles_Empty |
18 | Title_Empty |
19 | FirstNameOrLastName_Empty |
20 | URLAddress_Empty |
100 | UserNameOrPassword_Invalid |
101 | Mobile_Invalid |
102 | Mobiles_Invalid |
103 | Count_Invalid |
104 | FromRow_Invalid |
105 | FromDate_Invalid |
106 | FromDateTime_Invalid |
107 | ToDate_Invalid |
108 | ToDateTime_Invalid |
109 | FromDateIsAfterThanToDate |
110 | FromDateTimeIsAfterThanToDateTime |
111 | MessageID_Invalid |
112 | BulkID_Invalid |
113 | ContactID_Invalid |
114 | ContactGroupID_Invalid |
115 | CourseID_Invalid |
116 | CourseGroupID_Invalid |
117 | URLAddress_Duplicate |
118 | RelayMessageDeliveryID_Invalid |
119 | RelayRecieveMessageID_Invalid |
120 | Length_Invalid |
121 | Length_Exceeded |
500 | ServerError |
-300 | System_Disabled |
-208 | Token_NotAllowMethod |
-207 | Token_NotAllowIP |
-204 | Token_Expired |
-203 | Token_Disabled |
-202 | Token_Invalid |
-201 | Token_NotExists |
-108 | User_NotAllowMethod |
-107 | User_NotAllowIP |
-106 | User_NotAllowWebService |
-105 | User_WebServiceBanned |
-104 | User_Expired |
-103 | User_Disabled |
-102 | User_MobileNotVerified |
-1 | User_NotExists |