GET https://www.fast2sms.com/dev/bulkV2
Following are the parameter to be used for GET API:
GET https://www.fast2sms.com/dev/bulkV2
Parameter | Required | Description |
---|---|---|
authorization | true | Provide "YOUR_API_KEY ". Sign up for API Key |
variables_values | true | Pass OTP value like: "5599 "(only numeric value is allowed upto 10 digit) Your SMS will be delivered as: Your OTP: 5599 |
route | true | For OTP SMS use "otp " |
numbers | true | You can send multiple mobile numbers seperated by comma like: "8888888888,9999999999,6666666666 " |
flash | false | This field is optional, it will use "0 " as default value or you can set to "1 " for sending flash message. |
POST https://www.fast2sms.com/dev/bulkV2
Following are the parameter to be used for POST API:
HTTP RequestPOST https://www.fast2sms.com/dev/bulkV2
Parameter | Required | Description |
---|---|---|
authorization | true | Provide "YOUR_API_KEY ". Sign up for API Key |
variables_values | true | Pass OTP value like: "5599 "(only numeric value is allowed upto 10 digit) Your SMS will be delivered as: Your OTP: 5599 |
route | true | For OTP SMS use "otp " |
numbers | true | You can send multiple mobile numbers seperated by comma like: "8888888888,9999999999,6666666666 " |
flash | false | This field is optional, it will use "0 " as default value or you can set to "1 " for sending flash message. |
<?php
$fields = array(
"variables_values" => "5599",
"route" => "otp",
"numbers" => "9999999999,8888888888,7777777777",
);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.fast2sms.com/dev/bulkV2",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode($fields),
CURLOPT_HTTPHEADER => array(
"authorization: YOUR_API_KEY",
"accept: */*",
"cache-control: no-cache",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}