How to get a transaction data with NIS API? [SOLVED]

I try to get a transaction data from NIS API.

http://localhost:7890/account/transfers/incoming?address=TC7MCY5AGJQXZQ4BN3BOPNXUVIGDJCOHBPGUM2GE&hash=8a4879e6b59be2161378aae031851a1b6e1e66917da515ef3f5b01109e46f6dd

I can only get transaction datas from NEXT of the txid.
How to get a data of the TXID directly? :pensive:

Getting a single tx by id is not possible since the id is different for each node, you can however get a transaction by its hash:
But you have to use a different api if you want to get one transaction by hash:

http://104.128.226.60:7890/transaction/get?hash=b3250dc5d596c05bff4e501cc2c74b1099bc83f8d99c548377224f2f5a8d994d

Notice however that not every node is supporting this api for transactions older than 36 hours.
You can enable it for your node in the config.properties by setting

nis.transactionHashRetentionTime = -1

You can also use nodes that are known to support this request type.
For testnet those are the node with ip

104.128.226.60 and
23.228.67.85

and for mainnet the nodes with the following ips support it:

62.75.171.41
104.251.212.131
45.124.65.125
185.53.131.101

1 Like

Thank you ! I get a txdata with the way! :laughing:

http://104.128.226.60:7890/account/transfers/incoming?address=TCVMRODPWHZ5QD4WLSDD2Z4ZCCC3FAXNNRIEKBFM

I am using API to get all transaction in first time., After that when I get last hit transaction ID. I will pass hash=โ€˜last_transaction_idโ€™ this will return old 25 transaction which is happened before this hash., but i want result which will return transactions happened after this particular hash. Could you please help me?

You can page only in one direction:

http://104.128.226.60:7890/account/transfers/incoming?address=TCVMRODPWHZ5QD4WLSDD2Z4ZCCC3FAXNNRIEKBFM (newest transactions)

http://104.128.226.60:7890/account/transfers/incoming?address=TCVMRODPWHZ5QD4WLSDD2Z4ZCCC3FAXNNRIEKBFM&hash=<last_hash_from_prev_request>

and so onโ€ฆ

By default you receive 25 transactions in one request. To increase it you have param pageSize. You can set max 100.

Thank you for the help