Mobile TopUp - OTP

This API will use for topup inquiry

TopupInquiry

POST

Topup Inquiry

 

 

Description

 

This API will use for topup inquiry.

 

 

Version


V1


Resource URL

https://sandbox.jsbl.com/topup/v0 /inquiry


Header


Name Type Values Description Length

Authorization

String Bearer
Example: Bearer xxxxxxxxxxxxx
Access Token will be generated through OAuth API NA

Content-Type

String Example:
application/json
Only “application/json” Content-Type is supported. NA


Request Parameters

 

Name O/M Type Values Description Length

MobileNumber

M String 03124435484 Mobile Number 11

Amount

M String 100 Amount N/A

ProductId

M String MBLINK01 Product Id 8

ConsumerNo

M String 1122 Consumer No 4

 

 

 

Sample  Request

 

{

                

                "MobileNumber":"03124435484",

                "Amount":"100",

                "ProductId":"MBLINK01=",

                "ConsumerNo":"1122"

               

}

 

Response Parameters

 

Name Type Values Description Length

ResponseCode

String 00 Response Code 2

ResponseDescription

String Successful  Response Description N/A
Rrn String 7326125269761 Rrn random number 13

ProductId

String MBLINK01 Product Id

8

BillAmount String 2100.00  Bill Amount N/A

LastBillAmount

String 50  Last Bill Amount

N/A

DueDate String 20170706  Due Date N/A

OverDue

String 0  Over Due 

N/A

 

 

 

 

 

 

Sample  Response

 

Success

{

                "ResponseCode":"00",

                "ResponseDescription":"Successful",

                "Rrn":"7326125269761",

                "ProductId":"MBLINK01=",

                "BillAmount":"2100.00",

                "lastBillAmount":"50",

                "DueDate":"20170706",

                "OverDue":"0" 

}

Response Code Details


{
"requestId": "3091741309081",
"errorCode": "01",
"errorMessage": "Bad Request - Invalid Authorization Header"
}



{
"requestId": "3091741309081",
"errorCode": "03",
"errorMessage": "Bad Request - Invalid Request Payload"
}



{
"requestId": "3091741309081",
"errorCode": "04",
"errorMessage": "Bad Request - Resource not found"
}



{
"requestId": "3091741309081",
"errorCode": "05",
"errorMessage": "Bad Request - Invalid Access Token"
}
{
    "ResponseCode": "00",
    "ResponseDescription": "Successful",
    "Rrn": "",
    "ProductId": "MBLINK01=",
    "BillAmount": "2100.00",
     "lastBillAmount": "50",
    "DueDate": "20170706",
    "OverDue": "0",
    
}


Try-out yourself

Header Parameters


Name Values Description
Authorization
(required)

Auth2.0 verification. "Bearer" keyword followed by a space and generated Access Token from OAuth API.Like "Bearer xxxxxxx"

Content-Type
(required)

Content Type applciation/json is supported

Body Parameters


Name Values Description
Request Body
(required)

{ "MobileNumber":"03124435484" ,"Amount":"100" ,"ProductId":"MBLINK01" ,"ConsumerNo":"03455864335" }

Request Body

{ "MobileNumber":"03124435484" ,"Amount":"100" ,"ProductId":"MBLINK01" ,"ConsumerNo":"03455864335" }

HTTP Basic

OAuth 2.0

API Key

Clear Request

Make a request and see the response.

Make a request and see the response.

Make a request and see the response.

Code examples

  • var request = require('request'),
    oauth_token = "YOUR_ACCESS_TOKEN",
    url = "https://sandbox.jsbl.com/topup/v0/inquiry"
    auth = "Bearer " + oauth_token;
    request(
    {
    method: 'POST'
    url : url,
    headers : {
    "Authorization" : auth
    }, json : {
    "MobileNumber" :"",
    "Amount" :"",
    "ProductId" :"",
    "ConsumerNo" :""
    
    } }, function (error, response, body) {
    // TODO: Use the body object to extract the response
    console.log(body)
    }
    )
    
  • <?PHP
    
    $url = 'https://sandbox.jsbl.com/topup/v0/inquiry';
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_HTTPHEADER, 
    array('Content-Type:application/json','Authorization:Bearer 
    ACCESS_TOKEN')); //setting custom header $curl_post_data = array(
    //Fill in the request parameters with valid values
    'MobileNumber' => ' ',
    'Amount' => ' ',
    'ProductId' => ' ',
    'ConsumerNo' => ' '
    
    ); $data_string = json_encode($curl_post_data);
    
  • require 'net/http'
    require 'net/https'
    require 'uri'
    uri = URI('https://sandbox.jsbl.com/topup/v0/inquiry')
    http = Net::HTTP.new(uri.host, uri.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    request = Net::HTTP::Get.new(uri)
    request["accept"] = 'application/json'
    request["content-type"] = 'application/json'
    request["authorization"] = 'Bearer '
    request.body = "{
    \"MobileNumber\":\" \",
    \"Amount\":\" \",
    \"ProductId\":\" \",
    \"ConsumerNo\":\" \"
    }"
    response = http.request(request)
    puts response.read_body
    
  • curl -X POST --header "Authorization: 
    Bearer " --header "Content-Type: 
    application/json" -d "{ \"MobileNumber\":\" \",
    \"Amount\":\" \",
    \"ProductId\":\" \",
    \"ConsumerNo\":\" \"
    }" "https://sandbox.jsbl.com/topup/v0/inquiry"
    
  • OkHttpClient client = new OkHttpClient();
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{
    \"MobileNumber\":\" \",
    \"Amount\":\" \",
    \"ProductId\":\" \",
    \"ConsumerNo\":\" \"
    
    }");
    Request request = new Request.Builder()
    .url("https://sandbox.jsbl.com/topup/v0/inquiry")
    .post(body)
    .addHeader("authorization", "Bearer YOUR_OAUTH_TOKEN")
    .addHeader("content-type", "application/json")
    .build();
    Response response = client.newCall(request).execute(); 
    

FAQs

You need to go through the section "How it Works".

Prerequisite(s)

1. OAuth2.0 Authorization Bearer access token

Resource Summary

Security

Authentication

Content Type

application/json

Working...