直达内容

添加到圈子/从圈子中删除

Add/Remove a User

POST /users/:id/circles

设置用户所属的圈子。 您可以将用户添加到圈子或从圈子中删除用户。

信息

注意一个用户最多只能加入 5 个圈子,否则会 API 会返回 20133 错误。

API 端点 URL

 https://api.mixin.one/users/:id/circles

授权和其他选项

授权
CIRCLES:WRITE
限制No limitation

参数

id
*必须
The ID of user.

请求体

{
"circle_id": "the circle's id",
"action": "Update operation, 'ADD' or 'REMOVE'"
}

请求示例

curl -i -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" https://api.mixin.one/users/06aed1e3-bd77-4a59-991a-5bb5ae6fbb09/circles --data '{"circle_id": "a465ffdb-4441-4cb9-8b45 -00cf79dfbc46e", "action": "ADD" }'
Response
{
"data":[
{
"type": "circle",
"circle_id": "a465ffdb-4441-4cb9-8b45-00cf79dfbc46",
"name": "Circle Name",
"created_at": "2018-05-29T09:31:04.202186212Z"
}
...
]
}

Add/Remove a Group

POST /conversations/:id/circles

设置某个群组所属的圈子。 您可以在某个圈子中添加或删除群组。

API 端点 URL

 https://api.mixin.one/conversations/:id/circles

授权和其他选项

授权
CIRCLES:WRITE
限制No limitation

参数

id
*必须
The ID of conversation.

请求体

{
"circle_id": "the circle's id",
"action": "Update operation, 'ADD' or 'REMOVE'"
}

请求示例

curl -i -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" https://api.mixin.one/conversations/928c5c40-769c-3e97-8387-fb1ae0645311/circles --data '{"circle_id": "a465ffdb-4441-4cb9-8b45 -00cf79dfbc46e", "action": "ADD" }'
Response
{
"data":[
{
"type": "circle",
"circle_id": "a465ffdb-4441-4cb9-8b45-00cf79dfbc46",
"name": "Circle Name",
"created_at": "2018-05-29T09:31:04.202186212Z"
}
...
]
}