Skip to content

Latest commit

 

History

History
464 lines (360 loc) · 28.7 KB

File metadata and controls

464 lines (360 loc) · 28.7 KB

cryptoapis.ManageSubscriptionsApi

All URIs are relative to https://rest.cryptoapis.io

Method HTTP request Description
activate_blockchain_event_subscription POST /blockchain-events/subscriptions/{referenceId}/activate Activate Blockchain Event Subscription
delete_blockchain_event_subscription DELETE /blockchain-events/{blockchain}/{network}/subscriptions/{referenceId} Delete Blockchain Event Subscription
get_blockchain_event_subscription_details_by_reference_id GET /blockchain-events/subscriptions/{referenceId} Get Blockchain Event Subscription Details By Reference ID
list_blockchain_events_subscriptions GET /blockchain-events/{blockchain}/{network}/subscriptions List Blockchain Events Subscriptions

activate_blockchain_event_subscription

ActivateBlockchainEventSubscriptionR activate_blockchain_event_subscription(reference_id)

Activate Blockchain Event Subscription

Through this endpoint customers can reactivate an event subscription (callback) which has been deactivated by the system. Deactivations could happen due to various reasons, most often "maximum retry attempts reached".

Example

  • Api Key Authentication (ApiKey):
import time
import cryptoapis
from cryptoapis.api import manage_subscriptions_api
from cryptoapis.model.convert_bitcoin_cash_address429_response import ConvertBitcoinCashAddress429Response
from cryptoapis.model.convert_bitcoin_cash_address500_response import ConvertBitcoinCashAddress500Response
from cryptoapis.model.activate_blockchain_event_subscription400_response import ActivateBlockchainEventSubscription400Response
from cryptoapis.model.convert_bitcoin_cash_address422_response import ConvertBitcoinCashAddress422Response
from cryptoapis.model.activate_blockchain_event_subscription403_response import ActivateBlockchainEventSubscription403Response
from cryptoapis.model.activate_blockchain_event_subscription401_response import ActivateBlockchainEventSubscription401Response
from cryptoapis.model.get_xrp_ripple_transaction_details_by_transaction_id404_response import GetXRPRippleTransactionDetailsByTransactionID404Response
from cryptoapis.model.activate_blockchain_event_subscription_rb import ActivateBlockchainEventSubscriptionRB
from cryptoapis.model.activate_blockchain_event_subscription_r import ActivateBlockchainEventSubscriptionR
from cryptoapis.model.convert_bitcoin_cash_address402_response import ConvertBitcoinCashAddress402Response
from cryptoapis.model.convert_bitcoin_cash_address409_response import ConvertBitcoinCashAddress409Response
from cryptoapis.model.convert_bitcoin_cash_address415_response import ConvertBitcoinCashAddress415Response
from pprint import pprint
# Defining the host is optional and defaults to https://rest.cryptoapis.io
# See configuration.py for a list of all supported configuration parameters.
configuration = cryptoapis.Configuration(
    host = "https://rest.cryptoapis.io"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'

# Enter a context with an instance of the API client
with cryptoapis.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = manage_subscriptions_api.ManageSubscriptionsApi(api_client)
    reference_id = "bc243c86-0902-4386-b30d-e6b30fa1f2aa" # str | Represents a unique ID used to reference the specific callback subscription.
    context = "yourExampleString" # str | In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. (optional)
    activate_blockchain_event_subscription_rb = ActivateBlockchainEventSubscriptionRB(
        context="yourExampleString",
        data=ActivateBlockchainEventSubscriptionRBData(
            item={},
        ),
    ) # ActivateBlockchainEventSubscriptionRB |  (optional)

    # example passing only required values which don't have defaults set
    try:
        # Activate Blockchain Event Subscription
        api_response = api_instance.activate_blockchain_event_subscription(reference_id)
        pprint(api_response)
    except cryptoapis.ApiException as e:
        print("Exception when calling ManageSubscriptionsApi->activate_blockchain_event_subscription: %s\n" % e)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # Activate Blockchain Event Subscription
        api_response = api_instance.activate_blockchain_event_subscription(reference_id, context=context, activate_blockchain_event_subscription_rb=activate_blockchain_event_subscription_rb)
        pprint(api_response)
    except cryptoapis.ApiException as e:
        print("Exception when calling ManageSubscriptionsApi->activate_blockchain_event_subscription: %s\n" % e)

Parameters

Name Type Description Notes
reference_id str Represents a unique ID used to reference the specific callback subscription.
context str In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. [optional]
activate_blockchain_event_subscription_rb ActivateBlockchainEventSubscriptionRB [optional]

Return type

ActivateBlockchainEventSubscriptionR

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 The resource has been successfully created. -
400 400 -
401 401 -
402 You have insufficient credits. Please upgrade your plan from your Dashboard or contact our team via email. -
403 403 -
404 The specified resource has not been found. -
409 The data provided seems to be invalid. -
415 The selected Media Type is unavailable. The Content-Type header should be 'application/json'. -
422 Your request body for POST requests must have a structure of { data: { item: [...properties] } } -
429 The request limit has been reached. There can be maximum {requests} requests per {seconds} second(s) made. Please contact our team via email if you need more or upgrade your plan. -
500 An unexpected server error has occurred, we are working to fix this. Please try again later and in case it occurs again please report it to our team via email. -

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

delete_blockchain_event_subscription

DeleteBlockchainEventSubscriptionR delete_blockchain_event_subscription(blockchain, network, reference_id)

Delete Blockchain Event Subscription

Through this endpoint the customer can delete blockchain event subscriptions they have by attributes referenceId and network. Currently Crypto APIs 2.0 offers certain Blockchain event endpoints which allow the user to subscribe for one/a few/all and receive callback notifications when the specific event occurs. {note}To have an operational callback subscription, you need to first verify a domain for the Callback URL. Please see more information on Callbacks here.{/note} {warning}Crypto APIs will notify the user only when the event occurs. There are cases when the specific event doesn't happen at all, or takes a long time to do so. A callback notification will not be sent if the event does not or cannot occur, or will take long time to occur.{/warning}

Example

  • Api Key Authentication (ApiKey):
import time
import cryptoapis
from cryptoapis.api import manage_subscriptions_api
from cryptoapis.model.convert_bitcoin_cash_address429_response import ConvertBitcoinCashAddress429Response
from cryptoapis.model.convert_bitcoin_cash_address500_response import ConvertBitcoinCashAddress500Response
from cryptoapis.model.delete_blockchain_event_subscription403_response import DeleteBlockchainEventSubscription403Response
from cryptoapis.model.convert_bitcoin_cash_address422_response import ConvertBitcoinCashAddress422Response
from cryptoapis.model.delete_blockchain_event_subscription400_response import DeleteBlockchainEventSubscription400Response
from cryptoapis.model.get_xrp_ripple_transaction_details_by_transaction_id404_response import GetXRPRippleTransactionDetailsByTransactionID404Response
from cryptoapis.model.delete_blockchain_event_subscription401_response import DeleteBlockchainEventSubscription401Response
from cryptoapis.model.convert_bitcoin_cash_address402_response import ConvertBitcoinCashAddress402Response
from cryptoapis.model.convert_bitcoin_cash_address409_response import ConvertBitcoinCashAddress409Response
from cryptoapis.model.delete_blockchain_event_subscription_r import DeleteBlockchainEventSubscriptionR
from cryptoapis.model.convert_bitcoin_cash_address415_response import ConvertBitcoinCashAddress415Response
from pprint import pprint
# Defining the host is optional and defaults to https://rest.cryptoapis.io
# See configuration.py for a list of all supported configuration parameters.
configuration = cryptoapis.Configuration(
    host = "https://rest.cryptoapis.io"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'

# Enter a context with an instance of the API client
with cryptoapis.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = manage_subscriptions_api.ManageSubscriptionsApi(api_client)
    blockchain = "bitcoin" # str | Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.
    network = "testnet" # str | Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - \"mainnet\" is the live network with actual data while networks like \"testnet\", \"ropsten\" are test networks.
    reference_id = "d3fd6a0e-f2b6-4bb5-9fd3-7944bcec9e9f" # str | Represents a unique ID used to reference the specific callback subscription.
    context = "yourExampleString" # str | In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. (optional)

    # example passing only required values which don't have defaults set
    try:
        # Delete Blockchain Event Subscription
        api_response = api_instance.delete_blockchain_event_subscription(blockchain, network, reference_id)
        pprint(api_response)
    except cryptoapis.ApiException as e:
        print("Exception when calling ManageSubscriptionsApi->delete_blockchain_event_subscription: %s\n" % e)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # Delete Blockchain Event Subscription
        api_response = api_instance.delete_blockchain_event_subscription(blockchain, network, reference_id, context=context)
        pprint(api_response)
    except cryptoapis.ApiException as e:
        print("Exception when calling ManageSubscriptionsApi->delete_blockchain_event_subscription: %s\n" % e)

Parameters

Name Type Description Notes
blockchain str Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.
network str Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet" is the live network with actual data while networks like "testnet", "ropsten" are test networks.
reference_id str Represents a unique ID used to reference the specific callback subscription.
context str In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. [optional]

Return type

DeleteBlockchainEventSubscriptionR

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The delete request has been successful. -
400 400 -
401 401 -
402 You have insufficient credits. Please upgrade your plan from your Dashboard or contact our team via email. -
403 403 -
404 The specified resource has not been found. -
409 The data provided seems to be invalid. -
415 The selected Media Type is unavailable. The Content-Type header should be 'application/json'. -
422 Your request body for POST requests must have a structure of { data: { item: [...properties] } } -
429 The request limit has been reached. There can be maximum {requests} requests per {seconds} second(s) made. Please contact our team via email if you need more or upgrade your plan. -
500 An unexpected server error has occurred, we are working to fix this. Please try again later and in case it occurs again please report it to our team via email. -

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

get_blockchain_event_subscription_details_by_reference_id

GetBlockchainEventSubscriptionDetailsByReferenceIDR get_blockchain_event_subscription_details_by_reference_id(reference_id)

Get Blockchain Event Subscription Details By Reference ID

Through this endpoint the customer can get detailed information for a callback subscription by providing its reference ID. Currently Crypto APIs 2.0 offers certain Blockchain event endpoints which allow the user to subscribe for one/a few/all and receive callback notifications when the specific event occurs.

Example

  • Api Key Authentication (ApiKey):
import time
import cryptoapis
from cryptoapis.api import manage_subscriptions_api
from cryptoapis.model.convert_bitcoin_cash_address429_response import ConvertBitcoinCashAddress429Response
from cryptoapis.model.convert_bitcoin_cash_address500_response import ConvertBitcoinCashAddress500Response
from cryptoapis.model.get_blockchain_event_subscription_details_by_reference_id403_response import GetBlockchainEventSubscriptionDetailsByReferenceID403Response
from cryptoapis.model.convert_bitcoin_cash_address422_response import ConvertBitcoinCashAddress422Response
from cryptoapis.model.get_xrp_ripple_transaction_details_by_transaction_id404_response import GetXRPRippleTransactionDetailsByTransactionID404Response
from cryptoapis.model.convert_bitcoin_cash_address402_response import ConvertBitcoinCashAddress402Response
from cryptoapis.model.convert_bitcoin_cash_address409_response import ConvertBitcoinCashAddress409Response
from cryptoapis.model.get_blockchain_event_subscription_details_by_reference_id400_response import GetBlockchainEventSubscriptionDetailsByReferenceID400Response
from cryptoapis.model.get_blockchain_event_subscription_details_by_reference_id401_response import GetBlockchainEventSubscriptionDetailsByReferenceID401Response
from cryptoapis.model.get_blockchain_event_subscription_details_by_reference_idr import GetBlockchainEventSubscriptionDetailsByReferenceIDR
from cryptoapis.model.convert_bitcoin_cash_address415_response import ConvertBitcoinCashAddress415Response
from pprint import pprint
# Defining the host is optional and defaults to https://rest.cryptoapis.io
# See configuration.py for a list of all supported configuration parameters.
configuration = cryptoapis.Configuration(
    host = "https://rest.cryptoapis.io"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'

# Enter a context with an instance of the API client
with cryptoapis.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = manage_subscriptions_api.ManageSubscriptionsApi(api_client)
    reference_id = "bc243c86-0902-4386-b30d-e6b30fa1f2aa" # str | Represents a unique ID used to reference the specific callback subscription.
    context = "yourExampleString" # str | In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. (optional)

    # example passing only required values which don't have defaults set
    try:
        # Get Blockchain Event Subscription Details By Reference ID
        api_response = api_instance.get_blockchain_event_subscription_details_by_reference_id(reference_id)
        pprint(api_response)
    except cryptoapis.ApiException as e:
        print("Exception when calling ManageSubscriptionsApi->get_blockchain_event_subscription_details_by_reference_id: %s\n" % e)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # Get Blockchain Event Subscription Details By Reference ID
        api_response = api_instance.get_blockchain_event_subscription_details_by_reference_id(reference_id, context=context)
        pprint(api_response)
    except cryptoapis.ApiException as e:
        print("Exception when calling ManageSubscriptionsApi->get_blockchain_event_subscription_details_by_reference_id: %s\n" % e)

Parameters

Name Type Description Notes
reference_id str Represents a unique ID used to reference the specific callback subscription.
context str In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. [optional]

Return type

GetBlockchainEventSubscriptionDetailsByReferenceIDR

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The request has been successful. -
400 400 -
401 401 -
402 You have insufficient credits. Please upgrade your plan from your Dashboard or contact our team via email. -
403 403 -
404 The specified resource has not been found. -
409 The data provided seems to be invalid. -
415 The selected Media Type is unavailable. The Content-Type header should be 'application/json'. -
422 Your request body for POST requests must have a structure of { data: { item: [...properties] } } -
429 The request limit has been reached. There can be maximum {requests} requests per {seconds} second(s) made. Please contact our team via email if you need more or upgrade your plan. -
500 An unexpected server error has occurred, we are working to fix this. Please try again later and in case it occurs again please report it to our team via email. -

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

list_blockchain_events_subscriptions

ListBlockchainEventsSubscriptionsR list_blockchain_events_subscriptions(blockchain, network)

List Blockchain Events Subscriptions

Through this endpoint the customer can obtain a list of their callback subscriptions for the available Blockchain events. Currently Crypto APIs 2.0 offers certain Blockchain event endpoints which allow the user to subscribe for one/a few/all and receive callback notifications when the specific event occurs. {note}To have an operational callback subscription, you need to first verify a domain for the Callback URL. Please see more information on Callbacks here.{/note}

Example

  • Api Key Authentication (ApiKey):
import time
import cryptoapis
from cryptoapis.api import manage_subscriptions_api
from cryptoapis.model.convert_bitcoin_cash_address429_response import ConvertBitcoinCashAddress429Response
from cryptoapis.model.convert_bitcoin_cash_address500_response import ConvertBitcoinCashAddress500Response
from cryptoapis.model.convert_bitcoin_cash_address422_response import ConvertBitcoinCashAddress422Response
from cryptoapis.model.list_blockchain_events_subscriptions401_response import ListBlockchainEventsSubscriptions401Response
from cryptoapis.model.list_blockchain_events_subscriptions400_response import ListBlockchainEventsSubscriptions400Response
from cryptoapis.model.list_blockchain_events_subscriptions_r import ListBlockchainEventsSubscriptionsR
from cryptoapis.model.convert_bitcoin_cash_address402_response import ConvertBitcoinCashAddress402Response
from cryptoapis.model.convert_bitcoin_cash_address409_response import ConvertBitcoinCashAddress409Response
from cryptoapis.model.list_blockchain_events_subscriptions403_response import ListBlockchainEventsSubscriptions403Response
from cryptoapis.model.convert_bitcoin_cash_address415_response import ConvertBitcoinCashAddress415Response
from pprint import pprint
# Defining the host is optional and defaults to https://rest.cryptoapis.io
# See configuration.py for a list of all supported configuration parameters.
configuration = cryptoapis.Configuration(
    host = "https://rest.cryptoapis.io"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'

# Enter a context with an instance of the API client
with cryptoapis.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = manage_subscriptions_api.ManageSubscriptionsApi(api_client)
    blockchain = "bitcoin" # str | Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.
    network = "testnet" # str | Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - \"mainnet\" is the live network with actual data while networks like \"testnet\", \"ropsten\" are test networks.
    context = "yourExampleString" # str | In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. (optional)
    limit = 50 # int | Defines how many items should be returned in the response per page basis. (optional) if omitted the server will use the default value of 50
    offset = 0 # int | The starting index of the response items, i.e. where the response should start listing the returned items. (optional) if omitted the server will use the default value of 0

    # example passing only required values which don't have defaults set
    try:
        # List Blockchain Events Subscriptions
        api_response = api_instance.list_blockchain_events_subscriptions(blockchain, network)
        pprint(api_response)
    except cryptoapis.ApiException as e:
        print("Exception when calling ManageSubscriptionsApi->list_blockchain_events_subscriptions: %s\n" % e)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # List Blockchain Events Subscriptions
        api_response = api_instance.list_blockchain_events_subscriptions(blockchain, network, context=context, limit=limit, offset=offset)
        pprint(api_response)
    except cryptoapis.ApiException as e:
        print("Exception when calling ManageSubscriptionsApi->list_blockchain_events_subscriptions: %s\n" % e)

Parameters

Name Type Description Notes
blockchain str Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.
network str Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet" is the live network with actual data while networks like "testnet", "ropsten" are test networks.
context str In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. [optional]
limit int Defines how many items should be returned in the response per page basis. [optional] if omitted the server will use the default value of 50
offset int The starting index of the response items, i.e. where the response should start listing the returned items. [optional] if omitted the server will use the default value of 0

Return type

ListBlockchainEventsSubscriptionsR

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The request has been successful. -
400 400 -
401 401 -
402 You have insufficient credits. Please upgrade your plan from your Dashboard or contact our team via email. -
403 403 -
409 The data provided seems to be invalid. -
415 The selected Media Type is unavailable. The Content-Type header should be 'application/json'. -
422 Your request body for POST requests must have a structure of { data: { item: [...properties] } } -
429 The request limit has been reached. There can be maximum {requests} requests per {seconds} second(s) made. Please contact our team via email if you need more or upgrade your plan. -
500 An unexpected server error has occurred, we are working to fix this. Please try again later and in case it occurs again please report it to our team via email. -

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