Transaction History
If you need to view your transaction history you can use the https://identity.hxro.io/api/Transactions/by-user GET endpoint to return as many transactions as you want from your account.
const apiToken = 'your api token';
const queryParam = '&takeTop=100&skip=0'; //takeTop can be set to however many
//transactions you want to return skip is how many you want to skip before returning //more
const userId = '?userId=your user id';
const https = require('https');
const options = {
hostname: 'identity.hxro.io',
port: 443,
path: '/api/Transactions/by-user'+userId + queryParam,
method: 'get',
headers: {
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': apiToken,
}
}
const req = https.request(options, (res) => {
var arr = "";
res.on('data', (part) => {
arr += part;
});
res.on('end', () => {
var seriesArr = JSON.parse(arr)
for (i = 0; i <= seriesArr.length; i++) {
console.log(seriesArr[i]);
}
});
})
req.on('error', (error) => {
console.error(error)
})
req.end()
You can also return a specific transaction that you have the id for with https://identity.hxro.io/api/Transactions/id by replacing id with the transaction id
Updated about 4 years ago