WeChatFerry/docs/source/_static/openapi-wcfhttp.json
2023-09-26 09:02:19 +08:00

1 line
18 KiB
JSON
Raw 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.

{"openapi":"3.0.2","info":{"title":"WeChatFerry HTTP 客户端","description":"Github: <a href='https://github.com/lich0821/WeChatFerry'>WeChatFerry</a><table>\n<thead>\n<tr>\n<th style=\"text-align:center\"><img src=\"https://s2.loli.net/2023/09/25/fub5VAPSa8srwyM.jpg\" alt=\"碲矿\"></th>\n<th style=\"text-align:center\"><img src=\"https://s2.loli.net/2023/09/25/gkh9uWZVOxzNPAX.jpg\" alt=\"赞赏\"></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align:center\">后台回复 <code>WeChatFerry</code> 加群交流</td>\n<td style=\"text-align:center\">如果你觉得有用</td>\n</tr>\n</tbody>\n</table>","version":"0.1.0"},"paths":{"/msg_cb":{"post":{"tags":["示例"],"summary":"接收消息回调样例","description":"示例回调方法,简单打印消息","operationId":"msg_cb_msg_cb_post","requestBody":{"content":{"application/json":{"schema":{"title":"Msg","allOf":[{"$ref":"#/components/schemas/Msg"}],"description":"微信消息"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/login":{"get":{"summary":"获取登录状态","description":"获取登录状态","operationId":"is_login_login_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Is Login Login Get","type":"object"}}}}}}},"/wxid":{"get":{"summary":"获取登录账号 wxid","description":"获取登录账号 wxid","operationId":"get_self_wxid_wxid_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Self Wxid Wxid Get","type":"object"}}}}}}},"/user-info":{"get":{"summary":"获取登录账号个人信息","description":"获取登录账号个人信息","operationId":"get_user_info_user_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get User Info User Info Get","type":"object"}}}}}}},"/msg-types":{"get":{"summary":"获取消息类型","description":"获取消息类型","operationId":"get_msg_types_msg_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Msg Types Msg Types Get","type":"object"}}}}}}},"/contacts":{"get":{"summary":"获取完整通讯录","description":"获取完整通讯录","operationId":"get_contacts_contacts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Contacts Contacts Get","type":"object"}}}}}}},"/friends":{"get":{"summary":"获取好友列表","description":"获取好友列表","operationId":"get_friends_friends_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Friends Friends Get","type":"object"}}}}}}},"/dbs":{"get":{"summary":"获取所有数据库","description":"获取所有数据库","operationId":"get_dbs_dbs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Dbs Dbs Get","type":"object"}}}}}}},"/{db}/tables":{"get":{"summary":"获取 db 中所有表","description":"获取 db 中所有表\n\nArgs:\n db (str): 数据库名(可通过 `get_dbs` 查询)\n\nReturns:\n List[dict]: `db` 下的所有表名及对应建表语句","operationId":"get_tables__db__tables_get","parameters":[{"required":true,"schema":{"title":"Db","type":"string"},"name":"db","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Tables Db Tables Get","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pyq/":{"get":{"summary":"刷新朋友圈(数据从消息回调中查看)","description":"刷新朋友圈\n\nArgs:\n id (int): 开始 id0 为最新页\n\nReturns:\n int: 1 为成功,其他失败","operationId":"refresh_pyq_pyq__get","parameters":[{"description":"开始 id0 为最新页","required":false,"schema":{"title":"Id","type":"integer","description":"开始 id0 为最新页","default":0},"name":"id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Refresh Pyq Pyq Get","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chatroom-member/":{"get":{"summary":"获取圈成员","description":"获取群成员\n\nArgs:\n roomid (str): 群的 id\n\nReturns:\n List[dict]: 群成员列表","operationId":"get_chatroom_members_chatroom_member__get","parameters":[{"description":"群的 id","required":false,"schema":{"title":"Roomid","type":"string","description":"群的 id","default":"xxxxxxxx@chatroom"},"name":"roomid","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Chatroom Members Chatroom Member Get","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/alias-in-chatroom/":{"get":{"summary":"获取群成员名片","description":"获取群成员名片\n\nArgs:\n roomid (str): 群的 id\n wxid (str): wxid\n\nReturns:\n str: 名片","operationId":"get_alias_in_chatroom_alias_in_chatroom__get","parameters":[{"description":"wxid","required":false,"schema":{"title":"Wxid","type":"string","description":"wxid","default":"wxid_xxxxxxxxxxxxx"},"name":"wxid","in":"query"},{"description":"群的 id","required":false,"schema":{"title":"Roomid","type":"string","description":"群的 id","default":"xxxxxxxx@chatroom"},"name":"roomid","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Alias In Chatroom Alias In Chatroom Get","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/text":{"post":{"summary":"发送文本消息","description":"发送文本消息可参考https://github.com/lich0821/WeChatRobot/blob/master/robot.py 里 sendTextMsg\n\nArgs:\n msg (str): 要发送的消息,换行使用 `\\\\n`;如果 @ 人的话,需要带上跟 `aters` 里数量相同的 @\n receiver (str): 消息接收人wxid 或者 roomid\n aters (str): 要 @ 的 wxid多个用逗号分隔`@所有人` 只需要 `notify@all`\n\nReturns:\n int: 0 为成功,其他失败","operationId":"send_text_text_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_send_text_text_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Send Text Text Post","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/image":{"post":{"summary":"发送图片消息","description":"发送图片,非线程安全\n\nArgs:\n path (str): 图片路径,如:`C:/Projs/WeChatRobot/TEQuant.jpeg` 或 `https://raw.githubusercontent.com/lich0821/WeChatRobot/master/TEQuant.jpeg`\n receiver (str): 消息接收人wxid 或者 roomid\n\nReturns:\n int: 0 为成功,其他失败","operationId":"send_image_image_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_send_image_image_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Send Image Image Post","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/file":{"post":{"summary":"发送文件消息","description":"发送文件\n\nArgs:\n path (str): 本地文件路径,如:`C:/Projs/WeChatRobot/README.MD`\n receiver (str): 消息接收人wxid 或者 roomid\n\nReturns:\n int: 0 为成功,其他失败","operationId":"send_file_file_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_send_file_file_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Send File File Post","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sql":{"post":{"summary":"执行 SQL如果数据量大注意分页以免 OOM","description":"执行 SQL如果数据量大注意分页以免 OOM\n\nArgs:\n db (str): 要查询的数据库\n sql (str): 要执行的 SQL\n\nReturns:\n List[dict]: 查询结果","operationId":"query_sql_sql_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_query_sql_sql_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Query Sql Sql Post","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/new-friend":{"post":{"summary":"通过好友申请","description":"通过好友申请\n\nArgs:\n v3 (str): 加密用户名 (好友申请消息里 v3 开头的字符串)\n v4 (str): Ticket (好友申请消息里 v4 开头的字符串)\n scene: 申请方式 (好友申请消息里的 scene)\n\nReturns:\n int: 1 为成功,其他失败","operationId":"accept_new_friend_new_friend_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_accept_new_friend_new_friend_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Accept New Friend New Friend Post","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chatroom-member":{"post":{"summary":"添加群成员","description":"添加群成员\n\nArgs:\n roomid (str): 待加群的 id\n wxids (str): 要加到群里的 wxid多个用逗号分隔\n\nReturns:\n int: 1 为成功,其他失败","operationId":"add_chatroom_members_chatroom_member_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_add_chatroom_members_chatroom_member_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Add Chatroom Members Chatroom Member Post","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"删除群成员","description":"删除群成员\n\nArgs:\n roomid (str): 群的 id\n wxids (str): 要删除的 wxid多个用逗号分隔\n\nReturns:\n int: 1 为成功,其他失败","operationId":"del_chatroom_members_chatroom_member_delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_del_chatroom_members_chatroom_member_delete"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Del Chatroom Members Chatroom Member Delete","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/transfer":{"post":{"summary":"接收转账","description":"接收转账\n\nArgs:\n wxid (str): 转账消息里的发送人 wxid\n transferid (str): 转账消息里的 transferid\n transactionid (str): 转账消息里的 transactionid\n\nReturns:\n int: 1 为成功,其他失败","operationId":"receive_transfer_transfer_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_receive_transfer_transfer_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Receive Transfer Transfer Post","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dec-image":{"post":{"summary":"解密图片","description":"解密图片:\n\nArgs:\n src (str): 加密的图片路径\n dst (str): 解密的图片路径\n\nReturns:\n bool: 是否成功","operationId":"decrypt_image_dec_image_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_decrypt_image_dec_image_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Decrypt Image Dec Image Post","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_accept_new_friend_new_friend_post":{"title":"Body_accept_new_friend_new_friend_post","type":"object","properties":{"v3":{"title":"V3","type":"string","description":"加密用户名 (好友申请消息里 v3 开头的字符串)","default":"v3"},"v4":{"title":"V4","type":"string","description":"Ticket (好友申请消息里 v4 开头的字符串)","default":"v4"},"scene":{"title":"Scene","type":"integer","description":"申请方式 (好友申请消息里的 scene)","default":30}}},"Body_add_chatroom_members_chatroom_member_post":{"title":"Body_add_chatroom_members_chatroom_member_post","type":"object","properties":{"roomid":{"title":"Roomid","type":"string","description":"待加群的 id","default":"xxxxxxxx@chatroom"},"wxids":{"title":"Wxids","type":"string","description":"要加到群里的 wxid多个用逗号分隔","default":"wxid_xxxxxxxxxxxxx"}}},"Body_decrypt_image_dec_image_post":{"title":"Body_decrypt_image_dec_image_post","type":"object","properties":{"src":{"title":"Src","type":"string","description":"加密的图片路径,从图片消息中获取","default":"C:\\..."},"dst":{"title":"Dst","type":"string","description":"解密的图片路径","default":"C:\\..."}}},"Body_del_chatroom_members_chatroom_member_delete":{"title":"Body_del_chatroom_members_chatroom_member_delete","type":"object","properties":{"roomid":{"title":"Roomid","type":"string","description":"群的 id","default":"xxxxxxxx@chatroom"},"wxids":{"title":"Wxids","type":"string","description":"要删除的 wxid多个用逗号分隔","default":"wxid_xxxxxxxxxxxxx"}}},"Body_query_sql_sql_post":{"title":"Body_query_sql_sql_post","type":"object","properties":{"db":{"title":"Db","type":"string","description":"数据库","default":"MicroMsg.db"},"sql":{"title":"Sql","type":"string","description":"SQL 语句","default":"SELECT * FROM Contact LIMIT 1;"}}},"Body_receive_transfer_transfer_post":{"title":"Body_receive_transfer_transfer_post","type":"object","properties":{"wxid":{"title":"Wxid","type":"string","description":"转账消息里的发送人 wxid","default":"wxid_xxxxxxxxxxxxx"},"transferid":{"title":"Transferid","type":"string","description":"转账消息里的 transferid","default":"transferid"},"transactionid":{"title":"Transactionid","type":"string","description":"转账消息里的 transactionid","default":"transactionid"}}},"Body_send_file_file_post":{"title":"Body_send_file_file_post","type":"object","properties":{"path":{"title":"Path","type":"string","description":"本地文件路径,不支持网络路径","default":"C:\\Projs\\WeChatRobot\\TEQuant.jpeg"},"receiver":{"title":"Receiver","type":"string","description":"roomid 或者 wxid","default":"filehelper"}}},"Body_send_image_image_post":{"title":"Body_send_image_image_post","type":"object","properties":{"path":{"title":"Path","type":"string","description":"图片路径","default":"C:\\Projs\\WeChatRobot\\TEQuant.jpeg"},"receiver":{"title":"Receiver","type":"string","description":"消息接收者roomid 或者 wxid","default":"filehelper"}}},"Body_send_text_text_post":{"title":"Body_send_text_text_post","required":["msg"],"type":"object","properties":{"msg":{"title":"Msg","type":"string","description":"要发送的消息,换行用\\n表示"},"receiver":{"title":"Receiver","type":"string","description":"消息接收者roomid 或者 wxid","default":"filehelper"},"aters":{"title":"Aters","type":"string","description":"要 @ 的 wxid多个用逗号分隔@所有人 用 notify@all","default":""}}},"HTTPValidationError":{"title":"HTTPValidationError","type":"object","properties":{"detail":{"title":"Detail","type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}}},"Msg":{"title":"Msg","required":["id","ts","sign","type","xml","sender","roomid","content","thumb","extra","is_at","is_self","is_group"],"type":"object","properties":{"id":{"title":"Id","type":"integer"},"ts":{"title":"Ts","type":"integer"},"sign":{"title":"Sign","type":"string"},"type":{"title":"Type","type":"integer"},"xml":{"title":"Xml","type":"string"},"sender":{"title":"Sender","type":"string"},"roomid":{"title":"Roomid","type":"string"},"content":{"title":"Content","type":"string"},"thumb":{"title":"Thumb","type":"string"},"extra":{"title":"Extra","type":"string"},"is_at":{"title":"Is At","type":"boolean"},"is_self":{"title":"Is Self","type":"boolean"},"is_group":{"title":"Is Group","type":"boolean"}}},"ValidationError":{"title":"ValidationError","required":["loc","msg","type"],"type":"object","properties":{"loc":{"title":"Location","type":"array","items":{"anyOf":[{"type":"string"},{"type":"integer"}]}},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}}}}}}