Get API
API Integration Document (version 1.0
)
Introduction
Follow this api documentation to setup all services on your website or mobile application.
Prerequisite:
Latest version: 1.0
(Released on: 1 August 2019)
Change log:
- Base api directory is changed to https://joloapi.com/api/v1/...
- Request parameter "mode" is removed. Now for testing and production base url is different. For testing use: https://joloapi.com/api/demo/... and for production, use https://joloapi.com/api/v1/...
- Response parameter "error" will now throw full error message. Earlier error code was thrown like 20,21 etc.
- In status check & dispute api, response parameter "txnstatus" tells the current status of transaction. Earlier "status" parameter was decider.
- In callback url, another parameter will be send: "servicetype". servicetype list
- Electricity, gas & water bill payment service is now available for free.
- Mobile & DTH operator finder including their plan finder api has been changed completely.
Base URL
Live mode
https://joloapi.com/api/v1
Demo mode (Sandbox)
https://joloapi.com/api/demo
Base Parameters
You have to pass following parameters in base url in every api call. Its mandatory.
Parameters:
name | value |
---|---|
userid | your joloapi.com userid |
key | your joloapi.com key |
Services
Example
https://joloapi.com/api/v1/myservices.php?userid=xx&key=xx
API Service type
Service type name | value |
---|---|
PREPAID | 1 |
DTH | 2 |
Margin
Example
https://joloapi.com/api/v1/mymargin.php?userid=xx&key=xx
API Balance
Example
https://joloapi.com/api/v1/balance.php?userid=xx&key=xx
Prepaid Recharge
Example
https://joloapi.com/api/v1/recharge.php?userid=xx&key=xx&operator=xx&service=xx&amount=xx&orderid=xx
Parameter Detail
S/no. | Operator Name | operator | amount | service |
---|
DTH Recharge
Example
https://joloapi.com/api/v1/recharge.php?userid=xx&key=xx&operator=xx&service=xx&amount=xx&orderid=xx
Parameter Detail
S/no. | Operator Name | operator | amount | service |
---|
Postpaid Bill Payment
Example
https://joloapi.com/api/v1/cbill.php?userid=xx&key=xx&operator=xx&service=xx&amount=xx&orderid=xx&customer_mobile=xx&customer_name=xx
Parameter Detail
S/no. | Operator Name | operator | amount | service | customer_name | customer_mobile |
---|
Landline Bill Payment
Example
https://joloapi.com/api/v1/cbill.php?userid=xx&key=xx&operator=xx&service=xx&amount=xx&orderid=xx&customer_mobile=xx&customer_name=xx&std=xx&ca=xx
Parameter Detail
S/no. | Operator Name | operator | amount | service | customer_name | customer_mobile | std | ca |
---|
Electricity Bill Payment
Validation api call is mandatory for electricity, gas & water bill payment. Validation api will return important parameter "reference_id" which is required in transaction api call.
Example (validation)
https://joloapi.com/api/v1/bbps_validate.php?userid=xx&key=xx&operator=xx&service=xx&amount=xx&orderid=xx&customer_mobile=xx&customer_name=xx&optional1=xx&optional2=xx&optional3=xx
Example (transaction)
https://joloapi.com/api/v1/bbps_transact.php?userid=xx&key=xx&operator=xx&service=xx&amount=xx&orderid=xx&customer_mobile=xx&customer_name=xx&optional1=xx&optional2=xx&optional3=xx&reference_id=xx
Parameter Detail
S/no. | Operator Name | operator | amount | service | customer_name | customer_mobile | optional1 | optional2 | optional3 |
---|
Gas Bill Payment
Validation api call is mandatory for electricity, gas & water bill payment. Validation api will return important parameter "reference_id" which is required in transaction api call.
Example (validation)
https://joloapi.com/api/v1/bbps_validate.php?userid=xx&key=xx&operator=xx&service=xx&amount=xx&orderid=xx&customer_mobile=xx&customer_name=xx&optional1=xx&optional2=xx&optional3=xx
Example (transaction)
https://joloapi.com/api/v1/bbps_transact.php?userid=xx&key=xx&operator=xx&service=xx&amount=xx&orderid=xx&customer_mobile=xx&customer_name=xx&optional1=xx&optional2=xx&optional3=xx&reference_id=xx
Parameter Detail
S/no. | Operator Name | operator | amount | service | customer_name | customer_mobile | optional1 | optional2 | optional3 |
---|
Water Bill Payment
Validation api call is mandatory for electricity, gas & water bill payment. Validation api will return important parameter "reference_id" which is required in transaction api call.
Example (validation)
https://joloapi.com/api/v1/bbps_validate.php?userid=xx&key=xx&operator=xx&service=xx&amount=xx&orderid=xx&customer_mobile=xx&customer_name=xx&optional1=xx&optional2=xx&optional3=xx
Example (transaction)
https://joloapi.com/api/v1/bbps_transact.php?userid=xx&key=xx&operator=xx&service=xx&amount=xx&orderid=xx&customer_mobile=xx&customer_name=xx&optional1=xx&optional2=xx&optional3=xx&reference_id=xx
Parameter Detail
S/no. | Operator Name | operator | amount | service | customer_name | customer_mobile | optional1 | optional2 | optional3 |
---|
Status Recheck
Status Recheck api call is optional and you can use it to get current status of transaction. Status Recheck is allowed on current & last month transaction only. It will throw 'xxx does not exit' error message for old transactions.
Example (Status Recheck using your order id)
https://joloapi.com/api/v1/rechargestatus_client.php?userid=xx&key=xx&servicetype=xx&txn=xx
Response type: REQUEST SUCCESS & TXN SUCCESS REQUEST SUCCESS & TXN FAILED REQUEST FAILED
Parameter Detail
txn | servicetype |
---|---|
your website order id | servicetype list |
Example (Status Recheck using jolo order id)
https://joloapi.com/api/v1/rechargestatus.php?userid=xx&key=xx&servicetype=xx&txn=xx
Response type: REQUEST SUCCESS & TXN SUCCESS REQUEST SUCCESS & TXN FAILED REQUEST FAILED
Parameter Detail
txn | servicetype |
---|---|
jolo order id | servicetype list |
Dispute
Dispute api call is optional and you can use it to dispute transaction. Dispute is allowed on current & last month transaction only. It will throw 'xxx does not exit' error message for old transactions.
Example (Dispute using your order id)
https://joloapi.com/api/v1/dispute_client.php?userid=xx&key=xx&servicetype=xx&txn=xx
Response type: REQUEST SUCCESS & TXN REPORTED REQUEST SUCCESS & TXN SUCCESS REQUEST SUCCESS & TXN FAILED REQUEST FAILED
Parameter Detail
txn | servicetype |
---|---|
your website order id | servicetype list |
Example (Dispute using jolo order id)
https://joloapi.com/api/v1/dispute.php?userid=xx&key=xx&servicetype=xx&txn=xx
Response type: REQUEST SUCCESS & TXN REPORTED REQUEST SUCCESS & TXN SUCCESS REQUEST SUCCESS & TXN FAILED REQUEST FAILED
Parameter Detail
txn | servicetype |
---|---|
jolo order id | servicetype list |
Synchronization
Synchronization is mandatory if you want to avoid manual work. We send status change update on your server whenever transaction status changes. Like SUCCESS -> FAILED or REPORTED -> SUCCESS or REPORTED -> FAILED. To setup synchronization, first set callback URL. We will send following parameters on given callback url using POST method when transaction status changes:
Parameter Detail
status | operatortxnid | joloorderid | userorderid | servicetype | error |
---|---|---|---|---|---|
SUCCESS/FAILED/REPORTED | Operator ID | Our server order ID | Your website order ID | servicetype (NUMERIC) | error message if status is FAILED |
Mobile Operator Finder (supports MNP)
Example
https://joloapi.com/api/v1/operatorfinder.php?userid=xx&key=xx&mob=xx
Parameter Detail
- Pass 10 digit mobile number in "mob" parameter like mob=9999999999
(1/3) Response Parameter Detail: Operator Codes
S/no. | Service Name | Operator Name | operator code |
---|
(2/3) Response Parameter Detail: Circle Codes
S/no. | Circle Name | circle code |
---|
(3/3) Response Parameter Detail: current_type
current_type gives important information of mobile connection type - PREPAID or POSTPAID.
DTH Operator Finder (beta)
Example
https://joloapi.com/api/v1/operatorfinder_dth.php?userid=xx&key=xx&dthid=xx
Parameter Detail
- Pass Dth ID in "dthid" parameter
S/no. | Service Name | Operator Name | operator code | dthid |
---|---|---|---|---|
1 | DTH | AIRTEL DTH | AD | Customer ID (length:10 to 10) (NUMERIC) |
2 | DTH | DISH TV | DT | Viewing Card Number (length:11 to 11) (NUMERIC) |
3 | DTH | TATA SKY | TS | Subscriber ID (length:10 to 10) (NUMERIC) |
4 | DTH | BIG TV | BT | Smart Card Number (length:12 to 12) (NUMERIC) |
5 | DTH | SUN DIRECT | SD | Smart Card Number (length:11 to 11) (NUMERIC) |
6 | DTH | VIDEOCON D2H* | VT | Customer ID (length:4 to 14) (NUMERIC) |
DTH Plan Finder
Example
https://joloapi.com/api/v1/operatorplanfinder_dth.php?userid=xx&key=xx&operator_code=xx&circle_code=xx
(1/3) Parameter Detail: Operator Codes
S/no. | Service Name | Operator Name | operator code |
---|---|---|---|
1 | DTH | AIRTEL DTH | AD |
2 | DTH | DISH TV | DT |
3 | DTH | TATA SKY | TS |
4 | DTH | BIG TV | BT |
5 | DTH | SUN DIRECT | SD |
6 | DTH | VIDEOCON D2H | VT |
(2/3) Parameter Detail: Circle Codes
S/no. | Circle Name | circle code |
---|---|---|
1 | All India | AL |
(3/3) Parameter Detail: categoryid
categoryid is optional parameter that you can use to filter out result based on specific plan category.
Sample code
API Balance Check
//Jolo Cloud API ver 1.0
//Sample PHP code: API Balance check
//BASIC INFO
//Before calling any api, first insert all entries in your database
//whenever customer fill entries in your web page/application.
//If you are maintaining customer balance on your website/app, debit customer balance first,
//then call api because api response may gets timeout in rare cases.
//Once you receive api response with valid data
//then compare its logic and store it, display it on your website/app.
//define important variables
$joloapi_baseurl="https://joloapi.com/api/v1";//for testing/sandbox, use https://joloapi.com/api/demo
$userid="";
$key="";
//define other variables
$apistatus = "";
$apierrormsg = "";
$balance = "";
$totalearn = "";
$file_contents="";
$apiresponse="";
$jsondata="";
$countxx="";
$ch = curl_init();
$timeout = 61;
$myurl = "$joloapi_baseurl/balance.php?userid=$userid&key=$key";
curl_setopt ($ch, CURLOPT_URL, $myurl);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
$curl_error = curl_errno($ch);
curl_close($ch);
if(!empty($file_contents)){
$apiresponse=$file_contents; //store in logs/database
$jsondata = json_decode($apiresponse, true);
$countxx = count($jsondata);//count keys
if($countxx > 2)
{
//request accepted
$apistatus = $jsondata['status'];
$apierrormsg = $jsondata['error'];
$balance = $jsondata['balance'];
$totalearn = $jsondata['totalearn'];
}else{
//request not accepted
$apistatus = $jsondata['status'];
$apierrormsg = $jsondata['error'];
}
if($apistatus=='SUCCESS'){
echo"API BALANCE: $balance
"; //store in logs/database
echo"API EARNING: $totalearn
"; //store in logs/database
}
if($apistatus=='FAILED'){
echo"API ERROR MESSAGE: $apierrormsg
"; //store in logs/database
}
}else{
echo"No response from api provider / timeout";//store in logs/database
//consider as pending..
//check status after few minutes using status check api call or better use api synchronization
}
Prepaid Mobile Plan Finder (beta)
Example
https://joloapi.com/api/v2/operatorplanfinder.php?userid=xx&key=xx&operator_code=xx&circle_code=xx
(1/3) Parameter Detail: Operator Codes
S/no. | Service Name | Operator Name | operator code |
---|
(2/3) Parameter Detail: Circle Codes
S/no. | Circle Name | circle code |
---|
(3/3) Parameter Detail: categoryid
categoryid is optional parameter that you can use to filter out result based on specific plan category.