Getting The Balance Of An Address In Swift Format
Basic Description
This endpoint is used to get the balance on a specific internal Address in Taurus-PROTECT. More specifically, the endpoint returns the MT535 statement of holdings for this Address.
To understand what an Address is and how to use it, please refer to the following page in the Taurus User Guides.
This endpoint would accept a GET request with two path parameters for the relevant blockchain
and blockchainaddress
.
Prerequisites
Required Roles
Certain API endpoints require that the user has a specific role in order to access them. Roles are used to restrict access to certain functionality within the system and ensure that only authorized users are able to perform specific actions.
Here is the list of required Roles for this particular endpoint:
- TPUser
To find out more about roles, please refer to the following page in the Taurus User Guides.
Required Input Parameters
Certain API endpoints require specific input parameters. Here is the list of Required Input Parameters for this particular endpoint:
- blockchainaddress: The ID of the requested Address.
- blockchain: The relevant blockchain network, e.g. BTC, ETH, etc.
Preconditions
It is important to note that the selected Address needs to be internal to Taurus-PROTECT. If the given
blochainaddressId
is not an internal to Taurus-PROTECT address, the request will eventually result in an error.
Call Example
You can find a basic example in cURL below.
Please note that you will need to update the BASEURL
and the APITOKEN
for the command to function.
export BASEURL=https://taurus-protect-instance.com
export APIToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZXh0ZXJuYWxVc2VySUQiOiJ0ZWFtMUV4dGVybmFsVXNlcklEIiwidGVuYW50SUQiOjEsImNhcGl0YWxUZW5hbnRJRCI6MSwiZmlyc3RuYW1lIjoiSm9obiIsImxhc3RuYW1lIjoiRG9lIiwicm9sZXMiOlsidHB1c2VyIl0sImVtYWlsIjoidGVhbTFAYmFuay5jb20iLCJ1c2VybmFtZSI6InRlYW0xIiwiand0X3JlbmV3YWJsZV9hbW91bnQiOjAsImlzX3RvdHBfZW5hYmxlZCI6ZmFsc2UsImF1dGhfc3RhdHVzIjoiU1VDQ0VTUyIsImxhc3RfbG9naW4iOiIyMDIzLTAxLTAxVDAwOjAwOjAwLjE0OTc0NDIzMloiLCJsb2dnZWRfaW5fd2l0aF9zc28iOmZhbHNlLCJrZXkiOiIiLCJleHAiOjE2ODEyMTkyNzYsImlhdCI6MTY4MTIxNzQ3Nn0.K_85arIrigpkN1yHttCydpeT6oVg2c6PyQnuji907Og
curl --location "$BASEURL/api/rest/v1/reports/mt535?blockchain=BTC&blockchainaddress=3EcgcMJxiQzWpTtW7eH94GLPeQ3yVFJJtE' \
--header 'Accept: application/json' \
--header 'Accept: text/plain' \
--header ""Authorization: Bearer $APIToken"
This piece of code submits a GET request to https://your-protect-instance.example.com/api/rest/v1/reports/mt535 with the relevant Address and Blockchain as path parameters.
Call Result
A successful response for the GET call to get the balance of the respective Address in SWIFT format might look like this:
{1:F01TARSCHGGAXXX1682425355}{2:O5351222230425TARSCHGGAXXX16824253552304251222N}{3:{108:aK50hJKjy9OSfGsQ}}{4:
:16R:GENL
:28E:1/ONLY
:20C::SEME//aK50hJKjy9OSfGsQ
:23G:NEWM
:98C::PREP//20230425122235
:98A::STAT//20230425
:22F::SFRE//DAIL
:22F::CODE//COMP
:22F::STTY//CUST
:22F::STBA//SETT
:97A::SAFE//3EcgcMJxiQzWpTtW7eH94GLPeQ3yVFJJtE
:17B::ACTI//Y
:17B::CONS//N
:16S:GENL
:16R:SUBSAFE
:97A::SAFE//3EcgcMJxiQzWpTtW7eH94GLPeQ3yVFJJtE
:17B::ACTI//Y
:16R:FIN
:35B:/XX/ISO4217/BTC
Bitcoin
:93B::AGGR//UNIT/0,00001
:93B::AVAI//UNIT/0,00001
:16R:SUBBAL
:93B::AGGR//UNIT/0,00001
:93B::AVAI//UNIT/0,00001
:90B::MRKT//ACTU/CHF24473,92
:98A::PRIC//20230425
:19A::HOLD//CHF0,24
:16S:SUBBAL
:19A::HOLD//CHF0,24
:16S:FIN
:16S:SUBSAFE
:16R:ADDINFO
:19A::HOLP//CHF0,24
:16S:ADDINFO
-}
Call Result II
If you remove the
'Accept: text/plain'
Header from your Request, then the response will be in JSON and Base64 Format. In this case, a successful response for the GET call to get the balance of the respective Address in SWIFT format might look like this:
{
"content_type": "text/plain",
"data": "ezE6RjAxVEFSU0NIR0dBW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ing the address balance in SWIFT format for the given Address.
Requirements for Future Use
For this endpoint, the storing requirements vary according to the use case.
You can find the Swagger-generated page for this endpoint in the following link.
Updated 22 days ago