Query API Code Status

Query the API code info of a certain wallet.

Use the inactivated API code in any request will activate it. Once activated, the currently activated API code will immediately become invalid.


GET /v1/sofa/wallets/{WALLET_ID}/apisecret

Response Body

validobjectActivated API code
inactivatedobjectNot active API code
api_codestringAPI code for querying wallet
expint64API code expiration unix time in UTC

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



Response Body

  "valid": {
    "api_code": "H4Q6xFZgiTZb37GN",
    "exp": 1583144863
  "inactivated": {
    "api_code": "32PmGCjNzXda4mNHX"

Sample cURL Command

curl -X GET http://localhost:8889/v1/mock/wallets/{WALLET_ID}/apisecret