API for Querying Client Status

This feature is currently only available to NaaS partners, enabling efficient querying of the status of multiple clients in bulk.

Prerequisite

Please make sure you obtain x-ak & x-sk issued by Aethir.

Query Client Online Status

Description

This interface is used to query whether the client is online.

URL

https://app.aethir.com/console-api/v2/client/onLineState

Method

POST

Rate Limit

Each x-ak can make a request every 5 seconds.

Request Headers

HeaderTypeMandatory

x-ak

string

Yes

x-op-token

string

Yes

x-ak is a verification code issued to qualified partner Node Operators.

x-op-token is consists of three parts

x-op-token = header.payload.signature
  • Header

    A compact JSON string encoded with base64, representing the header.

    {
      "alg": "HS256",  // Encryption algorithm, fixed as HS256
      "typ": "CHK_OP"  // Token type, fixed as CHK_OP
    }
  • Payload

    A compact JSON string encoded with base64, representing the payload.

    {
      "ak": "",       // Issued to nodeOperator's AK
      "exp": 1,       // Token expiration timestamp in ms, configured by the user
      "ip": "",       // Client IP
      "nonce": 1      // Random number generated by the user
    }
  • Signature

    signature = base64UrlEncode(HmacSHA256.sign(base64UrlEncode(header) + "." + base64UrlEncode(payload), sk))

    where skis a verification code issued to qualified partner Node Operators.

Request Body

The request body is an array of clientId, supporting a maximum of 20 IDs.

[
  "clientId1",
  "clientId2",
  ...
]

Response

Possible responses and their corresponding meanings are:

  • HttpStatus 200: Query successful; the query result is parsed in the HttpResponseBody.

  • HttpStatus 400: The x-op-token format is incorrect or rate limit exceeded.

  • HttpStatus 401: The client needs to regenerate the x-op-token and retry the query.

Response Body

[
  {
    "clientId": "clientId1",
    "onLineState": 1
  }
]
FieldTypeDescription

clientId

string

Client ID

onLineState

int

1: Online, 0: Offline

Last updated