List Transactions

I am working in check all transactions that arrive to my account, but i got an error: “Sorry we couldn’t find what you were looking for.”

is the api obsolet?

the code is in PHP

function getTransaction($private_key, $api_key , $adress, $currency, $URL, $account_id){
  $json = new stdClass();
  $json->method = "POST";
  $json->path = "/v2/accounts/".$account_id."/addresses/".$adress."/transactions";
  $json->secretapikey = $private_key;
  $json->apikey = $api_key;

  $body = new stdClass();
  $body->type = "read";
  $body->to = $adress;
  $body->currency = $currency;
  

  $result = json_encode($json);
  $body = json_encode($body);
  $time= time()+133;
  $sign = $time.$json->method.$json->path.$body;
  $hmac = hash_hmac("SHA256", $sign, $json->secretapikey);

  $header = array(
      "CB-ACCESS-KEY:".$api_key,
      "CB-ACCESS-SIGN:".$hmac,
      "CB-ACCESS-TIMESTAMP:".$time,
      "CB-VERSION:2019-11-15",
      "Content-Type:application/json"
  );

  $ch = curl_init($URL);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
  curl_setopt($ch, CURLOPT_HTTPHEADER,$header);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  $result = curl_exec($ch);
  curl_close($ch);

  return $result;
};

//Creating URL For Sending Request
$account_id = //Coinbase Account ID
$private_key =  //Coinbase Private Key
$api_key =  //Coinbase API KEY
$adress =//Address or adressID
$currency = //Crypto To Send



$url = "https://api.coinbase.com/v2/accounts/".$account_id."/addresses/".$adress."/transactions";

$tranx_id = getTransaction(
  $private_key,
  $api_key,
  $adress,
  $currency,
  $url,
  $account_id
);
echo "Lectura de transacciones";
print_r($tranx_id);

i think that will be the adressID, where i can find it?
thanks!

Welcome to the Coinbase Cloud Developer forum, @MELARIUS! To further help you with your concern, we suggest you to open a support ticket with our team with the following details:

  • Please provide the code snippet you provided here to demonstrate the problem you are encountering including generating a Signature and Timestamp. Kindly ensure to exclude your API credentials for security reasons.

Upon creating a support ticket, kindly include the link of this forum so that the team will be aware that it’s you. Additionally, please use the email address associated with your Coinbase account.

Thank you and have a nice day!

1 Like