Files
2022-04-29 15:44:04 +08:00

53 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: 获取长连接 OTP
id: socket-otp-api
slug: /socket-token-api
sidebar_position: 2
---
# 获取长连接 OTP(One Time Password)
获取长连接使用的 `Token`(One time password),长连接的 `Token` 可以用来连接行情和交易的长连接网关,是一次性的,使用过后就会作废。
> 最后更新于 2022-04-28
## 请求
| 基本信息 | |
| ----------- | -------------- |
| HTTP URL | /v1/socket/token |
| HTTP Method | GET |
### 请求头
| 名称 | 类型 | 必须 | 描述 |
| ------------- | ------ | ---- | --------------------------------------------- |
| Authorization | string | 是 | |
| Content-Type | string | 是 | **固定值**"application/json; charset=utf-8" |
### 请求参数
## 响应
### 响应体
| 名称 | 类型 | 描述 |
| ---- | ------ | --------------------- |
| code | int | 错误码,非 0 表示失败 |
| msg | string | 错误描述 |
| data | object | |
| ∟otp | string | 获取到的 token |
### 响应体示例
```json
{
"code": 0,
"message": "",
"data": {
"otp": "xxxxxxxx"
}
}
}
```