Creates an individual and assigns it to one or more individual groups. If a specified group does not exist, the group is created automatically.
An account can have up to 100 individual groups. A newly created group takes effect the next day. Before the group takes effect, add at least one face to the individual by calling the addFaces operation.
Rate limits
20 requests per second per account. Requests that exceed this limit are throttled.
Request syntax
POST /green/sface/person/add HTTPS|HTTPRequest headers
This operation uses only common request headers.
Request 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 IMEI (International Mobile Equipment Identity) of the client. For details, see ClientInfo. |
Request body
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| groupIds | StringArray | Yes | ["group1","group2"] | The IDs of the individual groups to assign the new individual to. Each ID can contain only letters, digits, underscores (_), and hyphens (-), and must be no more than 32 characters. If a specified group ID does not exist, the group is created automatically. |
| personId | String | Yes | person1 | The ID of the individual. The ID can contain only letters, digits, underscores (_), and hyphens (-), and must be no more than 32 characters. |
| name | String | No | Tom | The name of the individual. |
| note | String | No | Male | The description of the individual. |
Response elements
JSON-formatted data is returned for all requests. For common response parameters, see Common response parameters. Business-related data is returned in the data field.
The data field may be empty if an error occurs.The following table describes the fields returned in data.
| Parameter | Type | Example | Description |
|---|---|---|---|
| code | Integer | 200 | The HTTP status code. For more information, see Common error codes. |
| personId | String | person1 | The ID of the individual. |
| groupIds | StringArray | ["group1","group2"] | The IDs of the individual groups the individual belongs to. |
Examples
Sample request
POST /green/sface/person/add HTTP/1.1
Common request headers
{
"personId": "person1",
"groupIds": [
"group1",
"group2"
]
}Sample success response
{
"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.