NAV Navbar
shell java python php node.js javascript

Introduction

Coinscious Data Service - Alert API: We provide Alert API.

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Response

Coinscious uses standard HTTP response codes to indicate the success or failure of an API request. For example,
* Code 200 indicates success.
* Code 400 indicates an error that resulted from the provided information (e.g., a required parameter was missing).

JSON structure of an unexpected error response is the following:

{
  "code": "1001",
  "message": "Exchange not specified."
}

We support the following list of standard HTTP response codes:

Status Code Description
200 It's All Good.
400 Unexpected Error
Refer to the list of Error Codes we provide.
401 Unauthorized
403 Forbidden
404 Not Found
405 Method Not Allowed
429 Too Many Requests
500 Internal Server Error

Alert API

Alert Keys

Obtain supported alert types, keys and its required parameters.

HTTP Request

GET /alerts/keys

The request returns JSON structured like the following:

[
    {
        "alertType": "volume",
        "keys": [
            {
                "key": "volumePump",
                "extraParams": [
                    {
                        "param": "exchange",
                        "values": []
                    },
                    {
                        "param": "pair",
                        "values": []
                    }
                ]
            }
        ]
    },
    {
        "alertType": "blockchain",
        "keys": [
            {
                "key": "topTransaction",
                "extraParams": [
                    {
                        "param": "token",
                        "values": [
                            "btc",
                            "usdt"
                        ]
                    }
                ]
            }
        ]
    }
]

Responses

Code Description
200 Successful response

Setup Alert Configurations

Set user's alert configurations

Http Request

POST /alerts/configurations

Body parameter

Name In Type Required
body body AlertConfiguration true

AlertConfiguration

From the response from Alert Keys, we can understand the supported parameters for each alert type and key.

Name Type Required Description
alertType string true none
key string true none
exchange string false none
pair string false none
token string false none
[
    {
        "alertType": "blockchain",
        "key": "topTransaction",
        "token": "usdt"
    },
    {
        "alertType": "volume",
        "key": "volumePump",
        "exchange": "binance",
        "pair": "btc_usdt"
    }
]

Alert Configurations

Get user's alert configuration

Http Request

GET /alerts/configurations

Response

Code Description
200 Successful response

The request returns JSON structured like the following:

[
    {
        "alertType": "blockchain",
        "key": "topTransaction",
        "token": "usdt"
    },
    {
        "alertType": "volume",
        "key": "volumePump",
        "exchange": "binance",
        "pair": "btc_usdt"
    }
]

Latest alerts

Get user's latest alerts

Http Request

GET /alerts/latest

Response

Code Description
200 Successful response

The request returns JSON structured like the following:

[
    {
        "alertType": "blockchain",
        "key": "topTransaction",
        "time": 1554275290000,
        "token": "usdt",
        "alert": "[USDT] 5010000 USDT transferred from binance to Unknown Wallet at 2019-04-15T00:34:56.234Z !"
    },
    {
        "alertType": "volume",
        "key": "volumePump",
        "time": 1554275290000,
        "exchange": "binance",
        "pair": "btc_usdt",
        "alert": "[binance btc_usdt] Volume spikes from 23.34398 to 45.023411 at 2019-04-15T00:34:56.234Z !"
    }
]

Error Codes

Coinscious Data Services - Alert API uses the following error codes:

Error Code Meaning
3001 Alert type not specified.
3002 Alert type not supported.
3003 Alert Key not specified.
3004 Alert Key not supported.
3005 Exchange is not supported for alert type.
3006 Token or pair not specified.
3007 Alert subscription missing or expired
3008 Alert configuration number exceed limit.
3009 Number of token or pairs in Alert configuration exceed limit.