API Documents
Contents
    Loading
Support API Documents Get a Monitor’s History

Get a Monitor’s History

1. API Description

This API (Monitor.Gethistory) is used to get a monitor’s history.
Domain name for API request:https://api.dnspod.com/Monitor.Gethistory
HTTP request method: POST

2. Request Parameters

The table below lists only the API request parameters. Common request parameters are required when the API is called. For more information, please see Common Request Parameters.

Parameter Required Description
monitor_id yes Monitor id. Mandatory parameter.
hours no Within how many hours do you want to get the history.

3. Response Codes

Only the response codes related to this API are listed below. For other response codes, please see Common Return Codes.

Response Code Description
6 Invalid monitor id.

4. Sample

curl -X POST https://api.dnspod.com/Monitor.Setstatus -d 'user_token=730060,e1a8a$f14dc5dcbafd83680b3d2a553c4d553d&format=json&monitor_id=03e3b268-3643-11e2-bab7-0819a6248970&hours=1'

The following is a sample response:

  • 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"
        },
        {
            "data": {
                "message": "ok",
                "code": 200,
                "data": [
                    {
                        "status": "Down",
                        "status_code": -3,
                        "createtime": "2012-11-24 22:30:07",
                        "responsetime": 1
                    },
                    {
                        "status": "Down",
                        "status_code": -3,
                        "createtime": "2012-11-24 22:33:05",
                        "responsetime": 0
                    },
                    {
                        "status": "Down",
                        "status_code": -3,
                        "createtime": "2012-11-24 22:36:06",
                        "responsetime": 1
                    },
                    {
                        "status": "Down",
                        "status_code": -3,
                        "createtime": "2012-11-24 22:39:06",
                        "responsetime": 1
                    }
                ]
            },
            "point": "cmc"
        }
    ]
}
Last updated on 2020-12-23 09:13