1.1. Trao đổi API Key để lấy JWT Token

POST/gaia/v1/oauth2/openapi/token
Trao đổi API Key (tạo trên TCInvest) cùng mã Smart OTP (iOTP) từ ứng dụng TCInvest để lấy JWT token, gắn token này dưới dạng Bearer cho mọi request sau đó.

Header

TênKiểuBắt buộcMô tả
Content-Typestringapplication/json.

Request Body

TênKiểuBắt buộcMô tả
apiKeystringAPI Key được gen trên TCInvest.
otpstringMã Smart OTP (iOTP) từ ứng dụng TCInvest.
POST /gaia/v1/oauth2/openapi/token
curl -X POST https://openapi.tcbs.com.vn/gaia/v1/oauth2/openapi/token \
  -H "Content-Type: application/json" \
  -d '{"apiKey":"<API_KEY>","otp":"111111"}'

Response

TênKiểuBắt buộcMô tả
tokenstringJWT token dùng cho các request tiếp theo.
{
  "token": "eyJ4NXQiOiJaaWpkaFpqVmlNamMwWmdfUlMyNTYiLCJhbGciOiJSUzI1NiJ9..."
}