Query Callback History

Used to query some kind of callbacks within a time interval.

Request

GET /v1/sofa/wallets/{WALLET_ID}/notifications?from_time={FROM}&to_time={TO}&type={TYPE}

Query Parameters

FieldTypeNoteDescription
from_timeint64optional, default 0Start date (unix time in UTC)
to_timeint64optional, default current timeEnd date (unix time in UTC)
typeintoptional, default -1Refer to type field of Callback Definition

Response Body

FieldTypeDescription
notificationsarrayArrary of callbacks, refer to Callback Definition

Error Code

HTTP CodeError CodeErrorMessageDescription
403-Forbidden. Invalid wallet ID-No wallet ID found
403-Forbidden. Header not found-Missing X-API-CODE, X-CHECKSUM header or query param t
403-Forbidden. Invalid timestamp-The timestamp t is not in the valid time range
403-Forbidden. Invalid checksum-The request is considered a replay request
403-Forbidden. Invalid API code-X-API-CODE header contains invalid API code
403-Invalid API code for wallet {WALLET_ID}-The API code mismatched
403-Forbidden. Checksum unmatch-X-CHECKSUM header contains wrong checksum
403-Forbidden. Call too frequently ({THROTTLING_COUNT} calls/minute)-Send requests too frequently

Sample Request

API

/v1/sofa/wallets/56788/notifications?from_time=1561651200&to_time=1562255999&type=1

Response Body

{
  "notifications": [
    {
      "type": 2,
      "serial": 90000000003,
      "order_id": "a206",
      "currency": "BNB",
      "txid": "76B8B2B1E25472FFE7B8FCE85742E0964FEDB1B679DE963FA19F430E8B287F93",
      "block_height": 25844472,
      "tindex": 2,
      "vout_index": 0,
      "amount": "15000000",
      "fees": "37500",
      "memo": "CC",
      "broadcast_at": 0,
      "chain_at": 1562234190,
      "from_address": "tbnb1f805kv6z8nq2whrcnkagjte3jjss2sxf2rfls0",
      "to_address": "tbnb1655kasahedvaeudaeq6jggr7kal8qgwygu9xqk",
      "wallet_id": 67,
      "state": 3,
      "confirm_blocks": 1,
      "processing_state": 1,
      "addon": {}
    }
  ]
}

Sample cURL Command

curl -X GET 'http://localhost:8889/v1/mock/wallets/{WALLET_ID}/notifications?from_time=1561651200&to_time=1562255999&type=1'