接口规范说明
接口前提参数规则
开放api接口域名
接口响应状态码与错误码说明
基础信息描述
基础信息
获取访问开放api的token
地区基础信息
运营商基础信息
用户可以使用的监测点列表
获取任务正在使用的监测点信息
任务管理
基础信息
任务创建
任务修改
任务删除
任务详情
任务开启
任务暂停
任务列表
任务批量操作
维护窗口
任务分组管理
告警管理
创建任务的自定义告警规则
修改任务的自定义告警规则
删除任务的自定义告警规则
查看任务的自定义告警规则
创建任务告警通知
修改任务告警通知
获取任务告警通知
删除任务告警通知
历史快照数据
查看历史快照列表
查看单次历史快照详情
查看单次快照中的响应结果
查看历史快照列表【新版】
任务故障
任务所有监测点的故障记录
任务单个监测点故障记录
任务单个监测点故障次数
批量任务故障记录
告警消息
消息列表
单条消息详情
单条消息通知详情
采集器管理
获取采集器分组列表
获取采集器分组详情
响应时间与可用率
任务所有监测点的统计汇总数据
批量获取任务的统计数据
任务平均响应时间刻度数据
任务平均响应时间详细统计刻度数据
任务平均可用率刻度数据
traceroute任务跳数统计刻度数据
获取任务最近一次监测结果数据
任务响应时间&可用率趋势图
监测点平均响应时间topN列表
监测点平均可用率topN列表
任务指标统计
监测点分组管理
账号监测点分组列表
获取监测点分组信息
修改监测点分组信息
添加监测点分组信息
删除监测点分组信息
用户管理
获取用户基本信息
修改用户基本信息
创建用户
删除用户
当前账户信息
获取当前账户信息
账号公共设置
获取当前账户下用户列表
获取当前账户套餐信息
用户分组管理
用户分组列表
添加用户分组
修改用户分组
删除用户分组
获取单个分组下的用户
获取多个分组下的用户
将用户添加入分组
附录
附录二 userapi错误编码与含义

<接口地址>:/siteapi/data/snapshot


<请求方式>:GET


<请求类型>:URL参数


<响应类型>:JSON


<请求参数>:

参数名称

是否必须

类型

默认值

描述

task_id

int

任务编号

start_time

date

开始时间

end_time

date

结束时间

monitor_id

int

监测点ID

resp_result

int

响应结果,0-失败,1-成功

page_size

int

10

每页条数

page

int

1

当前页码


<请求示例>:

curl -H "token:a3af84f7c1d0d935024ba58b5da78aaa"  "https://v6-api.jiankongbao.com/siteapi/data/snapshot?task_id=64&start_time=2018-01-01&end_time=2018-01-02&monitor_id=1"


<响应数据>:

参数名称

数据类型

描述

pagination

json object

分页信息

total_records

int

记录总条数

total_pages

int

总页数

current_page

int

当前页码

page_size

int

每页条数

monitor_info

array

监测点信息

monitor_id

string

监测点ID

monitor_name

string

监测点名称

monitor_ip

string

监测点IP

monitor_location

string

监测点所属地区

data

array

数据列表

check_time

int

时间(unix时间戳)

resp_time

int

响应时间

resp_result

float

响应结果

resp_status

string

响应状态

monitor_id

string

监测点ID

server_ip

string

响应服务器ip

resp_summary

array

当前监控概要

http监控参数

dns_time

float

DNS域名解析时间(此响应参数仅适用于HTTP/HTTPS类型监控任务)

connect_time

float

建立连接时间(此响应参数仅适用于HTTP/HTTPS类型监控任务)

appconnect_time

float

Ssl握手时间(适用于https任务)

process_time

float

服务器计算时间(此响应参数仅适用于HTTP/HTTPS类型监控任务)

download_time

float

下载时间(此响应参数仅适用于HTTP/HTTPS类型监控任务)

total_time

string

总计时间

size_download

string

下载的字节数

speed_download

int

下载的速度

url

string

请求url,

content_type

string

资源类型,

http_code

int

响应状态码,

header_size

int

header的大小,

request_size

int

request的大小,

file_time

int

文件创建的时间,

ssl_verify_result

int

SSL验证结果,

redirect_count

int

跳转计数,

total_time

float

总耗时,

namelookup_time

float

NS查询耗时,

connect_time

float

等待连接耗时,

pretransfer_time

float

传输前准备耗时,

size_upload

int

上传数据的大小,

size_download

int

下载数据的大小,

speed_download

int

下载速度,

speed_upload

int

上传速度,

download_content_length

int

下载内容的长度,

upload_content_length

int

上传内容的长度,

starttransfer_time

float

开始传输的时间,

redirect_time

int

重定向耗时,

certinfo

array

认证信息

primary_ip

string

响应ip

redirect_url

string

重定向url

errno

int

请求出错号

errmsg

string

请求出错信息

ip

string

响应ip

http_code_desc

string

响应状态说明

req_headers

array

请求头信息

req_method

string

请求方式

resp_headers

object

响应头信息

__sid

string

监测点编号,

mip

string

监测点IP,

Ping监控 resp_summary监控概要

loss

int

丢包率

transmitted

int

发送的包数

bytes_total

int

总数据包大小

target_ip

String

主机IP

raw_data

array

Ping快照(根据不同的监控任务返回不同的快照内容)

ttl

int

TTL

bytes_per_request

int

数据包大小

received

int

收到的包数

Dns监控resp_summary监控概要

res

string

Dig结果

answerfrom

string

响应ip

__sid

string

监测点编号,

mip

string

监测点IP

Tcp监控resp_summary监控概要

total_time

float

总响应时间

ip

string

响应ip

connect_time

float

等待连接耗时

errno

int

出错号

namelookup_time

float

NS查询耗时

errmsg

string

出错信息

Udp监控resp_summary监控概要

namelookup_time

string

NS查询耗时

ip

string

响应ip

process_time

float

服务器计算时间

total_time

float

总响应时间

__sid

string

监测点编号,

mip

string

监测点IP

Traceroute监控resp_summary监控概要

loss

int

无响应跳数比

max_loss

int

最大无响应跳数比

no_resps

int

无响应跳数

ip

string

响应ip

steps

int

总跳数

raw_data

array

响应结果内容


<响应示例>:

{
    "pagination": {
     "total_records": 800,
     "total_pages": 40,
     "current_page": 18,
     "page_size": 20
     },
"monitor_info": {
"monitor_id": 1,
"monitor_name": "陕西西安电信",
"monitor_location": "陕西",
"monitor_ip": "123.23.23.23",
  },
"data": [
   {
          "check_time": "1463964437",
          "resp_result": "1", 
          "resp_status": "302 Moved Temporarily",
          "resp_time": "135.20",
          "dns_time": "0.63",
          "connect_time": "65.47",
          "process_time": "69.07",
          "download_time": "0.03",
          "total_time": "135.20",
          "size_download": "0.28",
          "speed_download": "2.11",
          "resp_summary": {
            "url":   "http://116.52.1.245/",
            "content_type": "text/html; charset=UTF-8",
            "http_code": 302,
            "header_size": 234,
            "request_size": 422,
            "filetime": -1,
            "ssl_verify_result": 0,
            "redirect_count": 0,
            "total_time": 135.197,
            "namelookup_time": 0.633,
            "connect_time": 66.1,
            "pretransfer_time": 66.102,
            "size_upload": 0,
            "size_download": 291,
            "speed_download": 2161,
            "speed_upload": 0,
            "download_content_length": -1,
            "upload_content_length": 0,
            "starttransfer_time": 135.171,
            "redirect_time": 0,
            "certinfo": [],
            "primary_ip": "116.52.1.245",
            "redirect_url":   "http://www.yngs.gov.cn/newW/template/index.jsp",
            "req_headers": [],
            "req_method": "GET",
            "req_httpv": "1.1",
            "ip":   "116.52.1.245",
            "resp_httpv": "1.1",
            "resp_headers": {
                      "Date": "Mon, 23 May 2016 00:40:23 GMT",
                      "Transfer-Encoding": "chunked",
                      "Location": "http://www.yngs.gov.cn//template/index.jsp",
                      "Content-Type": "text/html; charset=UTF-8",
                      "X-Powered-By": "*******************"
          },
            
      .............    //其他检测时间
            ]
}