Send an outbound SMS from your Eazita account.
First, you’ll need a valid Eazita account.
When you create a Eazita account you will be provided an API key, Use your API-KEY
and PASSWORD
to Authenticate with API.
https://api.eazita.com/sms/:format
The format of the response must be one of: plain
or json
.
Key | Description | Default |
---|---|---|
api REQUIRED | string | Your API key | None |
pass REQUIRED | string | Your account password | None |
to REQUIRED | string | Message destination address. The numbers must be in international format, seperated by semicolon. (Example: 923122699633 or 923121103792;923122699633). | None |
from REQUIRED | string | The name or number the message should be sent from. | None |
msg REQUIRED | string | Text of the message that will be sent. | None |
type string | It will not required when sending a simple text message, but is required when sending a Unicode or Flash message. Possible values: text , unicode , flash or flashunicode | text |
reference string | You can optionally include your own reference of up to 40 characters. Example: my-msg-reference | None |
https://api.eazita.com/sms/json?api=YOUR_API_KEY&pass=YOUR_PASSWORD&from=EZSMS&to=TO_NUMBER&msg=DEMO_MESSAGE
curl -X "POST" "https://api.eazita.com/json" \
-d "api=YOUR_API_KEY" \
-d "pass=YOUR_PASSWORD" \
-d "from=EZSMS" \
-d "to=TO_NUMBER" \
-d "msg=A test messaging via HTTP API."
require_once("SMS_Portal.php");
$ezsms = new EZ_SMS("YOUR_API_KEY","YOUR_PASSWORD");
$ezsms->build_send(['to' => 'TO_NUMBER','from' => 'EZSMS','msg' => 'Test message via HTTP API.']);
$msg=$ezsms->execute_send();
if(count($msg)>0){ foreach($msg as $recipient=>$resp){
echo "The status of message on ".$recipient." is ".$resp['status']." & the message id is ".$resp['messageid'].".";
} }
HTTP/1.1 200 OK
Content-Type: application/json
{
"code":1,
"execute-time":0.08858,
"totalprice":0.003,
"messages":[
{
"status":1,
"messageid":"565967",
"gsm":"923122699633"
}
]
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"code":1,
"execute-time":0.13495,
"totalprice":0.006,
"messages":[
{
"status":1,
"messageid":"565968",
"gsm":"923122699633"
},
{
"status":101,
"gsm":"123456",
"error":"The recipient is not valid."
}
]
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"code":-1,
"error":"Authentication Error - No credentials provided - api or pass missing."
}
After submitting the request you will receive a General Error Code in 'code' parameter & Message Status Code in 'status' parameter for every recipient.
Code | Error |
---|---|
1 | No Error. |
-1 | Your request is incomplete and missing some mandatory parameters. |
-2 | There was an error processing your request in the Platform. |
-3 | The credentials you supplied is either invalid or disabled. |
-4 | The value of one or more parameters is invalid. |
-5 | The SenderID you set in from is not registered with us or illegal. |
-6 | You have submitted more than 200 recipients in single request. |
-7 | The length of msg is greater than 9 pages. |
-8 | Your messages unit limit exceeded, try again after few hours. |
Code | Error |
---|---|
0 | There is no error, Mostly returned when the message is queued. |
101 | The phone number you supplied is invalid. |
102 | The phone number you have supplied doesn't support messages. |
103 | A network failure while sending your request. |
104 | Your account does not have sufficient credit to process this message. |
105 | There was an error in processing your message. |