{
    "openapi": "3.0.0",
    "info": {
        "title": "机器人日志 - API文档",
        "version": "1.0.0",
        "description": "该接口用于拉取你的天行机器人对话日志，默认为全部用户的对话日志信息，可通过uniqueid用户唯一身份ID参数指定某一用户的对话日志。该接口可用于消息漫游、历史对话记录等功能，对话日志数据默认保留七天。部分参数和字段请参考<a target=\"_blank\" href=\"https:\/\/www.tianapi.com\/apiview\/47\">天行机器人<\/a>接口。"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/robotlog\/index": {
            "get": {
                "summary": "机器人日志查询",
                "tags": [
                    "机器人日志"
                ],
                "description": "根据唯一ID查询机器人交互日志",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "num",
                        "in": "query",
                        "description": "返回数量，默认10、最大50",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 10,
                            "description": "返回数量，默认10、最大50"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "翻页，默认1",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 1,
                            "description": "翻页，默认1"
                        }
                    },
                    {
                        "name": "uniqueid",
                        "in": "query",
                        "description": "用户唯一身份ID",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "abcdefg12345678",
                            "description": "用户唯一身份ID"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "time": {
                                            "type": "string",
                                            "example": "1585285656",
                                            "description": "该条日志记录时间戳"
                                        },
                                        "content": {
                                            "type": "string",
                                            "example": "早上好",
                                            "description": "机器人回答的内容（新闻view类型，则为数组）"
                                        },
                                        "datatype": {
                                            "type": "string",
                                            "example": "text",
                                            "description": "回答数据类型，具体请参考天行机器人接口"
                                        },
                                        "uniqueid": {
                                            "type": "string",
                                            "example": "a36586d752193ea6",
                                            "description": "唯一身份ID"
                                        },
                                        "inputword": {
                                            "type": "string",
                                            "example": "你好",
                                            "description": "用户输入的内容"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "time": 1585295310,
                                                "content": "请问主公有什么问题吗？",
                                                "datatype": "text",
                                                "uniqueid": "a36586d752193ea6",
                                                "inputword": "?"
                                            },
                                            {
                                                "time": 1585285671,
                                                "content": "今天天气还不错，回复“上海天气”试试~",
                                                "datatype": "text",
                                                "uniqueid": "0",
                                                "inputword": "今天天气怎么样"
                                            },
                                            {
                                                "time": 1585285657,
                                                "content": "为什么一直问同样的问题",
                                                "datatype": "text",
                                                "uniqueid": "a36586d752193ea6",
                                                "inputword": "?"
                                            },
                                            {
                                                "time": 1585285656,
                                                "content": "早上好",
                                                "datatype": "text",
                                                "uniqueid": "0",
                                                "inputword": "你好"
                                            },
                                            {
                                                "time": 1585280519,
                                                "content": "人的一生也许需要的很少--一杯水，一碗饭，一句我爱你。但我希望：水是你倒的，饭是你做的，我爱你是你亲口对我说的。",
                                                "datatype": "text",
                                                "uniqueid": "a36586d752193ea6",
                                                "inputword": "我爱你"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "机器人日志查询",
                "tags": [
                    "机器人日志"
                ],
                "description": "根据唯一ID查询机器人交互日志",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "num": {
                                        "type": "int",
                                        "example": 10,
                                        "description": "返回数量，默认10、最大50"
                                    },
                                    "page": {
                                        "type": "int",
                                        "example": 1,
                                        "description": "翻页，默认1"
                                    },
                                    "uniqueid": {
                                        "type": "string",
                                        "example": "abcdefg12345678",
                                        "description": "用户唯一身份ID"
                                    }
                                },
                                "required": [
                                    "key"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "time": {
                                            "type": "string",
                                            "example": "1585285656",
                                            "description": "该条日志记录时间戳"
                                        },
                                        "content": {
                                            "type": "string",
                                            "example": "早上好",
                                            "description": "机器人回答的内容（新闻view类型，则为数组）"
                                        },
                                        "datatype": {
                                            "type": "string",
                                            "example": "text",
                                            "description": "回答数据类型，具体请参考天行机器人接口"
                                        },
                                        "uniqueid": {
                                            "type": "string",
                                            "example": "a36586d752193ea6",
                                            "description": "唯一身份ID"
                                        },
                                        "inputword": {
                                            "type": "string",
                                            "example": "你好",
                                            "description": "用户输入的内容"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "time": 1585295310,
                                                "content": "请问主公有什么问题吗？",
                                                "datatype": "text",
                                                "uniqueid": "a36586d752193ea6",
                                                "inputword": "?"
                                            },
                                            {
                                                "time": 1585285671,
                                                "content": "今天天气还不错，回复“上海天气”试试~",
                                                "datatype": "text",
                                                "uniqueid": "0",
                                                "inputword": "今天天气怎么样"
                                            },
                                            {
                                                "time": 1585285657,
                                                "content": "为什么一直问同样的问题",
                                                "datatype": "text",
                                                "uniqueid": "a36586d752193ea6",
                                                "inputword": "?"
                                            },
                                            {
                                                "time": 1585285656,
                                                "content": "早上好",
                                                "datatype": "text",
                                                "uniqueid": "0",
                                                "inputword": "你好"
                                            },
                                            {
                                                "time": 1585280519,
                                                "content": "人的一生也许需要的很少--一杯水，一碗饭，一句我爱你。但我希望：水是你倒的，饭是你做的，我爱你是你亲口对我说的。",
                                                "datatype": "text",
                                                "uniqueid": "a36586d752193ea6",
                                                "inputword": "我爱你"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}