你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Person Group Operations - Create Person Group Person

Create指定人员组中的新人员。 若要向此人添加人脸,请调用“添加人员组人员人脸”。

注意

    • 免费层订阅配额:
      • 1,000 人在所有人员组。
    • S0 层订阅配额:
      • 每人组 10,000 人。
      • 1,000,000 人组。
      • 100,000,000人人组。
POST {endpoint}/face/{apiVersion}/persongroups/{personGroupId}/persons

URI 参数

名称 必需 类型 说明
apiVersion
path True

string

API 版本

endpoint
path True

string

uri

支持的认知服务终结点 (协议和主机名,例如:https://{resource-name}.cognitiveservices.azure.com) 。

personGroupId
path True

string

容器的 ID。

Regex pattern: ^[a-z0-9-_]+$

请求正文

名称 必需 类型 说明
name True

string

用户定义的名称,最大长度为 128。

userData

string

用户定义的可选数据。 长度不应超过 16K。

响应

名称 类型 说明
200 OK

CreatePersonResult

成功的调用将返回创建的新 personId。

Other Status Codes

FaceErrorResponse

意外的错误响应。

Headers

x-ms-error-code: string

安全性

Ocp-Apim-Subscription-Key

Azure AI 人脸订阅的密钥。

Type: apiKey
In: header

AADToken

Azure Active Directory OAuth2 流

Type: oauth2
Flow: accessCode
Authorization URL: https://api.example.com/oauth2/authorize
Token URL: https://api.example.com/oauth2/token

Scopes

名称 说明
https://cognitiveservices.azure.com/.default

示例

Create Person in PersonGroup

Sample Request

POST {endpoint}/face/v1.1-preview.1/persongroups/your_person_group_id/persons

{
  "name": "your_person_group_person_name",
  "userData": "your_user_data"
}

Sample Response

{
  "personId": "25985303-c537-4467-b41d-bdb45cd95ca1"
}

定义

名称 说明
CreatePersonResult

创建人员的响应。

FaceError

错误对象。 有关人脸服务返回的错误代码和消息的综合详细信息,请参阅以下链接: https://aka.ms/face-error-codes-and-messages

FaceErrorResponse

包含错误详细信息的响应。

CreatePersonResult

创建人员的响应。

名称 类型 说明
personId

string

人员 ID。

FaceError

错误对象。 有关人脸服务返回的错误代码和消息的综合详细信息,请参阅以下链接: https://aka.ms/face-error-codes-and-messages

名称 类型 说明
code

string

服务器定义的一组错误代码中的一个。

message

string

错误的用户可读表示形式。

FaceErrorResponse

包含错误详细信息的响应。

名称 类型 说明
error

FaceError

错误对象。