API 文档
文档目录
    加载中
文档中心 API 文档 获取监控历史

获取监控历史

1. 接口描述

本接口 Monitor.Gethistory 用于获取监控历史。
接口请求地址:https://dnsapi.cn/Monitor.Gethistory
HTTP请求方式:POST

2. 请求参数

以下请求参数列表仅列出了接口请求参数,正式调用时需要加上公共请求参数,见 公共请求参数 页面。

参数名 是否必须 类型 参数描述
monitor_id String 监控编号。
hours Integer 获取最近多少个小时的记录。

3. 响应代码

以下请求参数列表仅列出了此接口请求响应代码,除此接口请求响应代码外。还包含 共通返回

响应码 描述
7 监控编号错误。

4. 示例

curl -X POST https://dnsapi.cn/Monitor.Gethistory -d 'login_token=LOGIN_TOKEN&format=json&monitor_id=03e3b268-3643-11e2-bab7-0819a6248970&hours=1'

返回示例如下:

  • JSON:
{
    "status": {
        "code": "1",
        "message": "Action completed successful",
        "created_at": "2012-11-24 22:40:02"
    },
    "domain": {
        "id": "2317346",
        "domain": "testapi.com",
        "domain_grade": "D_Plus"
    },
    "record": {
        "id": "16909160",
        "sub_domain": "@",
        "ip": "119.180.24.194"
    },
    "monitor_history": [
        {
            "data": {
                "message": "ok",
                "code": 200,
                "data": [
                    {
                        "status": "Down",
                        "status_code": -3,
                        "createtime": "2012-11-24 22:28:31",
                        "responsetime": 0
                    },
                    {
                        "status": "Down",
                        "status_code": -3,
                        "createtime": "2012-11-24 22:31:31",
                        "responsetime": 0
                    },
                    {
                        "status": "Down",
                        "status_code": -3,
                        "createtime": "2012-11-24 22:34:31",
                        "responsetime": 999
                    },
                    {
                        "status": "Down",
                        "status_code": -3,
                        "createtime": "2012-11-24 22:37:31",
                        "responsetime": 1
                    }
                ]
            },
            "point": "ctc"
        },
        {
            "data": {
                "message": "ok",
                "code": 200,
                "data": [
                    {
                        "status": "Down",
                        "status_code": -3,
                        "createtime": "2012-11-24 22:28:52",
                        "responsetime": 0
                    },
                    {
                        "status": "Down",
                        "status_code": -3,
                        "createtime": "2012-11-24 22:31:52",
                        "responsetime": 0
                    },
                    {
                        "status": "Down",
                        "status_code": -3,
                        "createtime": "2012-11-24 22:34:52",
                        "responsetime": 0
                    },
                    {
                        "status": "Down",
                        "status_code": -3,
                        "createtime": "2012-11-24 22:37:52",
                        "responsetime": 0
                    }
                ]
            },
            "point": "cuc"
        }
    ]
}
最近更新于 2022-01-24 11:49

DNSPod 域名检测工具

查询域名信息,快速排查网站问题

网站自助排障

快速判断问题、提供合适的解决方案