11 March 2015

jolo.in alternative

In the recent days, jolo.in free recharge api provider has become more worse than ever. no recharge was successful but the amount getting deducted ,emailed them (sales@jolo.in) couple of times  asking whats going on? no reply yet.

my previous blog post was about mobikwik recharge api.  so in this post i am writing to tell you all how i migrated to mobikwik api without disturbing my current site setup.

here is the trick for Operator code mapping

$op='AT'; //operator code for jolo

$ops=array(
'AT'=>array('op'=>1),
'BS'=>array('op'=>3),
'BSS'=>array('op'=>3,'pvalue'=>'specialRecharge'),
'AL'=>array('op'=>6),
'ID'=>array('op'=>8),
'VF'=>array('op'=>2),
'TD'=>array('op'=>11),
'TDS'=>array('op'=>11,'pvalue'=>'specialRecharge'),
'TI'=>array('op'=>9),
'MS'=>array('op'=>13),
'UN'=>array('op'=>16),
'UNS'=>array('op'=>16,'pvalue'=>'specialRecharge'),
'LM'=>array('op'=>10),
'RL'=>array('op'=>4),
'RG'=>array('op'=>5),
'VD'=>array('op'=>17),
'VDS'=>array('op'=>17,'pvalue'=>'specialRecharge')
);

$opr=http_build_query($ops[$op]);

$uid='email@example.com';  //your mobikwik username probably email id
$pwd='123456';  //your mobikwik password

$amt=; //amount variable
$cn=; //cell number variable

$cir=11; //this can be ignored

$mapp=md5($amt.$pwd.$cn.$uid.'c489hrvv56NV9IVYCY4YER56GRYYB&^fn980b3678b7zv58Z&*VV79V789TV58955T78VTV5');

$url="https://appapi.mobikwik.com/recharge.do?uid=$uid&pwd=$pwd&cn=$cn&$opr&cir=$cir&amt=$amt&reqid=android&mapp=$mapp";

$xml=file_get_contents($url);
$array=simplexml_load_string($xml);
//echo $url;
print_r($array);

if($array->status=='SUCCESS')
{
$txnid=$array->txId;
//do something
}

if($array->status=='SUCCESSPENDING')
{
$txnid=$array->txId;
//do something
}

10 comments:

  1. Hi Stephen, is mobikwik recharge api still being supported by Mobikwik? Sorry to ask you as I didn't find any recent documentation on this by Mobikwik team

    ReplyDelete
  2. Hi Stephen, is mobikwik recharge api still being supported by Mobikwik? Sorry to ask you as I didn't find any recent documentation on this by Mobikwik team

    ReplyDelete
  3. This is an unofficial API you can't find documentation for it.
    you may refer my another post on this.
    http://blog.stephin.in/2015/02/mobikwik-recharge-api.html

    ReplyDelete
  4. Hi, thank you for your reply. I have gone through your other blog article as well. However, in md5 encryption $mapp=md5($amt.$pwd.$cn.$uid.'c489hrvv56NV9IVYCY4YER56GRYYB&^fn980b3678b7zv58Z&*VV79V789TV58955T78VTV5');
    How did you get the key string? Is it user account specific or I can use this value itself? Also are you still using this api in production? I just want to gauge how reliable this unofficial api is.

    Again, thank you.

    ReplyDelete
  5. key string was taken from their android app. it is same for all accounts.
    i am still using this in my site. it is better than jolo api.

    ReplyDelete
  6. Hi Stephin,

    It is not working. Here is the return message.

    FAILURE Unauthorized access to API

    ReplyDelete
    Replies
    1. It should work for everyone.
      may be you have problem with md5 signature calculation.
      try the code without altering md5 part.

      Delete
    2. Is it a post request? I am coding in java.

      Delete
    3. It is working. in java need to convert the md5 byte array to hex !

      Delete
    4. Hi Stephin, Just thought of checking another related api with you. By any chance do you konw/use any good API tp get tariff plan details(pre-paid talk plans, sms plans etc) for a given operator and circle ?

      Delete