分享机器人
用户和机器人都可以在自己的个人页面上配置分享 3 个机器人,这个分享也会出现在聊天界面左下角的+菜单中。
此功能有助于机器人通过口耳相传,促进机器人在用户中的传播。
获得分享列表
GET /users/:user_id/apps/favorite
返回指定用户分享的机器人的列表
API 端点 URL
https://api.mixin.one/users/:user_id/apps/favorite
请求示例
curl -i -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" https://api.mixin.one/users/06aed1e3-bd77-4a59-991a-5bb5ae6fbb09/apps/favorite
Response
{
"data": [
{
"type": "favorite_app",
"user_id": "06aed1e3-bd77-4a59-991a-5bb5ae6fbb09",
"app_id": "c94ac88f-4671-3976-b60a-09064f1811e8",
"created_at": "2017-12-23T18:23:26.996149Z"
}
...
]
}
添加到自己分享列表
POST /apps/:client_id/favorite
API 端点 URL
https://api.mixin.one/apps/:client_id/favorite
请求示例
curl -i -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" https://api.mixin.one/apps/06aed1e3-bd77-4a59-991a-5bb5ae6fbb09/favorite
Response
{
"data": [
{
"type": "favorite_app",
"user_id": "06aed1e3-bd77-4a59-991a-5bb5ae6fbb09",
"app_id": "c94ac88f-4671-3976-b60a-09064f1811e8",
"created_at": "2017-12-23T18:23:26.996149Z"
}
...
]
}
从分享列表中移除
POST /apps/:client_id/unfavorite
API 端点 URL
https://api.mixin.one/apps/:client_id/unfavorite
请求示例
curl -i -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" https://api.mixin.one/apps/06aed1e3-bd77-4a59-991a-5bb5ae6fbb09/unfavorite
成功时返回空的 json。