๐Ÿง‘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:

Header Name
Value
Description

X-API-key

base64

API token obtained after authentication.

GET /user/balance โ€“ Get User Asset Balance

Description:

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:

Name
Type
Description

ticker

string

The ticker symbol of the asset.

Response:

{
  "error": [],
  "result": [
    {
      "amount": "0",
      "formatted": "0"
    }
  ]
}

Error Handling:

Error Name
Description

E_INVALID_TICKER

The provided ticker is invalid.

Example Code:

GET /user/balances โ€“ Get User Balances

Description:

Retrieves all asset balances from the expected user.

Parameters:

Name
Type
Description

user

string

The user to check the balance

Response:

Error Handling:

Error Name
Description

E_UNAUTHORIZED

The user is not authorized.

Example Code:

General Error Handling

This section covers errors that are common across multiple endpoints.

Error Name
Description

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

Description:

Retrieves the active withdrawal addresses of the logged-in user.

Parameters:

Name
Type
Required
Description

page

Query

No

The page number of the withdrawal addresses to retrieve. Defaults to 1.

Response:

Error Handling:

Error Code
Description

E_UNAUTHORIZED

Unauthorized access to the endpoint.

Example Code:

GET /user/addresses/all โ€“ All User Withdrawal Addresses

Description:

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:

Error Code
Description

E_UNAUTHORIZED

Unauthorized access to the endpoint.

Example Code:

POST /user/addresses โ€“ Create Withdrawal Address

Description:

Allows the logged-in user to add a new withdrawal address to their account.

Parameters:

Name
Type
Required
Description

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:

Error Code
Description

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

Description:

Allows the logged-in user to disable an existing withdrawal address.

Parameters:

Name
Type
Required
Description

address

Body

Yes

The withdrawal address to disable.

Response:

Error Handling:

Error Code
Description

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

This 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:

Parameter
Type
Description

request

Object

The HTTP request object.

response

Object

The HTTP response object.

Response:

Error Handling:

Error Code
Description

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

This 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:

Parameter
Type
Description

request

Object

The HTTP request object.

auth

Object

Authentication information.

response

Object

The HTTP response object.

Response:

Error Handling:

Error Code
Description

200

Success.

401

Unauthorized access.

Example Code:

GET /user/api โ€“ Get API Key

This 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:

Parameter
Type
Description

request

Object

The HTTP request object.

response

Object

The HTTP response object.

Response:

Error Handling:

Error Code
Description

200

Success.

401

Unauthorized access.

Example Code:

Last updated