共用方式為


Consents - Create

使用提供的音訊 URL 建立新的語音人員同意。

PUT {endpoint}/customvoice/consents/{id}?api-version=2023-12-01-preview

URI 參數

名稱 位於 必要 類型 Description
endpoint
path True

string

支援的認知服務端點 (通訊協定和主機名,例如: https://eastus.api.cognitive.microsoft.com) 。

id
path True

string

資源的標識碼。

Regex pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$

api-version
query True

string

用於此作業的 API 版本。

要求標頭

名稱 必要 類型 Description
Ocp-Apim-Subscription-Key True

string

在這裡提供您的語音資源金鑰。

Operation-Id

string

作業的狀態監視器標識碼。 如果 Operation-Id 標頭符合現有的作業,且要求與先前的要求不相同,則會失敗並出現 400 不正確的要求。

Regex pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$

要求本文

名稱 必要 類型 Description
companyName True

string

公司名稱。 必須符合同意音訊檔案中的公司名稱。

locale True

string

此同意的地區設定。 地區設定程式代碼遵循 BCP-47。 您可以在這裡 https://learn.microsoft.com/azure/ai-services/speech-service/language-support?tabs=tts找到文字到語音地區設定清單。

projectId True

string

資源識別碼

voiceTalentName True

string

語音人才名稱。 必須符合同意音訊檔案中的語音人才名稱。

audioUrl

string

同意音訊檔案的公用可存取 URL。 建議使用 SAS 作為 Azure Blob URL。 這個屬性只能在要求中使用。

description

string

同意的描述。

displayName

string

同意的名稱。

id

string

資源識別碼

status

Status

資源的狀態。

回應

名稱 類型 Description
201 Created

Consent

建立時間

Headers

  • Operation-Id: string
  • Operation-Location: string
Other Status Codes

ErrorResponse

發生錯誤。

安全性

Ocp-Apim-Subscription-Key

在這裡提供您的語音資源金鑰。

Type: apiKey
In: header

範例

Sample Request

PUT {endpoint}/customvoice/consents/Jessica?api-version=2023-12-01-preview



{
  "description": "Consent for Jessica voice",
  "projectId": "Jessica",
  "voiceTalentName": "Jessica Smith",
  "companyName": "Contoso",
  "audioUrl": "https://contoso.blob.core.windows.net/public/jessica-consent.wav?mySasToken",
  "locale": "en-US"
}

Sample Response

Operation-Location: https://eastus.api.cognitive.microsoft.com/customvoice/operations/070f7986-ef17-41d0-ba2b-907f0f28e314?api-version=2023-12-01-preview
Operation-Id: 070f7986-ef17-41d0-ba2b-907f0f28e314
{
  "id": "Jessica",
  "description": "Consent for Jessica voice",
  "projectId": "Jessica",
  "voiceTalentName": "Jessica Smith",
  "companyName": "Contoso",
  "locale": "en-US",
  "status": "NotStarted",
  "createdDateTime": "2023-04-01T05:30:00.000Z",
  "lastActionDateTime": "2023-04-02T10:15:30.000Z"
}

定義

名稱 Description
Consent

Consent 物件

Error

最上層錯誤遵循可在 取得 https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors的 Microsoft Azure REST API 指導方針。 這包含具有錯誤碼、訊息、詳細數據、目標和內部錯誤的最上層錯誤,其中包含更詳細的描述性詳細數據。

ErrorCode

最上層錯誤碼

ErrorResponse

錯誤回應遵循 Microsoft https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errorsAzure REST API 指導方針,可在 取得。

InnerError

內部錯誤遵循可在 取得 https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors的 Microsoft Azure REST API 指導方針。 這包含必要的屬性錯誤碼、訊息和選擇性屬性目標、內部錯誤 (這可以是巢狀) 。

Status

資源的狀態。

Consent 物件

名稱 類型 Description
audioUrl

string

同意音訊檔案的公用可存取 URL。 建議使用 SAS 作為 Azure Blob URL。 這個屬性只能在要求中使用。

companyName

string

公司名稱。 必須符合同意音訊檔案中的公司名稱。

createdDateTime

string

建立物件時的時間戳。 時間戳會編碼為 ISO 8601 日期和時間格式 (“YYYY-MM-DDThh:mm:ssZ”,請參閱 https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations)

description

string

同意的描述。

displayName

string

同意的名稱。

id

string

資源識別碼

lastActionDateTime

string

輸入目前狀態時的時間戳。 時間戳會編碼為 ISO 8601 日期和時間格式, (“YYYY-MM-DDThh:mm:ssZ”,請參閱 https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) 。

locale

string

此同意的地區設定。 地區設定程式代碼遵循 BCP-47。 您可以在這裡 https://learn.microsoft.com/azure/ai-services/speech-service/language-support?tabs=tts找到文字到語音地區設定清單。

projectId

string

資源識別碼

status

Status

資源的狀態。

voiceTalentName

string

語音人才名稱。 必須符合同意音訊檔案中的語音人才名稱。

Error

最上層錯誤遵循可在 取得 https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors的 Microsoft Azure REST API 指導方針。 這包含具有錯誤碼、訊息、詳細數據、目標和內部錯誤的最上層錯誤,其中包含更詳細的描述性詳細數據。

名稱 類型 Description
code

ErrorCode

最上層錯誤碼

details

Error[]

關於錯誤和/或預期原則的其他支持詳細數據。

innererror

InnerError

內部錯誤遵循可在 取得 https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors的 Microsoft Azure REST API 指導方針。 這包含必要的屬性錯誤碼、訊息和選擇性屬性目標、內部錯誤 (這可以是巢狀) 。

message

string

最上層錯誤訊息。

target

string

錯誤的來源。 例如,如果是無效的模型,它會是「模型」或「模型標識碼」。

ErrorCode

最上層錯誤碼

名稱 類型 Description
BadArgument

string

BadRequest

string

Forbidden

string

InternalServerError

string

NotFound

string

ServiceUnavailable

string

TooManyRequests

string

Unauthorized

string

UnsupportedMediaType

string

ErrorResponse

錯誤回應遵循 Microsoft https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errorsAzure REST API 指導方針,可在 取得。

名稱 類型 Description
error

Error

最上層錯誤遵循可在 取得 https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors的 Microsoft Azure REST API 指導方針。 這包含具有錯誤碼、訊息、詳細數據、目標和內部錯誤的最上層錯誤,其中包含更詳細的描述性詳細數據。

InnerError

內部錯誤遵循可在 取得 https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors的 Microsoft Azure REST API 指導方針。 這包含必要的屬性錯誤碼、訊息和選擇性屬性目標、內部錯誤 (這可以是巢狀) 。

名稱 類型 Description
code

string

詳細的錯誤碼可協助診斷。

innererror

InnerError

內部錯誤遵循可在 取得 https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors的 Microsoft Azure REST API 指導方針。 這包含必要的屬性錯誤碼、訊息和選擇性屬性目標、內部錯誤 (這可以是巢狀) 。

message

string

詳細的錯誤訊息。

target

string

錯誤的來源。 例如,如果是無效的模型,它會是「模型」或「模型標識碼」。

Status

資源的狀態。

名稱 類型 Description
Disabled

string

Disabling

string

Failed

string

NotStarted

string

Running

string

Succeeded

string