Authentication

auth-token

Xác thực apiKey/apiSecret để lấy access token và refresh token (kèm thông tin hết hạn).

POST
/api/v3/auth/token

Request Body

TypeScript Definitions

Use the request body type in TypeScript.

bodyobjectrequired
apiKeystringrequired

API key do SSI/FastConnect cấp cho ứng dụng.

apiSecretstringrequired

API secret tương ứng với `apiKey`.

otpstring | nulloptional

Mã OTP (SMS OTP hoặc SmartOTP) cần phải có nếu bạn muốn token cấp ra có quyền thực hiện giao dịch. Trường hợp chỉ sử dụng để truy vấn dữ liệu (data, query trading) thì không cần truyền OTP.

transactionIdstring | nulloptional

Mã transaction trả về từ API `auth/requestOtp` khi tài khoản dùng 2FA loại SmartOTP và đã kích hoạt luồng phê duyệt qua ứng dụng iBoard.

Response Headers

X-RATELIMIT-LIMITstringoptional

Giới hạn số request trong chu kỳ.

X-RATELIMIT-REMAININGstringoptional

Số request còn lại trong chu kỳ hiện tại.

X-RATELIMIT-RESETstringoptional

Thời điểm reset giới hạn request.

Response Body

application/json

application/json

curl -X POST "https://api.ssi.com.vn/api/v3/auth/token" \  -H "Content-Type: application/json" \  -d '{    "apiKey": "string",    "apiSecret": "string"  }'

Thành công.

{
  "tokenType": "Bearer",
  "accessToken": "string",
  "expiresAt": 1772075293023,
  "refreshToken": "string",
  "refreshExpiresAt": 1772075293023
}

Request không hợp lệ.

{
  "code": 400,
  "msg": "apiKey is required"
}