User
This documentation provides details on the API endpoints available for Whirlprivacy.io, focusing on user-related operations.
โ ๏ธ You must be logged in to use these requests.
Common Headers
For all requests that require user authentication, you must include the following headers:
X-API-key
base64
API token obtained after authentication.
GET /user/balance
โ Get User Asset Balance
/user/balance
โ Get User Asset BalanceDescription:
Retrieves the balance of the specified asset for the authenticated user. It checks whether the asset exists and if the user has a balance greater than 0, then formats and returns the balance amount.
Parameters:
ticker
string
The ticker symbol of the asset.
Response:
Error Handling:
E_INVALID_TICKER
The provided ticker is invalid.
Example Code:
GET /user/balances
โ Get User Balances
/user/balances
โ Get User BalancesDescription:
Retrieves all asset balances from the expected user.
Parameters:
user
string
The user to check the balance
Response:
Error Handling:
E_UNAUTHORIZED
The user is not authorized.
Example Code:
General Error Handling
This section covers errors that are common across multiple endpoints.
E_UNAUTHORIZED
The user is not authenticated or lacks the necessary permissions.
E_INVALID_TICKER
The specified ticker symbol does not correspond to a valid asset.
GET /user/addresses
โ User Withdrawal Addresses
/user/addresses
โ User Withdrawal AddressesDescription:
Retrieves the active withdrawal addresses of the logged-in user.
Parameters:
page
Query
No
The page number of the withdrawal addresses to retrieve. Defaults to 1
.
Response:
Error Handling:
E_UNAUTHORIZED
Unauthorized access to the endpoint.
Example Code:
GET /user/addresses/all
โ All User Withdrawal Addresses
/user/addresses/all
โ All User Withdrawal AddressesDescription:
Returns a complete list of the user's withdrawal addresses, irrespective of their status.
Parameters:
No parameters are required for this request.
Response:
Error Handling:
E_UNAUTHORIZED
Unauthorized access to the endpoint.
Example Code:
POST /user/addresses
โ Create Withdrawal Address
/user/addresses
โ Create Withdrawal AddressDescription:
Allows the logged-in user to add a new withdrawal address to their account.
Parameters:
address
Body
Yes
The withdrawal address to add. Must be a valid address format.
name
Body
Yes
A name to associate with the withdrawal address.
Response:
Error Handling:
E_INVALID_PARAMS
One or more provided parameters are invalid.
E_MAX_ADDRESSES
The maximum number of addresses for the user has been reached.
E_CREATING_ADDRESS
An error occurred while creating the address, possibly because it's already registered.
E_UNAUTHORIZED
Unauthorized access to the endpoint.
Example Code:
PUT /user/addresses
โ Disable Withdrawal Address
/user/addresses
โ Disable Withdrawal AddressDescription:
Allows the logged-in user to disable an existing withdrawal address.
Parameters:
address
Body
Yes
The withdrawal address to disable.
Response:
Error Handling:
E_DISABLING_ADDRESS
An error occurred while disabling the address, possibly because it's not registered or already disabled.
E_UNAUTHORIZED
Unauthorized access to the endpoint.
Example Code:
PUT /user/api/generate
โ Generate API Key
/user/api/generate
โ Generate API KeyThis request is only possible via the standard auth on our platform. Apart from these 3 routes (and the auth/register part), all other auth routes can be accessed either via the jwt (X-API-key header) after having signed the challenge, or via the X-API-key.
Description:
Generates a new API key for the authenticated user.
Parameters:
request
Object
The HTTP request object.
response
Object
The HTTP response object.
Response:
Error Handling:
200
Success, but no API key generated.
401
Unauthorized access.
429
Too many requests, regeneration timeout not passed.
Example Code:
PUT /user/api/disable
โ Disable API Key
/user/api/disable
โ Disable API KeyThis request is only possible via the standard auth on our platform. Apart from these 3 routes (and the auth/register part), all other auth routes can be accessed either via the jwt (X-API-key header) after having signed the challenge, or via the X-API-key.
Description:
Disables the current API key for the authenticated user.
Parameters:
request
Object
The HTTP request object.
auth
Object
Authentication information.
response
Object
The HTTP response object.
Response:
Error Handling:
200
Success.
401
Unauthorized access.
Example Code:
GET /user/api
โ Get API Key
/user/api
โ Get API KeyThis request is only possible via the standard auth on our platform. Apart from these 3 routes (and the auth/register part), all other auth routes can be accessed either via the jwt (X-API-key header) after having signed the challenge, or via the X-API-key.
Description:
Retrieves the current API key for the authenticated user.
Parameters:
request
Object
The HTTP request object.
response
Object
The HTTP response object.
Response:
Error Handling:
200
Success.
401
Unauthorized access.
Example Code:
Last updated