Adds an individual to one or more individual groups. If a specified individual group does not exist, it is automatically created.
Usage notes
Rate limit: 10 calls per second per account. Exceeding this limit triggers throttling.
Group limit: You can create up to 100 individual groups.
Request syntax
POST /green/sface/person/groups/add HTTPS|HTTPRequest parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| clientInfo | JSONObject | No | {"userId":"120234234","userNick":"Mike","userType":"others"} | The client information serialized from the ClientInfo structure in JSON format, including the unique machine identifier (UMID) and International Mobile Equipment Identity (IMEI) of the client. For details, see Common request parameters. |
This operation uses common request headers. For details, see Common request headers.
Request body
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| personId | String | Yes | person1 | The ID of the individual. |
| groupIds | StringArray | Yes | ["group1","group2"] | The individual group IDs to add the individual to. Each ID can contain letters, digits, underscores (_), and hyphens (-), and can be up to 32 characters in length. If a specified group ID does not exist, the group is automatically created. |
Response elements
All responses are returned in JSON format. For common response parameters, see Common response parameters.
The data field contains the following parameters. This field may be empty when an error occurs.
| Parameter | Type | Example | Description |
|---|---|---|---|
| code | Integer | 200 | The HTTP status code. For details, see Common error codes. |
| personId | String | person1 | The ID of the individual. |
| groupIds | StringArray | ["group1","group2"] | The individual group IDs the individual belongs to. |
Examples
Sample request
POST /green/sface/person/groups/add HTTP/1.1
Common request headers
{
"personId": "person1",
"groupIds": [
"group1",
"group2"
]
}Sample response
{
"msg": "OK",
"code": 200,
"requestId": "36D384DA-8023-4E84-BCFD-0C5581352C16",
"data": {
"code": 200,
"personId": "person1",
"groupIds": [
"group1",
"group2"
]
}
}Error codes
For a list of error codes, see Service error codes.