Skip to content

Latest commit

 

History

History
1250 lines (938 loc) · 46.3 KB

UserApi.md

File metadata and controls

1250 lines (938 loc) · 46.3 KB

swagger_client.UserApi

All URIs are relative to https://localhost/api/v1

Method HTTP request Description
user_cancel_withdrawal POST /user/cancelWithdrawal Cancel a withdrawal.
user_check_referral_code GET /user/checkReferralCode Check if a referral code is valid.
user_confirm POST /user/confirmEmail Confirm your email address with a token.
user_confirm_enable_tfa POST /user/confirmEnableTFA Confirm two-factor auth for this account. If using a Yubikey, simply send a token to this endpoint.
user_confirm_withdrawal POST /user/confirmWithdrawal Confirm a withdrawal.
user_disable_tfa POST /user/disableTFA Disable two-factor auth for this account.
user_get GET /user Get your user model.
user_get_affiliate_status GET /user/affiliateStatus Get your current affiliate/referral status.
user_get_commission GET /user/commission Get your account's commission status.
user_get_deposit_address GET /user/depositAddress Get a deposit address.
user_get_margin GET /user/margin Get your account's margin status. Send a currency of "all" to receive an array of all supported currencies.
user_get_wallet GET /user/wallet Get your current wallet information.
user_get_wallet_history GET /user/walletHistory Get a history of all of your wallet transactions (deposits, withdrawals, PNL).
user_get_wallet_summary GET /user/walletSummary Get a summary of all of your wallet transactions (deposits, withdrawals, PNL).
user_logout POST /user/logout Log out of BitMEX.
user_logout_all POST /user/logoutAll Log all systems out of BitMEX. This will revoke all of your account's access tokens, logging you out on all devices.
user_min_withdrawal_fee GET /user/minWithdrawalFee Get the minimum withdrawal fee for a currency.
user_request_enable_tfa POST /user/requestEnableTFA Get secret key for setting up two-factor auth.
user_request_withdrawal POST /user/requestWithdrawal Request a withdrawal to an external wallet.
user_save_preferences POST /user/preferences Save user preferences.
user_update PUT /user Update your password, name, and other attributes.

user_cancel_withdrawal

Transaction user_cancel_withdrawal(token)

Cancel a withdrawal.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.UserApi()
token = 'token_example' # str | 

try: 
    # Cancel a withdrawal.
    api_response = api_instance.user_cancel_withdrawal(token)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->user_cancel_withdrawal: %s\n" % e)

Parameters

Name Type Description Notes
token str

Return type

Transaction

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

user_check_referral_code

float user_check_referral_code(referral_code=referral_code)

Check if a referral code is valid.

If the code is valid, responds with the referral code's discount (e.g. 0.1 for 10%). Otherwise, will return a 404.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.UserApi()
referral_code = 'referral_code_example' # str |  (optional)

try: 
    # Check if a referral code is valid.
    api_response = api_instance.user_check_referral_code(referral_code=referral_code)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->user_check_referral_code: %s\n" % e)

Parameters

Name Type Description Notes
referral_code str [optional]

Return type

float

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

user_confirm

AccessToken user_confirm(token)

Confirm your email address with a token.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.UserApi()
token = 'token_example' # str | 

try: 
    # Confirm your email address with a token.
    api_response = api_instance.user_confirm(token)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->user_confirm: %s\n" % e)

Parameters

Name Type Description Notes
token str

Return type

AccessToken

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

user_confirm_enable_tfa

bool user_confirm_enable_tfa(token, type=type)

Confirm two-factor auth for this account. If using a Yubikey, simply send a token to this endpoint.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiKey
configuration = swagger_client.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: apiNonce
configuration = swagger_client.Configuration()
configuration.api_key['api-nonce'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-nonce'] = 'Bearer'
# Configure API key authorization: apiSignature
configuration = swagger_client.Configuration()
configuration.api_key['api-signature'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-signature'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
token = 'token_example' # str | Token from your selected TFA type.
type = 'type_example' # str | Two-factor auth type. Supported types: 'GA' (Google Authenticator), 'Yubikey' (optional)

try: 
    # Confirm two-factor auth for this account. If using a Yubikey, simply send a token to this endpoint.
    api_response = api_instance.user_confirm_enable_tfa(token, type=type)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->user_confirm_enable_tfa: %s\n" % e)

Parameters

Name Type Description Notes
token str Token from your selected TFA type.
type str Two-factor auth type. Supported types: 'GA' (Google Authenticator), 'Yubikey' [optional]

Return type

bool

Authorization

apiKey, apiNonce, apiSignature

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

user_confirm_withdrawal

Transaction user_confirm_withdrawal(token)

Confirm a withdrawal.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.UserApi()
token = 'token_example' # str | 

try: 
    # Confirm a withdrawal.
    api_response = api_instance.user_confirm_withdrawal(token)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->user_confirm_withdrawal: %s\n" % e)

Parameters

Name Type Description Notes
token str

Return type

Transaction

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

user_disable_tfa

bool user_disable_tfa(token, type=type)

Disable two-factor auth for this account.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiKey
configuration = swagger_client.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: apiNonce
configuration = swagger_client.Configuration()
configuration.api_key['api-nonce'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-nonce'] = 'Bearer'
# Configure API key authorization: apiSignature
configuration = swagger_client.Configuration()
configuration.api_key['api-signature'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-signature'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
token = 'token_example' # str | Token from your selected TFA type.
type = 'type_example' # str | Two-factor auth type. Supported types: 'GA' (Google Authenticator) (optional)

try: 
    # Disable two-factor auth for this account.
    api_response = api_instance.user_disable_tfa(token, type=type)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->user_disable_tfa: %s\n" % e)

Parameters

Name Type Description Notes
token str Token from your selected TFA type.
type str Two-factor auth type. Supported types: 'GA' (Google Authenticator) [optional]

Return type

bool

Authorization

apiKey, apiNonce, apiSignature

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

user_get

User user_get()

Get your user model.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiKey
configuration = swagger_client.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: apiNonce
configuration = swagger_client.Configuration()
configuration.api_key['api-nonce'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-nonce'] = 'Bearer'
# Configure API key authorization: apiSignature
configuration = swagger_client.Configuration()
configuration.api_key['api-signature'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-signature'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))

try: 
    # Get your user model.
    api_response = api_instance.user_get()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->user_get: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

User

Authorization

apiKey, apiNonce, apiSignature

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

user_get_affiliate_status

Affiliate user_get_affiliate_status()

Get your current affiliate/referral status.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiKey
configuration = swagger_client.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: apiNonce
configuration = swagger_client.Configuration()
configuration.api_key['api-nonce'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-nonce'] = 'Bearer'
# Configure API key authorization: apiSignature
configuration = swagger_client.Configuration()
configuration.api_key['api-signature'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-signature'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))

try: 
    # Get your current affiliate/referral status.
    api_response = api_instance.user_get_affiliate_status()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->user_get_affiliate_status: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

Affiliate

Authorization

apiKey, apiNonce, apiSignature

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

user_get_commission

list[UserCommission] user_get_commission()

Get your account's commission status.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiKey
configuration = swagger_client.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: apiNonce
configuration = swagger_client.Configuration()
configuration.api_key['api-nonce'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-nonce'] = 'Bearer'
# Configure API key authorization: apiSignature
configuration = swagger_client.Configuration()
configuration.api_key['api-signature'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-signature'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))

try: 
    # Get your account's commission status.
    api_response = api_instance.user_get_commission()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->user_get_commission: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

list[UserCommission]

Authorization

apiKey, apiNonce, apiSignature

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

user_get_deposit_address

str user_get_deposit_address(currency=currency)

Get a deposit address.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiKey
configuration = swagger_client.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: apiNonce
configuration = swagger_client.Configuration()
configuration.api_key['api-nonce'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-nonce'] = 'Bearer'
# Configure API key authorization: apiSignature
configuration = swagger_client.Configuration()
configuration.api_key['api-signature'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-signature'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
currency = 'XBt' # str |  (optional) (default to XBt)

try: 
    # Get a deposit address.
    api_response = api_instance.user_get_deposit_address(currency=currency)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->user_get_deposit_address: %s\n" % e)

Parameters

Name Type Description Notes
currency str [optional] [default to XBt]

Return type

str

Authorization

apiKey, apiNonce, apiSignature

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

user_get_margin

Margin user_get_margin(currency=currency)

Get your account's margin status. Send a currency of "all" to receive an array of all supported currencies.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiKey
configuration = swagger_client.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: apiNonce
configuration = swagger_client.Configuration()
configuration.api_key['api-nonce'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-nonce'] = 'Bearer'
# Configure API key authorization: apiSignature
configuration = swagger_client.Configuration()
configuration.api_key['api-signature'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-signature'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
currency = 'XBt' # str |  (optional) (default to XBt)

try: 
    # Get your account's margin status. Send a currency of \"all\" to receive an array of all supported currencies.
    api_response = api_instance.user_get_margin(currency=currency)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->user_get_margin: %s\n" % e)

Parameters

Name Type Description Notes
currency str [optional] [default to XBt]

Return type

Margin

Authorization

apiKey, apiNonce, apiSignature

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

user_get_wallet

Wallet user_get_wallet(currency=currency)

Get your current wallet information.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiKey
configuration = swagger_client.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: apiNonce
configuration = swagger_client.Configuration()
configuration.api_key['api-nonce'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-nonce'] = 'Bearer'
# Configure API key authorization: apiSignature
configuration = swagger_client.Configuration()
configuration.api_key['api-signature'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-signature'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
currency = 'XBt' # str |  (optional) (default to XBt)

try: 
    # Get your current wallet information.
    api_response = api_instance.user_get_wallet(currency=currency)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->user_get_wallet: %s\n" % e)

Parameters

Name Type Description Notes
currency str [optional] [default to XBt]

Return type

Wallet

Authorization

apiKey, apiNonce, apiSignature

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

user_get_wallet_history

list[Transaction] user_get_wallet_history(currency=currency)

Get a history of all of your wallet transactions (deposits, withdrawals, PNL).

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiKey
configuration = swagger_client.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: apiNonce
configuration = swagger_client.Configuration()
configuration.api_key['api-nonce'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-nonce'] = 'Bearer'
# Configure API key authorization: apiSignature
configuration = swagger_client.Configuration()
configuration.api_key['api-signature'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-signature'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
currency = 'XBt' # str |  (optional) (default to XBt)

try: 
    # Get a history of all of your wallet transactions (deposits, withdrawals, PNL).
    api_response = api_instance.user_get_wallet_history(currency=currency)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->user_get_wallet_history: %s\n" % e)

Parameters

Name Type Description Notes
currency str [optional] [default to XBt]

Return type

list[Transaction]

Authorization

apiKey, apiNonce, apiSignature

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

user_get_wallet_summary

list[Transaction] user_get_wallet_summary(currency=currency)

Get a summary of all of your wallet transactions (deposits, withdrawals, PNL).

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiKey
configuration = swagger_client.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: apiNonce
configuration = swagger_client.Configuration()
configuration.api_key['api-nonce'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-nonce'] = 'Bearer'
# Configure API key authorization: apiSignature
configuration = swagger_client.Configuration()
configuration.api_key['api-signature'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-signature'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
currency = 'XBt' # str |  (optional) (default to XBt)

try: 
    # Get a summary of all of your wallet transactions (deposits, withdrawals, PNL).
    api_response = api_instance.user_get_wallet_summary(currency=currency)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->user_get_wallet_summary: %s\n" % e)

Parameters

Name Type Description Notes
currency str [optional] [default to XBt]

Return type

list[Transaction]

Authorization

apiKey, apiNonce, apiSignature

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

user_logout

user_logout()

Log out of BitMEX.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.UserApi()

try: 
    # Log out of BitMEX.
    api_instance.user_logout()
except ApiException as e:
    print("Exception when calling UserApi->user_logout: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

user_logout_all

float user_logout_all()

Log all systems out of BitMEX. This will revoke all of your account's access tokens, logging you out on all devices.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiKey
configuration = swagger_client.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: apiNonce
configuration = swagger_client.Configuration()
configuration.api_key['api-nonce'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-nonce'] = 'Bearer'
# Configure API key authorization: apiSignature
configuration = swagger_client.Configuration()
configuration.api_key['api-signature'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-signature'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))

try: 
    # Log all systems out of BitMEX. This will revoke all of your account's access tokens, logging you out on all devices.
    api_response = api_instance.user_logout_all()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->user_logout_all: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

float

Authorization

apiKey, apiNonce, apiSignature

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

user_min_withdrawal_fee

object user_min_withdrawal_fee(currency=currency)

Get the minimum withdrawal fee for a currency.

This is changed based on network conditions to ensure timely withdrawals. During network congestion, this may be high. The fee is returned in the same currency.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.UserApi()
currency = 'XBt' # str |  (optional) (default to XBt)

try: 
    # Get the minimum withdrawal fee for a currency.
    api_response = api_instance.user_min_withdrawal_fee(currency=currency)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->user_min_withdrawal_fee: %s\n" % e)

Parameters

Name Type Description Notes
currency str [optional] [default to XBt]

Return type

object

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

user_request_enable_tfa

bool user_request_enable_tfa(type=type)

Get secret key for setting up two-factor auth.

Use /confirmEnableTFA directly for Yubikeys. This fails if TFA is already enabled.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiKey
configuration = swagger_client.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: apiNonce
configuration = swagger_client.Configuration()
configuration.api_key['api-nonce'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-nonce'] = 'Bearer'
# Configure API key authorization: apiSignature
configuration = swagger_client.Configuration()
configuration.api_key['api-signature'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-signature'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
type = 'type_example' # str | Two-factor auth type. Supported types: 'GA' (Google Authenticator) (optional)

try: 
    # Get secret key for setting up two-factor auth.
    api_response = api_instance.user_request_enable_tfa(type=type)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->user_request_enable_tfa: %s\n" % e)

Parameters

Name Type Description Notes
type str Two-factor auth type. Supported types: 'GA' (Google Authenticator) [optional]

Return type

bool

Authorization

apiKey, apiNonce, apiSignature

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

user_request_withdrawal

Transaction user_request_withdrawal(currency, amount, address, otp_token=otp_token, fee=fee)

Request a withdrawal to an external wallet.

This will send a confirmation email to the email address on record, unless requested via an API Key with the withdraw permission.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiKey
configuration = swagger_client.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: apiNonce
configuration = swagger_client.Configuration()
configuration.api_key['api-nonce'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-nonce'] = 'Bearer'
# Configure API key authorization: apiSignature
configuration = swagger_client.Configuration()
configuration.api_key['api-signature'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-signature'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
currency = 'XBt' # str | Currency you're withdrawing. Options: `XBt` (default to XBt)
amount = 3.4 # float | Amount of withdrawal currency.
address = 'address_example' # str | Destination Address.
otp_token = 'otp_token_example' # str | 2FA token. Required if 2FA is enabled on your account. (optional)
fee = 1.2 # float | Network fee for Bitcoin withdrawals. If not specified, a default value will be calculated based on Bitcoin network conditions. You will have a chance to confirm this via email. (optional)

try: 
    # Request a withdrawal to an external wallet.
    api_response = api_instance.user_request_withdrawal(currency, amount, address, otp_token=otp_token, fee=fee)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->user_request_withdrawal: %s\n" % e)

Parameters

Name Type Description Notes
currency str Currency you're withdrawing. Options: `XBt` [default to XBt]
amount float Amount of withdrawal currency.
address str Destination Address.
otp_token str 2FA token. Required if 2FA is enabled on your account. [optional]
fee float Network fee for Bitcoin withdrawals. If not specified, a default value will be calculated based on Bitcoin network conditions. You will have a chance to confirm this via email. [optional]

Return type

Transaction

Authorization

apiKey, apiNonce, apiSignature

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

user_save_preferences

User user_save_preferences(prefs, overwrite=overwrite)

Save user preferences.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiKey
configuration = swagger_client.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: apiNonce
configuration = swagger_client.Configuration()
configuration.api_key['api-nonce'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-nonce'] = 'Bearer'
# Configure API key authorization: apiSignature
configuration = swagger_client.Configuration()
configuration.api_key['api-signature'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-signature'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
prefs = 'prefs_example' # str | 
overwrite = false # bool | If true, will overwrite all existing preferences. (optional) (default to false)

try: 
    # Save user preferences.
    api_response = api_instance.user_save_preferences(prefs, overwrite=overwrite)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->user_save_preferences: %s\n" % e)

Parameters

Name Type Description Notes
prefs str
overwrite bool If true, will overwrite all existing preferences. [optional] [default to false]

Return type

User

Authorization

apiKey, apiNonce, apiSignature

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

user_update

User user_update(firstname=firstname, lastname=lastname, old_password=old_password, new_password=new_password, new_password_confirm=new_password_confirm, username=username, country=country, pgp_pub_key=pgp_pub_key)

Update your password, name, and other attributes.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiKey
configuration = swagger_client.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: apiNonce
configuration = swagger_client.Configuration()
configuration.api_key['api-nonce'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-nonce'] = 'Bearer'
# Configure API key authorization: apiSignature
configuration = swagger_client.Configuration()
configuration.api_key['api-signature'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-signature'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
firstname = 'firstname_example' # str |  (optional)
lastname = 'lastname_example' # str |  (optional)
old_password = 'old_password_example' # str |  (optional)
new_password = 'new_password_example' # str |  (optional)
new_password_confirm = 'new_password_confirm_example' # str |  (optional)
username = 'username_example' # str | Username can only be set once. To reset, email support. (optional)
country = 'country_example' # str | Country of residence. (optional)
pgp_pub_key = 'pgp_pub_key_example' # str | PGP Public Key. If specified, automated emails will be sentwith this key. (optional)

try: 
    # Update your password, name, and other attributes.
    api_response = api_instance.user_update(firstname=firstname, lastname=lastname, old_password=old_password, new_password=new_password, new_password_confirm=new_password_confirm, username=username, country=country, pgp_pub_key=pgp_pub_key)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->user_update: %s\n" % e)

Parameters

Name Type Description Notes
firstname str [optional]
lastname str [optional]
old_password str [optional]
new_password str [optional]
new_password_confirm str [optional]
username str Username can only be set once. To reset, email support. [optional]
country str Country of residence. [optional]
pgp_pub_key str PGP Public Key. If specified, automated emails will be sentwith this key. [optional]

Return type

User

Authorization

apiKey, apiNonce, apiSignature

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]