Search…
Check Logs
The check_logs method of the receive endpoint returns logs for payments with callbacks sent to a given callback URL.
get
https://blockchainapi.org
/api/btc?method=check_logs
Check callback logs
The following block shows an example of the request URL:

Example code

PHP
1
<?php
2
$api_base = "https://blockchainapi.org/api/btc?method=check_logs";
3
$callbackUrl = 'https://google.com?user=1&secret=123';
4
5
$curl = curl_init();
6
curl_setopt_array($curl, array(
7
CURLOPT_RETURNTRANSFER => 1,
8
CURLOPT_URL => $api_base.'&callback='.$callbackUrl
9
));
10
11
$response = curl_exec($curl);
12
$http_status_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
13
curl_close($curl);
14
15
if ($http_status_code == 200) {
16
17
$decoded = json_decode($response, true);
18
19
if($decoded['success']) {
20
21
return json_encode($decoded['success'], JSON_PRETTY_PRINT);
22
// The above line will return an array of the output
23
24
} else {
25
return json_encode(array('error' => 'The supplied callback URL has never been sent any callbacks\/notifications.'), JSON_PRETTY_PRINT);
26
}
27
28
} else {
29
return $response;
30
}
31
?>
Copied!
Last modified 3mo ago