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 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 không cung cấp OTP thì token cấp ra sẽ chỉ có quyền truy xuất và nghe dữ liệu Market Data.

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",
  "refreshToken": "string",
  "expiresAt": "string",
  "refreshExpiresAt": "string"
}

Request không hợp lệ.

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