Key |
Value |
Description |
---|---|---|
username (string)
|
alexander
|
REQUIRED
|
credit_type (string)
|
sms
|
REQUIRED sms , voice
|
credit (number)
|
2000
|
REQUIRED
|
service_type (string)
|
Transactional
|
REQUIRED Transactional,Promotional,open_dnd,voice_call
|
price_per_credit (number)
|
0.20
|
REQUIRED
|
curl -X POST \ https://obligr.io/api_v2/user/credit \ -H 'authorization: Bearer [YOUR_API_KEY]' \ -H 'cache-control: no-cache' \ -H 'content-type: application/json' -d 'alexander&credit_type=sms&credit=2000&service_type=Transactional&price_per_credit=0.50'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://obligr.io/api_v2/user/credit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "alexander&credit_type=sms&credit=2000&service_type=Transactional&price_per_credit=0.50",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer [YOUR_API_KEY]",
"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;
}
{ "success": true, "error": null, "data": "User `alexander` created success. Password sent on email or mobile." }