🧭API Doc - Test Route

Version: v1 Base Path: /v1/test


Overview

The Test API provides endpoints used to verify:

  • API authentication

  • Request signing

  • Replay protection

  • Error handling behavior

  • JSON body hashing and parsing

All endpoints require valid authentication using the HMAC-based signing mechanism.


Authentication

All requests must include the following headers:

Header
Description

X-API-Key

API key

X-Timestamp

Unix timestamp (seconds)

X-Nonce

Unique request identifier

X-Signature

HMAC signature

Requests missing any of these headers will be rejected.


GET /v1/test/ping

Description

Health-check endpoint used to verify:

  • API connectivity

  • Signature correctness

  • Authentication configuration

Request

Headers:

Successful Response

Response Fields

Field
Description

code

0 indicates success

payload.pong

Always returns "ok"

error

Always null

request_id

Unique request identifier

Possible Errors

Code
Meaning

20001

Missing authentication headers

20002

Invalid signature

30001

Forbidden (IP not allowed)

40001

Rate limit exceeded


GET /v1/test/fail

Description

This endpoint always returns a validation error. It is used to test client-side error handling and error parsing.

Request

Headers:

Error Response

Error Code

Code
Meaning

10001

Validation error


POST /v1/test/post

Description

Echo test endpoint. Used to verify:

  • Request signing

  • Body hashing

  • JSON parsing

  • Response format

Request

Headers:

Body (example):

Successful Response

Notes

  • The request body may include any valid JSON object.

  • The response returns the request body under payload.your_request_body.

Possible Errors

Code
Meaning

20001

Missing authentication headers

20002

Invalid signature

30001

Forbidden (IP not allowed)

40001

Rate limit exceeded

10001

Validation error (invalid JSON body)


Usage Recommendations

  • Use /v1/test/ping to verify authentication setup

  • Use /v1/test/post to verify body signing (hashing) and JSON parsing

  • Use /v1/test/fail to test error parsing

  • Always log request_id for debugging

  • Ensure timestamps are in UTC

  • Never reuse nonces


Notes

  • All test endpoints require valid authentication

  • Requests are subject to replay protection

  • Responses follow the standard API response format


End of document.

Last updated