# 用户声纹管理相关API
# 新增或修改用户声纹
云平台可以调用此接口新增或修改用户声纹数据。
# 请求路径
【POST】https://nice.zebra-c.com/api/user/saveVoice
# 请求参数
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| user_code | string | 是 | 用户ID(同海王星用户的user_code字段) |
| user_name | string | 否 | 用户名 |
| voice_code | string | 是 | 声纹ID |
| voice_type | int | 否 | 声纹类型:1.文件 2.url。(新增时该字段必须传) |
| url | string | 否 | 声纹文件url。(voice_type=2时必须传;声纹文件大小不能小于4KB且不能超过10MB;声纹时长要大于3s) |
| file | file | 否 | 声纹文件。(voice_type=1时必须传;声纹文件大小不能小于4KB且不能超过10MB;声纹时长要大于3s ) |
# 请求示例
{
"user_code":"fc61fesjhgfds62f92ba",
"user_name":"aa1801",
"voice_code":"fesjhc6162f92bfgfdsa-002",
"voice_type":2,
"url":"https://tencs.com/20211123/1637648490_7875.wav"
}
# 请求** CURL **命令
curl --location --request POST 'https://nice.zebra-c.com/api/user/saveVoice' \
--header 'Content-Type: application/json' \
--data-raw '{ "user_code":"fc61fesjhgfds62f92ba", "user_name":"aa1801", "voice_code":"fesjhc6162f92bfgfdsa-002", "voice_type":2, "url":"https://tencs.com/20211123/1637648490_7875.wav" }'
# 成功返回参数(** body **)
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| n_user_code | string | 是 | nice平台用户ID |
| n_voice_code | string | 是 | nice平台声纹ID |
# 成功返回示例
{
"errcode": 0,
"message": "成功",
"data": {
"n_user_code": "2a202f316508708e2267726b64cdb54d",
"n_voice_code": "Nv67751626b65db2084c708e24d"
}
}
# 删除用户声纹
云平台可以调用此接口删除用户声纹数据。
# 请求路径
【POST】https://nice.zebra-c.com/api/user/deleteVoice
# 请求参数
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| user_code | string | 是 | 用户ID |
| voice_code | string | 是 | 声纹ID |
| is_delete | int | 是 | 1.删除 |
# 请求示例
{
"user_code":"fc61fesjhgfds62f92ba",
"voice_code":"fesjhc6162f92bfgfdsa-002",
"is_delete":1
}
# 请求** CURL **命令
curl --location --request POST 'https://nice.zebra-c.com/api/user/deleteVoice'; \
--header 'Content-Type: application/json' \
--data-raw '{ "user_code":"fc61fesjhgfds62f92ba", "voice_code":"fesjhc6162f92bfgfdsa-002", "is_delete":1 }'
# 成功返回参数(** body **)
| 参数 | 类型 | 必须 | 说明 |
|---|
# 成功返回示例
{
"errcode": 0,
"message": "成功",
"data": { }
}
# 获取用户声纹列表
云平台可以调用此接口获取用户声纹列表。
# 请求路径
【POST】https://nice.zebra-c.com/api/user/allVoice
# 请求参数
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| user_code | string | 是 | 用户ID |
# 请求示例
{
"user_code":"fc61fesjhgfds62f92ba"
}
# 请求** CURL **命令
curl --location --request POST 'https://nice.zebra-c.com/api/user/allVoice'; \
--header 'Content-Type: application/json' \
--data-raw '{ "user_code":"fc61fesjhgfds62f92ba" }'
# 成功返回参数(** body **)
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| user_code | string | 是 | 用户ID |
| user_name | string | 是 | 用户姓名 |
| voice_code | string | 是 | 声纹ID |
# 成功返回示例
{
"errcode": 0,
"message": "成功",
"data": [
{
"voice_code": "fc6162bfesjhgfdsa-0f9202",
"user_code": "bfesjhgfdsafc6162f92",
"user_name": "ceshi103"
},
{
"voice_code": "fc6162bfesjhgfdsa-0f8436",
"user_code": "bfesjhgfdsafc6162f92",
"user_name": "ceshi103"
}
]
}