# Websocket 通用标准头

[English ](https://en.apis.alltick.co/integration-process/universal-standard-header-description/websocket-common-standard-header)/ 中文

## 请求通用标准头介绍

| 字段      | 名称  | 类型     | 必填项         | 说明                        |
| ------- | --- | ------ | ----------- | ------------------------- |
| cmd\_id | 协议号 | uint32 | 详见各个接口定义有提供 |                           |
| seq\_id | 序列号 | uint32 | 是           | 请求者生成唯一，响应与请求将保持一致        |
| trace   | 跟踪号 | string | 是           | 请求者生成唯一，响应与请求将保持一致,最大长度64 |
| data    | 数据体 | object | 是           | 具体数据格式见各个接口定义             |

```
{
    "cmd_id":22000,
    "seq_id":123,
    "trace":"asdfsdfa",
    "data":{
    }
}
```

## 应答通用标准头介绍

| 字段      | 名称  | 类型     | 说明                                                                                                                                |
| ------- | --- | ------ | --------------------------------------------------------------------------------------------------------------------------------- |
| ret     | 返回值 | int32  | [错误码说明](https://github.com/alltick/realtime-forex-crypto-stock-tick-finance-websocket-api/blob/main/error_code_description_cn.md) |
| msg     | 消息  | string | 对成功或者失败具体的描述                                                                                                                      |
| cmd\_id | 协议号 | uint32 | 详见各个接口定义有提供                                                                                                                       |
| seq\_id | 序列号 | uint32 | 请求者生成唯一，响应与请求将保持一致                                                                                                                |
| trace   | 跟踪号 | string | 请求者生成唯一，响应与请求将保持一致,最大长度64                                                                                                         |
| data    | 数据体 | object | 具体数据格式见各个接口定义                                                                                                                     |

```
{
    "ret":201,
    "msg":"request header param invalid",
    "cmd_id":0,
    "seq_id":0,
    "trace":"",
    "data":{
    }    
}
```

***

#### AllTick网站

{% hint style="info" %}
官方网站：<https://alltick.co/>
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apis.alltick.co/integration-process/universal-standard-header-description/websocket-common-standard-header.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
