{
    "openapi": "3.0.0",
    "info": {
        "title": "企微机器人 - API文档",
        "version": "1.0.0",
        "description": "该接口可接入企业微信应用，使其拥有<a target=\"_blank\" href=\"https:\/\/www.tianapi.com\/apiview\/47\">天行智能机器人<\/a>回复能力，可开启或关闭机器人三十多项能力。使用本接口前，请在控制台-微信管理-企业微信设置中设置企业ID、应用Token等信息。如需查询和漫游机器人聊天记录可使用<a target=\"_blank\" href=\"https:\/\/www.tianapi.com\/apiview\/179\">机器人日志<\/a>接口。\n<p><b>因企业微信最新政策要求，新增或修改应用消息服务器配置，消息验证URL的所属域名备案主体必须与客户企业主体相同，因此第三方填写本接口地址将无法通过企微验证。详见企业微信公告：<a target=\"_blank\" href=\"https:\/\/open.work.weixin.qq.com\/wwopen\/common\/readDocument\/40754\">企业内部开发配置域名指引<\/a>，如有相关需求，可联系客服付费代开发。<\/b><\/p>"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/workweixin\/index": {
            "get": {
                "summary": "企微机器人",
                "tags": [
                    "企微机器人"
                ],
                "description": "接入企业微信可支持天行机器人交互功能",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "mode",
                        "in": "query",
                        "description": "工作模式，宽松模式0（回答率高）、精确模式1（相关性高）、私有模式2（只从私有词库中回答）",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 0,
                            "description": "工作模式，宽松模式0（回答率高）、精确模式1（相关性高）、私有模式2（只从私有词库中回答）"
                        }
                    },
                    {
                        "name": "priv",
                        "in": "query",
                        "description": "私有词库匹配模式，完整匹配0[默认]、智能匹配1，模糊匹配2，结尾匹配3，开头匹配4",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 0,
                            "description": "私有词库匹配模式，完整匹配0[默认]、智能匹配1，模糊匹配2，结尾匹配3，开头匹配4"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "xml": {
                                            "type": "string",
                                            "example": "该接口返回xml数据请参考微信调试工具里的结构",
                                            "description": "请参考上面的说明"
                                        }
                                    }
                                },
                                "example": {
                                    "tip": "接入即可使用，实际返回xml数据包"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "企微机器人",
                "tags": [
                    "企微机器人"
                ],
                "description": "接入企业微信可支持天行机器人交互功能",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "mode": {
                                        "type": "int",
                                        "example": 0,
                                        "description": "工作模式，宽松模式0（回答率高）、精确模式1（相关性高）、私有模式2（只从私有词库中回答）"
                                    },
                                    "priv": {
                                        "type": "int",
                                        "example": 0,
                                        "description": "私有词库匹配模式，完整匹配0[默认]、智能匹配1，模糊匹配2，结尾匹配3，开头匹配4"
                                    }
                                },
                                "required": [
                                    "key"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "xml": {
                                            "type": "string",
                                            "example": "该接口返回xml数据请参考微信调试工具里的结构",
                                            "description": "请参考上面的说明"
                                        }
                                    }
                                },
                                "example": {
                                    "tip": "接入即可使用，实际返回xml数据包"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}