0.约定
下述接口的任何结构中,url
表示这个接口的真实JSON地址,html_url
表示网页地址,抓取html_url
即可。
1.公告中心详情
https://support.bitrabbit.com/hc/api/v2/zh-cn/categories/360000063632
{
"category":{
"id":360000063632,
"url":"https://support.bitrabbit.com/api/v2/help_center/zh-cn/categories/360000063632-%E5%85%AC%E5%91%8A%E4%B8%AD%E5%BF%83.json",
"html_url":"https://support.bitrabbit.com/hc/zh-cn/categories/360000063632-%E5%85%AC%E5%91%8A%E4%B8%AD%E5%BF%83",
"position":0,
"created_at":"2018-02-06T05:59:48Z",
"updated_at":"2018-03-12T09:53:53Z",
"name":"公告中心",
"description":"",
"locale":"zh-cn",
"source_locale":"zh-cn",
"outdated":false
}
}
2.公告中心下属分类
https://support.bitrabbit.com/hc/api/v2/zh-cn/categories/360000063632/sections.json
{
"sections":[
{
"id":360000316212,
"url":"https://support.bitrabbit.com/api/v2/help_center/zh-cn/sections/360000316212-%E5%9B%A2%E9%98%9F%E6%8A%A5%E5%91%8A.json",
"html_url":"https://support.bitrabbit.com/hc/zh-cn/sections/360000316212-%E5%9B%A2%E9%98%9F%E6%8A%A5%E5%91%8A",
"category_id":360000063632,
"position":0,
"sorting":"creation_desc",
"created_at":"2018-03-01T09:13:34Z",
"updated_at":"2018-03-12T04:18:44Z",
"name":"团队报告",
"description":"",
"locale":"zh-cn",
"source_locale":"zh-cn",
"outdated":false,
"user_segment_id":null
},
{
"id":360000150252,
"url":"https://support.bitrabbit.com/api/v2/help_center/zh-cn/sections/360000150252-%E4%B8%8A%E5%B8%81%E9%80%9A%E7%9F%A5.json",
"html_url":"https://support.bitrabbit.com/hc/zh-cn/sections/360000150252-%E4%B8%8A%E5%B8%81%E9%80%9A%E7%9F%A5",
"category_id":360000063632,
"position":0,
"sorting":"creation_desc",
"created_at":"2018-02-06T06:00:57Z",
"updated_at":"2018-03-12T09:40:22Z",
"name":"上币通知",
"description":"",
"locale":"zh-cn",
"source_locale":"zh-cn",
"outdated":false,
"user_segment_id":null
},
{
"id":360000150272,
"url":"https://support.bitrabbit.com/api/v2/help_center/zh-cn/sections/360000150272-%E6%B4%BB%E5%8A%A8%E9%80%9A%E7%9F%A5.json",
"html_url":"https://support.bitrabbit.com/hc/zh-cn/sections/360000150272-%E6%B4%BB%E5%8A%A8%E9%80%9A%E7%9F%A5",
"category_id":360000063632,
"position":1,
"sorting":"creation_desc",
"created_at":"2018-02-06T06:01:21Z",
"updated_at":"2018-03-12T09:40:59Z",
"name":"活动通知",
"description":"",
"locale":"zh-cn",
"source_locale":"zh-cn",
"outdated":false,
"user_segment_id":null
},
{
"id":360000155371,
"url":"https://support.bitrabbit.com/api/v2/help_center/zh-cn/sections/360000155371-%E9%80%9A%E5%91%8A%E5%A3%B0%E6%98%8E.json",
"html_url":"https://support.bitrabbit.com/hc/zh-cn/sections/360000155371-%E9%80%9A%E5%91%8A%E5%A3%B0%E6%98%8E",
"category_id":360000063632,
"position":2,
"sorting":"creation_desc",
"created_at":"2018-02-06T06:03:38Z",
"updated_at":"2018-03-12T09:53:53Z",
"name":"通告声明",
"description":"",
"locale":"zh-cn",
"source_locale":"zh-cn",
"outdated":false,
"user_segment_id":null
}
],
"page":1,
"previous_page":null,
"next_page":null,
"per_page":30,
"page_count":1,
"count":4,
"sort_by":"position",
"sort_order":"asc"
}
3.公告中心下属分类详情
https://support.bitrabbit.com/hc/api/v2/zh-cn/sections/${section_id}
参数:section_id
,从2接口的sections
能找到,例如团队报告的id是360000316212
{
"section":{
"id":360000316212,
"url":"https://support.bitrabbit.com/api/v2/help_center/zh-cn/sections/360000316212-%E5%9B%A2%E9%98%9F%E6%8A%A5%E5%91%8A.json",
"html_url":"https://support.bitrabbit.com/hc/zh-cn/sections/360000316212-%E5%9B%A2%E9%98%9F%E6%8A%A5%E5%91%8A",
"category_id":360000063632,
"position":0,
"sorting":"creation_desc",
"created_at":"2018-03-01T09:13:34Z",
"updated_at":"2018-03-12T04:18:44Z",
"name":"团队报告",
"description":"",
"locale":"zh-cn",
"source_locale":"zh-cn",
"outdated":false,
"user_segment_id":null
}
}
4.公告中心下属分类具体文章列表
https://support.bitrabbit.com/hc/api/v2/zh-cn/sections/${section_id}/articles.json
参数:section_id
,从2接口的sections
能找到,例如团队报告的id是360000316212
{
"count":1,
"next_page":null,
"page":1,
"page_count":1,
"per_page":30,
"previous_page":null,
"articles":[
{
"id":360001640451,
"url":"https://bitrabbit.zendesk.com/api/v2/help_center/zh-cn/articles/360001640451-BitRabbit-%E4%BA%8C%E6%9C%88%E6%8A%A5%E5%91%8A-2018-2-.json",
"html_url":"https://support.bitrabbit.com/hc/zh-cn/articles/360001640451-BitRabbit-%E4%BA%8C%E6%9C%88%E6%8A%A5%E5%91%8A-2018-2-",
"author_id":360673475131,
"comments_disabled":false,
"draft":false,
"promoted":false,
"position":0,
"vote_sum":0,
"vote_count":0,
"section_id":360000316212,
"created_at":"2018-03-12T02:42:35Z",
"updated_at":"2018-03-12T04:18:44Z",
"name":"BitRabbit 二月报告(2018-2)",
"title":"BitRabbit 二月报告(2018-2)",
"body":"...",
"source_locale":"zh-cn",
"locale":"zh-cn",
"outdated":false,
"outdated_locales":[
],
"edited_at":"2018-03-12T04:18:44Z",
"label_names":[
]
}
],
"sort_by":"created_at",
"sort_order":"desc"
}
5.公告中心下属分类具体文章详情
https://support.bitrabbit.com/hc/api/v2/zh-cn/articles/${article_id}
参数:article_id
,从4接口中articles
可以获得,例如BitRabbit 二月报告(2018-2)的id是360001640451
其实这个接口的信息在4接口中均已展示。
网友评论