获取帖子数据
请使用此 (https://mariago.site/mobile_api/thread_data) API访问帖子线程数据端点
数据结构说明
1. `post`变量包含线程的帖子数据(线程页面上的主帖子)
2. `next`变量包含对线程的回复(此数组中的每个帖子数据也可以包含`replys`变量,其中包含对其的前几条回复)
3. 名为`prev`的变量包含当前线程的父链(仅当存在父帖子时)
4. 如果`can_reply`变量的值为false,则表示当前用户无法回复此帖子
GET参数
字段 | 值 | 说明 |
---|---|---|
session_id | 访问令牌ID | 例如: de25cc16eb00960f076... |
thread_id | 帖子线程ID | 例如: 123456(任何帖子的ID,用于查看回复和所有详情) |
成功响应
{
"code": 200,
"data": {
"can_reply": true,
"post":{
"id": 41,
"user_id": 7,
"text": "werwe",
"type": "text",
"replys_count": "1",
"reposts_count": "0",
"likes_count": "0",
"status": "active",
"thread_id": 40,
"target": "pub_reply",
"og_data": "",
"time": "24 seconds ago",
"advertising": false,
"time_raw": "1605613164",
"og_text": "werwe",
"og_image": "statics/img/logo.png",
"url": "http://colibri.loc/thread/41",
"can_delete": true,
"media":[],
"is_owner": true,
"has_liked": false,
"has_saved": false,
"has_reposted": false,
"reply_to":{"id": 7, "url": "http://colibri.loc/@dan_kassing", "avatar": "http://colibri.loc/upload/default/avatar.png",…},
"owner":{"id": 7, "url": "http://colibri.loc/@dan_kassing", "avatar": "http://colibri.loc/upload/default/avatar.png",…},
"offset_id": 41
},
"next":[
{
"id": 42,
"user_id": 7,
"text": "werwe",
"type": "text",
"replys_count": "0",
"reposts_count": "0",
"likes_count": "0",
"status": "active",
"thread_id": 41,
"target": "pub_reply",
"og_data": "",
"time": "18 seconds ago",
"replys":[],
"advertising": false,
"time_raw": "1605613170",
"og_text": "werwe",
"og_image": "statics/img/logo.png",
"url": "http://colibri.loc/thread/42",
"can_delete": true,
"media":[],
"is_owner": true,
"has_liked": false,
"has_saved": false,
"has_reposted": false,
"reply_to":{"id": 7, "url": "http://colibri.loc/@dan_kassing", "avatar": "http://colibri.loc/upload/default/avatar.png",…},
"owner":{"id": 7, "url": "http://colibri.loc/@dan_kassing", "avatar": "http://colibri.loc/upload/default/avatar.png",…},
"offset_id": 42
}
],
"prev":[
{
"id": 40,
"user_id": 7,
"text": "erter",
"type": "text",
"replys_count": "1",
"reposts_count": "0",
"likes_count": "0",
"status": "active",
"thread_id": 0,
"target": "publication",
"og_data": "",
"time": "28 minutes ago",
"advertising": false,
"time_raw": "1605611503",
"og_text": "erter",
"og_image": "statics/img/logo.png",
"url": "http://colibri.loc/thread/40",
"can_delete": true,
"media":[],
"is_owner": true,
"has_liked": false,
"has_saved": false,
"has_reposted": false,
"reply_to":[],
"owner":{"id": 7, "url": "http://colibri.loc/@dan_kassing", "avatar": "http://colibri.loc/upload/default/avatar.png",…},
"offset_id": 40
}
]
}
}
错误响应
{
"code": 401,
"data": [],
"message": "未授权访问"
}
{
"code": 400,
"message": "帖子ID缺失或无效。请检查您的信息",
"data": []
}
加载帖子回复
请使用此 (https://mariago.site/mobile_api/thread_replys) API访问帖子线程回复端点
数据结构说明
请注意,`data`数组中的每个帖子项也可以包含`replys`变量,其中包含对其的前几条回复(见上文)
GET参数
字段 | 值 | 说明 |
---|---|---|
session_id | 访问令牌ID | 例如: de25cc16eb00960f076... |
thread_id | 帖子线程ID | 例如: 123456(任何帖子的ID,用于查看回复和所有详情) |
page_size | 每次请求的帖子总数限制(可选) | 推荐: 20 |
offset | 最后帖子偏移ID | 此变量必须是`next`数组中最后一个帖子(回复)对象的ID(见上文) |
成功响应
{
"message": "回复获取成功",
"code": 200,
"data":[
{
"id": 44,
"user_id": 7,
"text": "sdfrw",
"type": "text",
"replys_count": "0",
"reposts_count": "0",
"likes_count": "0",
"status": "active",
"thread_id": 41,
"target": "pub_reply",
"og_data": "",
"time": "50 minutes ago",
"replys":[],
"advertising": false,
"time_raw": "1605617624",
"og_text": "sdfrw",
"og_image": "statics/img/logo.png",
"url": "http://colibri.loc/thread/44",
"can_delete": true,
"media":[],
"is_owner": true,
"has_liked": false,
"has_saved": false,
"has_reposted": false,
"reply_to":{"id": 7, "url": "http://colibri.loc/@dan_kassing", "avatar": "http://colibri.loc/upload/default/avatar.png",…},
"owner":{"id": 7, "url": "http://colibri.loc/@dan_kassing", "avatar": "http://colibri.loc/upload/default/avatar.png",…},
"offset_id": 44
},
{
"id": 43,
"user_id": 7,
"text": "sdf",
"type": "text",
"replys_count": "0",
"reposts_count": "0",
"likes_count": "0",
"status": "active",
"thread_id": 41,
"target": "pub_reply",
"og_data": "",
"time": "50 minutes ago",
"replys":[],
"advertising": false,
"time_raw": "1605617612",
"og_text": "sdf",
"og_image": "statics/img/logo.png",
"url": "http://colibri.loc/thread/43",
"can_delete": true,
"media":[],
"is_owner": true,
"has_liked": false,
"has_saved": false,
"has_reposted": false,
"reply_to":{"id": 7, "url": "http://colibri.loc/@dan_kassing", "avatar": "http://colibri.loc/upload/default/avatar.png",…},
"owner":{"id": 7, "url": "http://colibri.loc/@dan_kassing", "avatar": "http://colibri.loc/upload/default/avatar.png",…},
"offset_id": 43
}
]
}
错误响应
{
"code": 401,
"data": [],
"message": "未授权访问"
}
{
"message": "未找到数据",
"code": 404,
"data": []
}
{
"code": 400,
"message": "帖子ID缺失或无效。请检查您的信息",
"data": []
}
{
"code": 400,
"message": "分页偏移ID缺失或无效。请检查您的信息",
"data": []
}