Skip to content

2.1.1 获取协议列表(可选)

各个环节的协议展示,共用此接口

  • 接口提供方: 流量承接方(KN)
  • 接口调用方: 流量提供方
  • method: query_agreement

请求参数

参数类型必选说明备注
typestringY协议类型枚举见 3.1.8

响应参数

参数类型必选说明备注
titlestringY协议标题-
contentstringY协议内容-

我们会给到titlecontent,需要接口调用方自己拼接成html格式

例如若html模板如下

html
<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>{{ .title }}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <style>
        html {
            font-family: Helvetica, Tahoma, Arial, sans-serif;
            font-size: 14px;
            font-weight: normal;
            max-width: 768px;
            margin: 0 auto;
        }

        body {
            font-size: 14px;
            padding: 0 14px;
            background: #ffffff;
        }

        td,
        th {
            padding: 5px 10px;
            border: 1px solid #DDD;
        }
    </style>
</head>

<body>
{{ .content }}
</body>

</html>

其中.title.content就是接口返回的titlecontent

则拼接后的html如下

html
<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>test</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <style>
        html {
            font-family: Helvetica, Tahoma, Arial, sans-serif;
            font-size: 14px;
            font-weight: normal;
            max-width: 768px;
            margin: 0 auto;
        }

        body {
            font-size: 14px;
            padding: 0 14px;
            background: #ffffff;
        }

        td,
        th {
            padding: 5px 10px;
            border: 1px solid #DDD;
        }
    </style>
</head>

<body>
    <p>test</p>
</body>

</html>

请求参数示例

json
{
    "type": "register"
}

响应参数示例

json
{
    "code": 0,
    "message": "success",
    "data": {
        "title": "test",
        "content": "<p>test<p>"
    }
}