Skip to content

Latest commit

 

History

History
333 lines (253 loc) · 13.2 KB

APIKeyApi.md

File metadata and controls

333 lines (253 loc) · 13.2 KB

swagger_client.APIKeyApi

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

Method HTTP request Description
a_pi_key_disable POST /apiKey/disable Disable an API Key.
a_pi_key_enable POST /apiKey/enable Enable an API Key.
a_pi_key_get GET /apiKey Get your API Keys.
a_pi_key_new POST /apiKey Create a new API Key.
a_pi_key_remove DELETE /apiKey Remove an API Key.

a_pi_key_disable

APIKey a_pi_key_disable(api_key_id)

Disable an API Key.

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.APIKeyApi(swagger_client.ApiClient(configuration))
api_key_id = 'api_key_id_example' # str | API Key ID (public component).

try:
    # Disable an API Key.
    api_response = api_instance.a_pi_key_disable(api_key_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling APIKeyApi->a_pi_key_disable: %s\n" % e)

Parameters

Name Type Description Notes
api_key_id str API Key ID (public component).

Return type

APIKey

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]

a_pi_key_enable

APIKey a_pi_key_enable(api_key_id)

Enable an API Key.

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.APIKeyApi(swagger_client.ApiClient(configuration))
api_key_id = 'api_key_id_example' # str | API Key ID (public component).

try:
    # Enable an API Key.
    api_response = api_instance.a_pi_key_enable(api_key_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling APIKeyApi->a_pi_key_enable: %s\n" % e)

Parameters

Name Type Description Notes
api_key_id str API Key ID (public component).

Return type

APIKey

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]

a_pi_key_get

list[APIKey] a_pi_key_get(reverse=reverse)

Get your API Keys.

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.APIKeyApi(swagger_client.ApiClient(configuration))
reverse = false # bool | If true, will sort results newest first. (optional) (default to false)

try:
    # Get your API Keys.
    api_response = api_instance.a_pi_key_get(reverse=reverse)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling APIKeyApi->a_pi_key_get: %s\n" % e)

Parameters

Name Type Description Notes
reverse bool If true, will sort results newest first. [optional] [default to false]

Return type

list[APIKey]

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]

a_pi_key_new

APIKey a_pi_key_new(name=name, cidr=cidr, permissions=permissions, enabled=enabled, token=token)

Create a new API Key.

API Keys can only be created via the frontend.

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.APIKeyApi(swagger_client.ApiClient(configuration))
name = 'name_example' # str | Key name. This name is for reference only. (optional)
cidr = 'cidr_example' # str | CIDR block to restrict this key to. To restrict to a single address, append \"/32\", e.g. 207.39.29.22/32. Leave blank or set to 0.0.0.0/0 to allow all IPs. Only one block may be set. <a href=\"http://software77.net/cidr-101.html\">More on CIDR blocks</a> (optional)
permissions = 'permissions_example' # str | Key Permissions. All keys can read margin and position data. Additional permissions must be added. Available: [\"order\", \"orderCancel\", \"withdraw\"]. (optional)
enabled = false # bool | Set to true to enable this key on creation. Otherwise, it must be explicitly enabled via /apiKey/enable. (optional) (default to false)
token = 'token_example' # str | OTP Token (YubiKey, Google Authenticator) (optional)

try:
    # Create a new API Key.
    api_response = api_instance.a_pi_key_new(name=name, cidr=cidr, permissions=permissions, enabled=enabled, token=token)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling APIKeyApi->a_pi_key_new: %s\n" % e)

Parameters

Name Type Description Notes
name str Key name. This name is for reference only. [optional]
cidr str CIDR block to restrict this key to. To restrict to a single address, append &quot;/32&quot;, e.g. 207.39.29.22/32. Leave blank or set to 0.0.0.0/0 to allow all IPs. Only one block may be set. <a href=&quot;http://software77.net/cidr-101.html\&quot;&gt;More on CIDR blocks</a> [optional]
permissions str Key Permissions. All keys can read margin and position data. Additional permissions must be added. Available: [&quot;order&quot;, &quot;orderCancel&quot;, &quot;withdraw&quot;]. [optional]
enabled bool Set to true to enable this key on creation. Otherwise, it must be explicitly enabled via /apiKey/enable. [optional] [default to false]
token str OTP Token (YubiKey, Google Authenticator) [optional]

Return type

APIKey

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]

a_pi_key_remove

InlineResponse200 a_pi_key_remove(api_key_id)

Remove an API Key.

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.APIKeyApi(swagger_client.ApiClient(configuration))
api_key_id = 'api_key_id_example' # str | API Key ID (public component).

try:
    # Remove an API Key.
    api_response = api_instance.a_pi_key_remove(api_key_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling APIKeyApi->a_pi_key_remove: %s\n" % e)

Parameters

Name Type Description Notes
api_key_id str API Key ID (public component).

Return type

InlineResponse200

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]