| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- {
- "name": "wechat-get-messages",
- "displayName": "获取微信消息列表",
- "description": "获取微信消息列表,支持按联系人过滤和增量拉取(since),是自动应答的数据入口。",
- "category": "wechat",
- "version": "1.0.0",
- "endpoint": {
- "method": "GET",
- "url": "{{wechatApiBase}}/messages",
- "headers": {}
- },
- "parameters": {
- "type": "object",
- "required": [],
- "properties": {
- "limit": {
- "type": "integer",
- "description": "返回条数上限,默认50,最大200",
- "default": 50
- },
- "wxid": {
- "type": "string",
- "description": "按联系人wxid过滤",
- "default": ""
- },
- "direction": {
- "type": "string",
- "description": "按方向过滤:sent或received",
- "enum": ["sent", "received", ""],
- "default": ""
- },
- "since": {
- "type": "string",
- "description": "ISO时间戳,只返回此时间之后的消息",
- "default": ""
- }
- }
- },
- "requestTransform": {
- "description": "参数拼接为query string",
- "queryParams": {
- "limit": "{{limit}}",
- "wxid": "{{wxid}}",
- "direction": "{{direction}}",
- "since": "{{since}}"
- }
- },
- "response": {
- "type": "object",
- "properties": {
- "ret": { "type": "integer", "description": "200表示成功" },
- "data": {
- "type": "array",
- "description": "消息列表(时间倒序)",
- "items": {
- "type": "object",
- "properties": {
- "id": { "type": "string" },
- "direction": { "type": "string" },
- "type": { "type": "string" },
- "fromWxid": { "type": "string" },
- "toWxid": { "type": "string" },
- "nickName": { "type": "string" },
- "content": { "type": "string" },
- "timestamp": { "type": "string" }
- }
- }
- },
- "total": { "type": "integer" }
- }
- },
- "usageExamples": [
- {
- "name": "增量拉取新消息",
- "input": { "since": "2026-04-11T10:00:00.000Z", "direction": "received" },
- "description": "获取指定时间之后收到的所有新消息"
- }
- ],
- "tokenConfig": {
- "type": "config",
- "configFile": "~/.openclaw/wechat-credentials.json",
- "tokenField": "wechatApiBase",
- "currentToken": "http://8.138.37.248/api/wechat-agent",
- "resolutionOrder": ["configFile", "currentToken"]
- },
- "timeout": 15000,
- "retry": { "maxAttempts": 2, "delay": 1000, "backoffMultiplier": 2 }
- }
|