概念
权限范围
权限范围(scope)决定密钥可以执行哪些操作。请在创建密钥时选择;只为每个密钥授予其所需的权限。
如果密钥缺少某个端点所需的权限范围,请求会返回 403 INSUFFICIENT_SCOPE。无法为现有密钥添加权限范围:请创建一个新密钥并吊销旧密钥。
不可用:支付、钱包、代币、转账和账号设置。没有任何权限范围可以访问这些功能。
所有权限范围#
| 权限范围 | 允许 |
|---|---|
profile:read | 读取您的个人资料以及其他用户的公开资料。 |
posts:read | 读取帖子(您自己的帖子以及您在应用中可见的帖子)及其评论。 |
posts:write | 上传媒体,发布、编辑和删除您的帖子。 |
comments:write | 发表评论,删除您的评论(或您帖子下的评论)。 |
likes:write | 点赞和取消点赞帖子。 |
follows:write | 关注和取消关注用户。 |
stories:write | 发布快拍。 |
store:read | 读取您的 Bloop 店铺及其商品。 |
store:write | 编辑店铺,创建、更新和删除商品,更新库存。 |
orders:read | 读取您店铺收到的订单。 |
orders:write | 将订单标记为已发货。 |
chat:read | 读取您的会话及其消息。 |
chat:write | 发送消息(受反垃圾消息规则约束)。 |
按权限范围列出的端点#
所有路径都相对于 https://api.linework.app/open/v1。
| 端点 | 权限范围 |
|---|---|
GET /me | profile:read |
GET /users/{id} | profile:read |
GET /users/by-username/{username} | profile:read |
GET /me/posts | posts:read |
GET /users/{id}/posts | posts:read |
GET /posts/{id} | posts:read |
GET /posts/{id}/comments | posts:read |
POST /media | posts:write、stories:write 或 store:write |
POST /posts | posts:write |
PATCH /posts/{id} | posts:write |
DELETE /posts/{id} | posts:write |
POST /posts/{id}/comments | comments:write |
DELETE /comments/{id} | comments:write |
POST DELETE /posts/{id}/like | likes:write |
POST DELETE /users/{id}/follow | follows:write |
POST /stories | stories:write |
GET /store | store:read |
POST PATCH /store | store:write |
GET /store/products | store:read |
POST /store/products | store:write |
PATCH DELETE /store/products/{id} | store:write |
PATCH /store/products/{id}/stock | store:write |
GET /store/orders | orders:read |
GET /store/orders/{id} | orders:read |
POST /store/orders/{id}/ship | orders:write |
GET /conversations | chat:read |
GET /conversations/{id}/messages | chat:read |
POST /conversations/{id}/messages | chat:write |
POST /messages | chat:write |
API 参考是权威来源:每个操作都列出了其所需的权限范围。
推荐组合#
| 集成 | 权限范围 |
|---|---|
| 发布机器人 | profile:read posts:read posts:write stories:write |
| 社区管理 | posts:read comments:write likes:write |
| 店铺同步 | store:read store:write orders:read orders:write |
| 客服聊天机器人 | chat:read chat:write(+ orders:read,用于查询订单) |