Push-to-Speech API

最新の更新:2025-05-08

Note: Voice broadcasts created through this API can only be accessed, modified, or deleted via the API. Note: The voice file language type currently only supports "en", "zh-Hans", "zh-Hant".

Authentication

For more details, please refer to the REST API overview section on Authentication Methods.

Create/Update Voice Broadcast

Creates a new voice broadcast if it does not exist; updates it if it does.

Endpoint

POST https://push.api.engagelab.cc/v4/voices
          POST https://push.api.engagelab.cc/v4/voices

        
このコードブロックは、フローティングウィンドウに表示されます

Request Example

Request Headers

POST /v4/voices Authorization: Basic (base64 auth string) Content-Type: multipart/form-data Accept: multipart/form-data
          POST /v4/voices
Authorization: Basic (base64 auth string)
Content-Type: multipart/form-data
Accept: multipart/form-data

        
このコードブロックは、フローティングウィンドウに表示されます

Request Data

--form 'language="en"' --form 'file="file"'
          --form 'language="en"'
--form 'file="file"'

        
このコードブロックは、フローティングウィンドウに表示されます

Request Data Description

  • language: Specifies the language of the voice broadcast file, used to select the required voice broadcast language.
  • file: The zip file needed for voice broadcast, containing all necessary mp3 files.

Response Example

Success Response

HTTP/1.1 200 OK Server: fasthttp Date: Thu, 01 Dec 2022 07:17:45 GMT Content-Type: application/json Content-Length: 85
          HTTP/1.1 200 OK
Server: fasthttp
Date: Thu, 01 Dec 2022 07:17:45 GMT
Content-Type: application/json
Content-Length: 85

        
このコードブロックは、フローティングウィンドウに表示されます
{ "file_url": "" }
          {
    "file_url": ""
}

        
このコードブロックは、フローティングウィンドウに表示されます
  • file_url: The download URL of the uploaded file on Huawei Cloud OBS.

Failure Response

HTTP/1.1 400 BAD REQUEST Content-Type: application/json; charset=utf-8
          HTTP/1.1 400 BAD REQUEST
Content-Type: application/json; charset=utf-8

        
このコードブロックは、フローティングウィンドウに表示されます
{ "error": { "code": 28400, "message": "error message" } }
          {
    "error": {
        "code": 28400,
        "message": "error message"
    }
}

        
このコードブロックは、フローティングウィンドウに表示されます

Audio File Specifications

The audio files for this API should be named according to specified numbers and words, each file format being .mp3. Below are the naming details supported:

  • English (en):

    • Numbers: "0" to "20", "30", "40", "50", "60", "70", "80", "90", "100", "1000", "1000000", "1000000000"
    • Words: "point", "and"
  • Chinese (zh):

    • Numbers: "0" to "10", "100", "1000", "10000", "100000000"
    • Words: "point"

Ensure all files are MP3 format for correct system integration.

Retrieve Voice Broadcast List

Endpoint

GET https://push.api.engagelab.cc/v4/voices

Request Example

Request Headers

GET /v4/voices Authorization: Basic (base64 auth string)
          GET /v4/voices
Authorization: Basic (base64 auth string)

        
このコードブロックは、フローティングウィンドウに表示されます
  • Sort order: Newest updates first.

Response Example

Successful Return

HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
          HTTP/1.1 200 OK 
Content-Type: application/json; charset=utf-8

        
このコードブロックは、フローティングウィンドウに表示されます
[ { "language":"en", "file_url":"" } ]
          [
    {
        "language":"en", 
        "file_url":""
    }
]

        
このコードブロックは、フローティングウィンドウに表示されます
  • Returns the list of valid voice broadcasts under that application.
  • language is as requested during creation/update.
  • file_url is the Huawei Cloud OBS download URL of the uploaded file.

Retrieve Voice Broadcast Details

Endpoint

GET https://push.api.engagelab.cc/v4/voices/{language}

Request Example

Request Headers

GET /v4/voices/en Authorization: Basic (base64 auth string)
          GET /v4/voices/en
Authorization: Basic (base64 auth string)

        
このコードブロックは、フローティングウィンドウに表示されます

Response Example

Successful Return

HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
          HTTP/1.1 200 OK 
Content-Type: application/json; charset=utf-8

        
このコードブロックは、フローティングウィンドウに表示されます

Response Data

{ "file_url": "" }
          {
   "file_url": ""
}

        
このコードブロックは、フローティングウィンドウに表示されます
  • If language does not exist, returns 404, otherwise returns the actual file_url which is the Huawei Cloud OBS download URL of the uploaded file.

Delete Voice File

Endpoint

DELETE https://push.api.engagelab.cc/v4/voices/{language}

Request Example

DELETE /v4/voices/en Authorization: Basic (base64 auth string)
          DELETE /v4/voices/en
Authorization: Basic (base64 auth string)

        
このコードブロックは、フローティングウィンドウに表示されます

Response Example

Successful Return

HTTP/1.0 200 Content-Type: application/json Content-Length: 0
          HTTP/1.0 200 
Content-Type: application/json
Content-Length: 0

        
このコードブロックは、フローティングウィンドウに表示されます

Failure Return

  • If language is invalid or does not exist.
HTTP/1.0 404 Not Found Content-Type: application/json
          HTTP/1.0 404 Not Found
Content-Type: application/json

        
このコードブロックは、フローティングウィンドウに表示されます
  • If the update operation is illegal.
HTTP/1.1 400 BAD REQUEST Content-Type: application/json; charset=utf-8
          HTTP/1.1 400 BAD REQUEST
Content-Type: application/json; charset=utf-8

        
このコードブロックは、フローティングウィンドウに表示されます
{ "error": { "code": 28400, "message": "error message" } }
          {
    "error": {
        "code": 28400,
        "message": "error message"
    }
}

        
このコードブロックは、フローティングウィンドウに表示されます

Error Codes

Code HTTP Status Description Error Message Detailed Explanation
28000 200 Successful response nil Success status code
28101 401 Authentication failure Basic authentication failed. Appkey and masterscrect do not match.
28200 500 Internal server error Server Internal error. An unanticipated error occurred.
28203 503 Internal server error, please try again later Execute action timeout, please try later again Communication error with schedule-server.
在文档中心打开