文档地址:https://www.chuckfang.com/MeoW/api_doc.html
接口地址:http://api.chuckfang.com/ 或 https://api.chuckfang.com/
http://api.chuckfang.com/{昵称}/{title}/{msg}?url={url}&msgType={msgType}&htmlHeight={htmlHeight}
或
http://api.chuckfang.com/{昵称}/{msg}?url={url}&msgType={msgType}&htmlHeight={htmlHeight}
| 参数 | 位置 | 是否必须 | 说明 |
|---|---|---|---|
| 昵称 | 路径 | 必填 | 用户昵称(不允许包含斜杠) |
| title | 路径 | 可选 | 消息标题,省略时默认使用"MeoW" |
| msg | 路径 | 必填 | 消息内容 |
| url | 查询参数 | 可选 | 跳转链接(需URL编码) |
| msgType | 查询参数 | 可选 | 消息显示类型:text(默认,纯文本显示),html(在App中渲染HTML格式) |
| htmlHeight | 查询参数 | 可选 | 仅在msgType=html时生效,App中显示HTML内容的高度(单位:像素),不填时默认200 |
GET /JohnDoe/系统通知/<b>有新消息</b>?msgType=html&htmlHeight=300&url=https://example.com
===
返回值:
{
"status": 200,
"message": "推送成功"
}
POST /{昵称}/[title] HTTP/1.1
Content-Type: application/x-www-form-urlencoded
title=可选标题&msg=必填内容&url=可选链接&msgType=html&htmlHeight=400
POST /{昵称}/[title] HTTP/1.1
Content-Type: text/plain
这里放置消息内容
POST /JohnDoe?msgType=html&htmlHeight=350 HTTP/1.1
Host: api.chuckfang.com
Content-Type: application/json
{
"title": "系统通知",
"msg": "<p><b>欢迎使用</b>,这是 <i>HTML</i> 格式的消息</p>",
"url": "https://example.com"
}
===
返回值:
{
"status": 200,
"message": "推送成功"
}
| 参数 | 类型 | 说明 |
|---|---|---|
| url | String | 同时支持查询参数和Body参数 |
| title | String | 按以下顺序获取:Body参数 > 路径参数 > 默认MeoW |
| msgType | String | 请求参数。消息显示类型:text(默认,纯文本显示),html(在App中渲染HTML格式) |
| htmlHeight | Number | 请求参数。仅在msgType=html时生效,App中显示HTML消息的高度(像素),不填时默认200 |
{
"status": 状态码,
"msg": "结果描述"
}
状态码说明:
200 - 操作成功
400 - 参数错误
500 - 服务器错误
msgType 与 htmlHeight 都是请求参数,不属于JSON参数msgType=html时,App将解析并渲染消息内容为HTML格式htmlHeight 仅在msgType=html时生效,不填时默认值为200