Get all Callback Log
Callback Log Endpoint
Retrieve details of a CallbackLog by their ID.
https://sandbox.tickpay.com/api/v1/callbacklogs/{id}
Request
To access this endpoint, you need to provide a valid access token in the Authorization header.
- cURL
- C#
- JavaScript
- Python
- Java
- PHP
Use the following cURL command to retrieve details of all Callbacklogs:
curl -X 'GET' \
'https://sandbox.tickpay.com/api/v1/callbackLogs/id' \
-H 'accept: application/json' \
-H 'Authorization: Bearer your_access_token'
Use the following csharp command to retrieve details of all Callbacklogs:
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
string url = "https://sandbox.tickpay.com/api/v1/callbackLogs/id";
string accessToken = "your_access_token";
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("accept", "application/json");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");
HttpResponseMessage response = await client.GetAsync(url);
if (response.IsSuccessStatusCode)
{
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine("Response data:");
Console.WriteLine(responseBody);
}
else
{
Console.WriteLine($"Error fetching data: {response.StatusCode}");
}
}
}
}
Use the following javascript command to retrieve details of all Callbacklogs:
const fetch = require('node-fetch');
const url = 'https://sandbox.tickpay.com/api/v1/callbackLogs/id';
const accessToken = 'your_access_token';
fetch(url, {
method: 'GET',
headers: {
'accept': 'application/json',
'Authorization': `Bearer ${accessToken}`
}
})
.then(response => response.json())
.then(data => {
console.log('Response data:', data);
})
.catch(error => {
console.error('Error fetching data:', error);
});
Use the following python command to retrieve details of all Callbacklogs:
import requests
url = 'https://sandbox.tickpay.com/api/v1/callbackLogs/id'
access_token = 'your_access_token'
headers = {
'accept': 'application/json',
'Authorization': f'Bearer {access_token}'
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
data = response.json()
print('Response data:')
print(data)
else:
print(f'Error fetching data: {response.status_code}')
Use the following java command to retrieve details of all Callbacklogs:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class Main {
public static void main(String[] args) {
String url = "https://sandbox.tickpay.com/api/v1/callbackLogs/id";
String accessToken = "your_access_token";
try {
URL apiUrl = new URL(url);
HttpURLConnection connection = (HttpURLConnection) apiUrl.openConnection();
connection.setRequestMethod("GET");
connection.setRequestProperty("accept", "application/json");
connection.setRequestProperty("Authorization", "Bearer " + accessToken);
int responseCode = connection.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) {
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String inputLine;
StringBuilder response = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println("Response data:");
System.out.println(response.toString());
} else {
System.out.println("Error fetching data: " + responseCode);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
Use the following php command to retrieve details of all Callbacklogs:
<?php
$endpoint = 'https://sandbox.tickpay.com/api/v1/callbackLogs/id';
$access_token = 'your_access_token';
$ch = curl_init($endpoint);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'accept: application/json',
'Authorization: Bearer ' . $access_token,
]);
$response = curl_exec($ch);
curl_close($ch);
// Agora você pode manipular a resposta JSON conforme necessário.
// Por exemplo, você pode decodificar o JSON usando json_decode($response).
?>
Response
The response will contain a data object, along with additional information:
{
"success": true,
"messageError": null,
"data": {
"id": "db564d8b-183f-4f22-bf41-7af26636b661",
"url": "https://tickpay.com/response",
"responseStatus": 200,
"status": "SUCCESS",
"request": {
"id": "857ce245-92f8-4580-8be8-979ade39ce49",
"value": 5000,
"tax": 20,
"description": "CASH-IN PAID SUCCESSFULLY!",
"operation": "CASHIN",
"status": "SUCCEED",
"codeCopyPaste": "chave:01234567890;valor:50.00;descricao:Pagamento de exemplo",
"qrcodeImage": "data:image/png;base64,iVBORw0KGgoAAA...",
"metadata": {
"foo": "bar"
},
"payer": {
"name": "John Doe",
"email": "[email protected]",
"phone": "31988774466",
"document": "11111111111"
},
"callbackUrl": "https://tickpay.com/response",
"externalReference": "your_internal_id",
"createdAt": "2024-04-13T20:39:44.897Z"
},
"response": {
"response": "ok"
},
"createdAt": "2024-04-13T20:39:44.897Z"
}
}
Response Properties
| Parameter | Description | Default Value |
|---|---|---|
success | Indicates whether the request was successful. | false |
messageError | Error message. | null |
data Properties | ||
id | Unique identifier for the log. | |
url | URL called to generate log. | |
responseStatus | Status generate when the URL was call. | |
status | Status received when this callback was call. | |
response | Message from callback | |
createdAt | When was created this log. | |
request Properties | ||
id | Unique identifier for the transaction. | |
value | Specific value in the response, representing cents. | > 0 |
tax | Tax value. | |
description | Description of the operation. | |
operation | Type of operation. | |
status | Current status of the transaction. | |
codeCopyPaste | URL for copying and pasting the code. | |
qrcodeImage | Data URI for the QR code image. | |
metadata | Additional metadata. | |
payer | Information about the payer. | |
callbackUrl | URL for callback. | |
externalReference | External reference identifier. | |
createdAt | Date and time of creation. |