الأخبار

API

1- تسجيل مستخدم جديد

API :

http://www.zainsms.com/api.php?comm=register&user=user&pass=pass&name=name&mobile=mobile&email=email

ERRORS :

 999

Success register user

-100

Missing parameters (not exist or empty)

Username + password + mobile + email

-110

Username already used

-111

Mobile already used

-112

Email already used

-120

Username contain special characters or Arabic chars

-121

Password less than 6 chars

-122

Invalid username

-123

Invalid password


2- تفعيل الحساب

API :

http://www.zainsms.com/api.php?comm=activate&user=user&pass=pass&code=activeCode

ERRORS :

  999

Success activate account

-100

Missing parameters (not exist or empty)

Username + password + active code

-110

Wrong username or password

-111

Wrong active code


3- تذكر كلمة المرور

API :

http://www.zainsms.com/api.php?comm=reset_psw&email=testtest.test

ERRORS :

999

New password has been sent successfully

-100

Missing parameters (not exist or empty)

Email

-110

Invalid email



4- اختبار الحساب

API :

http://www.zainsms.com/api.php?comm=chk_user&user=user&pass=pass

ERRORS :

999

Valid account

100-

Missing parameters (not exist or empty)

Username + password

110-

Account not exist (wrong username or password)

-111

Account not activated

-112

Blocked account


5- استعلام الرصيد

API :

 http://www.zainsms.com/api.php?comm=chk_balance&user=user&pass=pass

ERRORS :

number

The balance

100-

Missing parameters (not exist or empty)

Username + password

110-

Account not exist (wrong username or password)


6- تغيير كلمة السر

API :

 http://www.zainsms.com/api.php?comm=change_pass&user=user&pass=pass&newpass=newPass

ERRORS :

999

Password changed successfully

100-

Missing parameters (not exist or empty)

Username + password + new password

110-

Missing parameters (not exist or empty)

Username + password

-121

New password less than 6 chars


7-طلب اسم مرسل

API :

 http://www.zainsms.com/api.php?comm=newsender&user=ahmad2&pass=123&sendertext=APItest

ERRORS :

999

success operation 

-100

missing parameter

-110

invalid user name and password 

-113

sender  text duplicated 

-114

invalid sender Text "sender text  have wrong character or more then 11 char   ore  number and more 14 number" 


8-حالة أسماء المرسلين

API :

  http://www.zainsms.com/api.php?comm=senderstatus&user=hassan&pass=123&sendertext=APItest

ERRORS :

999

Sender Text is Active

-100

missing parameter

-110

invalid user name and password 

-116 

sender  text not  found  in user sender list

-117 

: sender text  

inactive


-118 

sender text  rejected 


9-طلب شحن رصيد

API :

http://www.zainsms.com /api.php?comm=bnk_chrg&user=user&pass=pass&

points=500&depositAmount=20rial&accountNumber=test

&accountName=test&depositDate=1/1/2010&bankName=alrajhe&paymentWay=net&details=test

Parameters

points

depositAmount

accountNumber

accountName

depositDate

bankName

paymentWay

details


Credit wanted

Deposited amount

Bank account number

Bank account name

Deposit date

The bank name

The payment way

notes

ERRORS :

999

The request added successfully

100-

Missing parameters (not exist or empty)

User + pass + points + depositAmount + accountNumber + accountName + bankName

110-

Wrong username or password

-121

There is an error with add request


10-ارسال رسلة

API :

http://www.zainsms.com/api.php?comm=sendsms&user=username&pass=password&to=966500000000&message=testmessage&sender=sendername&date=2/4/2011&time=10:30

ERRORS :

 Result:SMS_ID:mobileNumber

(new line for each number)

Example of response :

-999:20031:966521021542

Result : -2 (invalid destination or not support country)

Result : -999 (failed sent by sms provider)

Result : u (Unknown Message status )

Result :1 (Success sent )

SMS_ID : The SMS ID on server (Will set as null if the result was -2)

-100

Missing parameters (not exist or empty)

user + pass + to + message + sender

-110

Wrong username or password

-111

The account not activated

-112

Blocked account

-113

not enough balance

-114

The service not available for now

-115

The sender not available (if user have no opened sender)

Note : if the sender opened will allow any sender

-116

Invalid sender name

Important Notes :

1-            If the API doesn`t contain date parameter , the message will send directly ,

2-            Set the date parameter to send message later

3-            If the date set as previous date , the message will send directly


1- تسجيل مستخدم جديد

API :

http://www.zainsms.com/api.php?comm=register&user=user&pass=pass&name=name&mobile=mobile&email=email

ERRORS :

 999

Success register user

-100

Missing parameters (not exist or empty)

Username + password + mobile + email

-110

Username already used

-111

Mobile already used

-112

Email already used

-120

Username contain special characters or Arabic chars

-121

Password less than 6 chars

-122

Invalid username

-123

Invalid password


2- تفعيل الحساب

API :

http://www.zainsms.com/api.php?comm=activate&user=user&pass=pass&code=activeCode

ERRORS :

  999

Success activate account

-100

Missing parameters (not exist or empty)

Username + password + active code

-110

Wrong username or password

-111

Wrong active code


3- تذكر كلمة المرور

API :

http://www.zainsms.com/api.php?comm=reset_psw&email=testtest.test

ERRORS :

999

New password has been sent successfully

-100

Missing parameters (not exist or empty)

Email

-110

Invalid email



4- اختبار الحساب

API :

http://www.zainsms.com/api.php?comm=chk_user&user=user&pass=pass

ERRORS :

999

Valid account

100-

Missing parameters (not exist or empty)

Username + password

110-

Account not exist (wrong username or password)

-111

Account not activated

-112

Blocked account


5- استعلام الرصيد

API :

 http://www.zainsms.com/api.php?comm=chk_balance&user=user&pass=pass

ERRORS :

number

The balance

100-

Missing parameters (not exist or empty)

Username + password

110-

Account not exist (wrong username or password)


6- تغيير كلمة السر

API :

 http://www.zainsms.com/api.php?comm=change_pass&user=user&pass=pass&newpass=newPass

ERRORS :

999

Password changed successfully

100-

Missing parameters (not exist or empty)

Username + password + new password

110-

Missing parameters (not exist or empty)

Username + password

-121

New password less than 6 chars


7-طلب اسم مرسل

API :

 http://www.zainsms.com/api.php?comm=newsender&user=ahmad2&pass=123&sendertext=APItest

ERRORS :

999

success operation 

-100

missing parameter

-110

invalid user name and password 

-113

sender  text duplicated 

-114

invalid sender Text "sender text  have wrong character or more then 11 char   ore  number and more 14 number" 


8-حالة أسماء المرسلين

API :

  http://www.zainsms.com/api.php?comm=senderstatus&user=hassan&pass=123&sendertext=APItest

ERRORS :

999

Sender Text is Active

-100

missing parameter

-110

invalid user name and password 

-116 

sender  text not  found  in user sender list

-117 

: sender text  

inactive


-118 

sender text  rejected 


9-طلب شحن رصيد

API :

http://www.zainsms.com /api.php?comm=bnk_chrg&user=user&pass=pass&

points=500&depositAmount=20rial&accountNumber=test

&accountName=test&depositDate=1/1/2010&bankName=alrajhe&paymentWay=net&details=test

Parameters

points

depositAmount

accountNumber

accountName

depositDate

bankName

paymentWay

details


Credit wanted

Deposited amount

Bank account number

Bank account name

Deposit date

The bank name

The payment way

notes

ERRORS :

999

The request added successfully

100-

Missing parameters (not exist or empty)

User + pass + points + depositAmount + accountNumber + accountName + bankName

110-

Wrong username or password

-121

There is an error with add request


10-ارسال رسلة

API :

http://www.zainsms.com/api.php?comm=sendsms&user=username&pass=password&to=966500000000&message=testmessage&sender=sendername&date=2/4/2011&time=10:30

ERRORS :

 Result:SMS_ID:mobileNumber

(new line for each number)

Example of response :

-999:20031:966521021542

Result : -2 (invalid destination or not support country)

Result : -999 (failed sent by sms provider)

Result : u (Unknown Message status )

Result :1 (Success sent )

SMS_ID : The SMS ID on server (Will set as null if the result was -2)

-100

Missing parameters (not exist or empty)

user + pass + to + message + sender

-110

Wrong username or password

-111

The account not activated

-112

Blocked account

-113

not enough balance

-114

The service not available for now

-115

The sender not available (if user have no opened sender)

Note : if the sender opened will allow any sender

-116

Invalid sender name

Important Notes :

1-            If the API doesn`t contain date parameter , the message will send directly ,

2-            Set the date parameter to send message later

3-            If the date set as previous date , the message will send directly