itecdn 5.x / 用户 API
获取消息完整详情
GET
/v1/messages/{message_id}按 ID 返回 message 表的完整消息记录(包含正文及发送状态字段)。接口要求登录。若消息指定了 receive 且其值不是当前用户 ID,则仅管理员可查看;服务端不额外检查 is_show,因此已登录用户可读取未指定接收者的隐藏消息详情。
身份认证
access-token
api-key + api-secret
认证定义
{
"AccessToken": {
"type": "apiKey",
"in": "header",
"name": "access-token",
"description": "通过登录接口获得的短期访问令牌。"
},
"ApiKey": {
"type": "apiKey",
"in": "header",
"name": "api-key",
"description": "API Key;必须和 api-secret 同时发送。"
},
"ApiSecret": {
"type": "apiKey",
"in": "header",
"name": "api-secret",
"description": "API Secret;必须和 api-key 同时发送。"
}
}请求参数
| 参数 | 位置 | 类型 | 必填 | 说明与约束 |
|---|---|---|---|---|
message_id | path | integer | 必填 | 消息 ID。路由只匹配整数;不存在时返回业务错误。 完整参数定义 |
响应
HTTP 200
成功、消息不存在、接收者权限不足及认证错误均返回 HTTP 200。成功响应的 msg 固定为空字符串。
application/json
oneOf
oneOf · 1 · object
| 字段 | 类型 | 必填 | 说明与约束 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
code | integer | 必填 | 0 表示查询成功。 约束 / 默认值 / 示例 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
msg | string | 必填 | 详情查询成功时固定为空字符串。 约束 / 默认值 / 示例 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
data | object | 必填 | 消息表完整记录。布尔数据库字段按 0/1 数值返回。 约束 / 默认值 / 示例展开字段结构消息表完整记录。布尔数据库字段按 0/1 数值返回。
|
oneOf · 2 · object
| 字段 | 类型 | 必填 | 说明与约束 |
|---|---|---|---|
code | string | 必填 | 分别表示消息不存在、指定接收者消息需要管理员权限或认证失败。 约束 / 默认值 / 示例 |
msg | string | 必填 | 具体错误原因。 |
data | string | 必填 | 业务错误时为空字符串。 约束 / 默认值 / 示例 |
完整 Schema
{
"oneOf": [
{
"type": "object",
"required": [
"code",
"msg",
"data"
],
"properties": {
"code": {
"type": "integer",
"enum": [
0
],
"description": "0 表示查询成功。"
},
"msg": {
"type": "string",
"enum": [
""
],
"description": "详情查询成功时固定为空字符串。"
},
"data": {
"type": "object",
"description": "消息表完整记录。布尔数据库字段按 0/1 数值返回。",
"required": [
"id",
"type",
"pub_user",
"receive",
"title",
"content",
"phone_content",
"templ_id",
"templ_para",
"event_id",
"user_package_id",
"site_id",
"is_show",
"is_red",
"is_bold",
"is_external",
"is_popup",
"email_need_send",
"phone_need_send",
"email_is_sent",
"phone_is_sent",
"url",
"sort",
"create_at",
"update_at"
],
"properties": {
"id": {
"type": "integer",
"description": "消息 ID。"
},
"type": {
"type": "string",
"nullable": true,
"description": "消息类型,例如 announcement。"
},
"pub_user": {
"type": "integer",
"nullable": true,
"description": "发布者用户 ID。"
},
"receive": {
"type": "integer",
"nullable": true,
"description": "指定接收用户 ID;为空表示未指定单个接收者。"
},
"title": {
"type": "string",
"nullable": true,
"description": "消息标题。"
},
"content": {
"type": "string",
"nullable": true,
"description": "站内消息正文;外部链接消息通常为空字符串。"
},
"phone_content": {
"type": "string",
"nullable": true,
"description": "短信发送正文。"
},
"templ_id": {
"type": "string",
"nullable": true,
"description": "消息发送模板 ID。"
},
"templ_para": {
"type": "string",
"nullable": true,
"description": "模板参数文本。"
},
"event_id": {
"type": "string",
"nullable": true,
"description": "关联事件标识。"
},
"user_package_id": {
"type": "integer",
"nullable": true,
"description": "关联用户套餐 ID。"
},
"site_id": {
"type": "integer",
"nullable": true,
"description": "关联网站 ID。"
},
"is_show": {
"type": "integer",
"enum": [
0,
1
],
"nullable": true,
"description": "展示标记:1 展示,0 隐藏。"
},
"is_red": {
"type": "integer",
"enum": [
0,
1
],
"nullable": true,
"description": "红色标题标记。"
},
"is_bold": {
"type": "integer",
"enum": [
0,
1
],
"nullable": true,
"description": "粗体标题标记。"
},
"is_external": {
"type": "integer",
"enum": [
0,
1
],
"nullable": true,
"description": "外部链接标记:1 使用 url,0 使用 content。"
},
"is_popup": {
"type": "integer",
"enum": [
0,
1
],
"nullable": true,
"description": "弹窗显示标记。"
},
"email_need_send": {
"type": "integer",
"enum": [
0,
1
],
"nullable": true,
"description": "是否需要发送邮件通知。"
},
"phone_need_send": {
"type": "integer",
"enum": [
0,
1
],
"nullable": true,
"description": "是否需要发送短信通知。"
},
"email_is_sent": {
"type": "integer",
"enum": [
0,
1
],
"nullable": true,
"description": "邮件是否已发送。"
},
"phone_is_sent": {
"type": "integer",
"enum": [
0,
1
],
"nullable": true,
"description": "短信是否已发送。"
},
"url": {
"type": "string",
"nullable": true,
"description": "外部消息跳转地址。"
},
"sort": {
"type": "integer",
"nullable": true,
"description": "排序值。"
},
"create_at": {
"type": "string",
"format": "date-time",
"nullable": true,
"description": "消息创建时间。"
},
"update_at": {
"type": "string",
"format": "date-time",
"nullable": true,
"description": "消息更新时间。"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"code",
"msg",
"data"
],
"properties": {
"code": {
"type": "string",
"enum": [
"message-18",
"message-32",
"login_required"
],
"description": "分别表示消息不存在、指定接收者消息需要管理员权限或认证失败。"
},
"msg": {
"type": "string",
"description": "具体错误原因。"
},
"data": {
"type": "string",
"enum": [
""
],
"description": "业务错误时为空字符串。"
}
},
"additionalProperties": false
}
]
}示例
{
"code": 0,
"msg": "",
"data": {
"id": 101,
"type": "announcement",
"pub_user": 1,
"receive": null,
"title": "服务通知",
"content": "系统将在今晚进行维护。",
"phone_content": null,
"templ_id": null,
"templ_para": null,
"event_id": null,
"user_package_id": null,
"site_id": null,
"is_show": 1,
"is_red": 0,
"is_bold": 1,
"is_external": 0,
"is_popup": 0,
"email_need_send": 0,
"phone_need_send": 0,
"email_is_sent": 0,
"phone_is_sent": 0,
"url": "",
"sort": 100,
"create_at": "2026-01-01T12:00:00",
"update_at": "2026-01-01T12:00:00"
}
}查询成功
{
"code": 0,
"msg": "",
"data": {
"id": 101,
"type": "announcement",
"pub_user": 1,
"receive": null,
"title": "服务通知",
"content": "系统将在今晚进行维护。",
"phone_content": null,
"templ_id": null,
"templ_para": null,
"event_id": null,
"user_package_id": null,
"site_id": null,
"is_show": 1,
"is_red": 0,
"is_bold": 1,
"is_external": 0,
"is_popup": 0,
"email_need_send": 0,
"phone_need_send": 0,
"email_is_sent": 0,
"phone_is_sent": 0,
"url": "",
"sort": 100,
"create_at": "2026-01-01T12:00:00",
"update_at": "2026-01-01T12:00:00"
}
}消息不存在
{
"code": "message-18",
"msg": "消息不存在",
"data": ""
}cURL 示例
根据文档生成;请替换主控地址、路径参数和凭证,并按上表补充查询参数。
curl --request GET \
"https://master.example.invalid/v1/messages/{message_id}" \
--header "access-token: YOUR_ACCESS_TOKEN"