API Developer

PERHATIKAN! Pastikan anda memahami bahasa pemograman komputer untuk melakukan transaksi pulsa via API.
Contoh Script PHP untuk Cek Balance
                        
$url = 'https://api.lengkomedia.com/api.php';
    
$data = array( 
    'key' => 'apikeyyyy', //APi key mu
    'action' => 'balance', //Parameter utk ceck balance, jgn ganti.
);
    
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$result = curl_exec($ch);
echo $result;
                            
                            
                          
Cotoh Content yang akan dikirim
                        
{
    "code":"200,
    "username":"dpayerofficial",
    "balance":"293906077",
    "level":"Member",
    "status":"Aktif"
}
                            
                          
Contoh Script PHP untuk Cek Status Pesanan
                        
$url = 'https://api.lengkomedia.com/api.php';
    
$data = array( 
    'key' => 'apikeyyyy', //APi key mu
    'action' => 'status', //Parameter utk ceck status, jgn ganti.
    'trxid' => 'trxid' //Ganti dengan trxid yg diterima
);
    
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$result = curl_exec($ch);
echo $result;
                            
                          
Cotoh Content yang akan dikirim
                        
{
  "status": "success",
  "result": {
    "trxid": "LM-55069",
    "phone": "087898292270",
    "status": "Sukses",
    "note": "Trx sukses sn : 18031015013129",
    "price": "5845",
    "date_insert": "2018-03-25 00:14:22",
    "date_update": "2018-03-25 00:14:59"
  }
}
                            
                          
Cotoh Content yang akan dikirim
                        
{
    "status" : "error",
    "result" : {
        "Invalid Request API. Please try again in few minute or call DPayer Care"            
    }
}
    
{
    "status" : "error",
    "result" : {
        "Invalid parameter, please check again."            
    }
}
    
{
    "status" : "error",
    "result" : {
        "API is not activate"            
    }
}
    
    dll..
                            
                          
Contoh Script PHP untuk Cek Harga Layanan
                     
                            
$url = 'https://api.lengkomedia.com/api.php';
    
$data = array( 
    'key' => 'apikeyyyy', //APi key mu
    'action' => 'service', //Parameter utk ceck service, jgn ganti.
);
    
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$result = curl_exec($ch);
echo $result;
                            
                          
Cotoh Content yang akan dikirim
                        
{
  "status": "success",
  "result": [
    {
      "kode": "AX5",
      "category": "AXIS",
      "service": "AXIS 5000",
      "status": "Tersedia",
      "harga": "5735"
    },
    {
      "kode": "AX10",
      "category": "AXIS",
      "service": "AXIS 10000",
      "status": "Tersedia",
      "harga": "10735"
    },
    ....
  ]
}
                            
                          
Contoh Script PHP untuk Cek Balance
                        
$url = 'https://api.lengkomedia.com/pesan/api.php';
                
$data = array( 
	'key' => 'apikeyanda', //Isi dengan API KEY ANDA!
	'action' => 'pesan', //Default => pesan, jgn diubah
	'method' => 'pulsa', //parameter = pulsa,pln
	'kode' => 'IDLAYANAN', //cek di list harga
	'nomor' => '0888888', //Nomor tujuan
	'trx' => '1', //Transaksi keberapaa dengan nomor & nominal yg sama dalam 24 jam.
	'meter' => 'nomor meter/id pelanggan' //Jika melakukan pemesanan pln, masukkan parameter ini
);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$result = curl_exec($ch);
echo $result;
                            
                            
                          
Cotoh Content yang akan dikirim
                        
{
    "result": "Success",
        {
            "trxid" : "LM-931",
            "message" : "Pesanan LM-931 anda akan diproses."
        }
}