APIs Sample

<?php

// POST transfer
$url = "https://golddata.vn//api/transfer.html" ;
$param = "token=aea442fb3c58f48034ae581e5486e49e";

$param .= "&from_wallet=QTE2MGVmZmNiNjJjMDAxMTYyNjM0MDUzNA" ;
$param .= "&to_wallet=QTA2MGVmZWVlMzNhZjAwMTYyNjMzNjk5NQ" ;

$param .= "&amount=0.2" ;

$param .= "&description=TestAPI" ;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $param );
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));

// receive server response ...
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$server_output = curl_exec ($ch);
$obj = json_decode($server_output);

echo "<pre>" ;
print_r($obj);
echo "</pre>" ;

curl_close ($ch);



// GET / POST wallet_list
$param = "token=aea442fb3c58f48034ae581e5486e49e";
$url = "https://golddata.vn//api/wallet_list.html";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $param );
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));

// receive server response ...
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$server_output = curl_exec ($ch);
$obj = json_decode($server_output);

echo "<pre>" ;
print_r($obj);
echo "</pre>" ;

curl_close ($ch);

// POST checksum
$param = "token=aea442fb3c58f48034ae581e5486e49e";
$param .= "&ref=A160f04e4436ce11626361412";
$param .= "&amount=1";
$param .= "&from_wallet=QTE2MGVmZmNiNjJjMDAxMTYyNjM0MDUzNA";
$param .= "&to_wallet=QTA2MGVmZWVlMzNhZjAwMTYyNjMzNjk5NQ";

$url = "https://golddata.vn//api/checksum.html";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $param );
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));

// receive server response ...
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$server_output = curl_exec ($ch);
$obj = json_decode($server_output);

echo "<pre>" ;
print_r($obj);
echo "</pre>" ;

curl_close ($ch);

 

?>


Result


https://golddata.vn/api/transfer.html

stdClass Object
(
    [code] => 200
    [result] => stdClass Object
        (
            [code] => 200
            [msg] => Chuyển khoản thành công giá trị  : 0.20000000
        )

    [bug] => 0
)

https://golddata.vn/api/wallet_list.html

stdClass Object
(
    [code] => 200
    [result] => Array
        (
            [0] => stdClass Object
                (
                    [wallet] => QTA2MGVmZWU0OGFiN2ViMTYyNjMzNjg0MA
                    [amount_in_wallet] => 50005400000.04005
                )

            [1] => stdClass Object
                (
                    [wallet] => QTA2MGVmZWVlMzNhZjAwMTYyNjMzNjk5NQ
                    [amount_in_wallet] => 26730329822.529716
                )

            [2] => stdClass Object
                (
                    [wallet] => QTE2MGVmZmNiNjJjMDAxMTYyNjM0MDUzNA
                    [amount_in_wallet] => 695941.444516182
                )

            [3] => stdClass Object
                (
                    [wallet] => QTE2MTFiNmI4ZTUyZWE4MTYyOTE4Njk1OA
                    [amount_in_wallet] => 100236.2917907729
                )

            [4] => stdClass Object
                (
                    [wallet] => QTE2MTFiNmJjMDc4MjU2MTYyOTE4NzAwOA
                    [amount_in_wallet] => 948670612.1737568
                )

            [5] => stdClass Object
                (
                    [wallet] => QTE2MzYxMWYzZTJkOWJiMTY2NzMwOTM3NA
                    [amount_in_wallet] => 0.0000000013969838619232178
                )

            [6] => stdClass Object
                (
                    [wallet] => QTE2NTAxNjI4NmQ0ZmQ1MTY5NDU4OTU3NA
                    [amount_in_wallet] => 0.00035304648
                )

        )

    [bug] => 0
)

https://golddata.vn//api/checksum.html

stdClass Object
(
    [code] => 200
    [checksum_transfer] => 1890497852
)