Add to/Remove from Circles
Add/Remove a User
POST /users/:id/circles
Set the circle to which a user belongs. You can add the user to or remove the user from a circle.
info
Note that one user can only be added to 5 circles at most, otherwise error 20133 will be reported.
Endpoint URL
https://api.mixin.one/users/:id/circles
Payload
{
"circle_id": "the circle's id",
"action": "Update operation, 'ADD' or 'REMOVE'"
}
Example request
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
Set the circle to which a certain group belongs. You can add or remove the group from a certain circle.
Endpoint URL
https://api.mixin.one/conversations/:id/circles
Payload
{
"circle_id": "the circle's id",
"action": "Update operation, 'ADD' or 'REMOVE'"
}
Example request
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"
}
...
]
}