Last active
November 22, 2017 18:04
-
-
Save ejancorp/03738f18f0b507a7906334ebb8f96981 to your computer and use it in GitHub Desktop.
Basic Chikka API Usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var settings = { | |
"async": true, | |
"crossDomain": true, | |
"url": "https://post.chikka.com/smsapi/request", | |
"method": "POST", | |
"data": { | |
"message_type": "SEND", | |
"mobile_number": "", | |
"shortcode": "", | |
"message_id": "", | |
"message": "Hi Hello", | |
"client_id": "", | |
"secret_key": "" | |
} | |
} | |
$.ajax(settings).done(function (response) { | |
console.log(response); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require("request"); | |
var options = { method: 'POST', | |
url: 'https://post.chikka.com/smsapi/request', | |
form: | |
{ message_type: 'SEND', | |
mobile_number: '', | |
shortcode: '', | |
message_id: '', | |
message: 'Hi Hello', | |
client_id: '', | |
secret_key: '' } }; | |
request(options, function (error, response, body) { | |
if (error) throw new Error(error); | |
console.log(body); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$params = array( | |
'message_type' => 'SEND', | |
'mobile_number' => '', | |
'shortcode' => '', | |
'message_id' => '', | |
'message' => 'Hi Hello', | |
'client_id' => '', | |
'secret_key' => '', | |
); | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => "https://post.chikka.com/smsapi/request", | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_ENCODING => "", | |
CURLOPT_MAXREDIRS => 10, | |
CURLOPT_TIMEOUT => 30, | |
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, | |
CURLOPT_CUSTOMREQUEST => "POST", | |
CURLOPT_POSTFIELDS => http_build_query($params) | |
)); | |
$response = curl_exec($curl); | |
$err = curl_error($curl); | |
curl_close($curl); | |
if ($err) { | |
echo "cURL Error #:" . $err; | |
} else { | |
echo $response; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment