Say Text-To-Speech (TTS)

Use this request in order to say a text message during a call, this API uses our Text-To-Speech service to convert the provided text into an audio, you can configure the text, language, voice nature and if you want the message to repeat.

Command for say text to call

type: object
title: Say text to Call
additionalProperties: false
properties:
  text:
    type: string
  locale:
    type: string
    format: locale-bcp47
    default: en-US
    example:
      - en-US
    enum:
      - arb
      - ar-AE
      - ca-ES
      - yue-CN
      - cmn-CN
      - da-DK
      - nl-BE
      - nl-NL
      - en-AU
      - en-GB
      - en-IN
      - en-NZ
      - en-ZA
      - en-US
      - en-GB-WLS
      - fi-FI
      - fr-FR
      - fr-CA
      - hi-IN
      - de-DE
      - de-AT
      - is-IS
      - it-IT
      - ja-JP
      - ko-KR
      - nb-NO
      - pl-PL
      - pt-BR
      - pt-PT
      - ro-RO
      - ru-RU
      - es-ES
      - es-MX
      - es-US
      - sv-SE
      - tr-TR
      - cy-GB
  voice:
    type: string
    enum:
      - male
      - female
  loop:
    type: integer
  timeout:
    type: integer
required:
  - text

Say TTS

Say TTS into a channel call

POST/workspaces/{workspaceId}/channels/{channelId}/calls/{callId}/say
Authorization
Path parameters
workspaceId*string (uuid)

The ID of the workspace

callId*string (uuid)

The ID for a call

channelId*string (uuid)

The ID for a channel

Body
text*string
localeenum
Example: "en-US"
arbar-AEca-ESyue-CNcmn-CNda-DKnl-BEnl-NLen-AUen-GBen-INen-NZen-ZAen-USen-GB-WLSfi-FIfr-FRfr-CAhi-INde-DEde-ATis-ISit-ITja-JPko-KRnb-NOpl-PLpt-BRpt-PTro-ROru-RUes-ESes-MXes-USsv-SEtr-TRcy-GBth-THfil-PH
voicestring
loopinteger
timeoutinteger
Response

Call Command Say was accepted for processing

Body
idId-2 (string (uuid))
callIdId-2 (string (uuid))
callFlowIdId-2 (string (uuid))
statusstring
commandstring
Request
const response = await fetch('/workspaces/{workspaceId}/channels/{channelId}/calls/{callId}/say', {
    method: 'POST',
    headers: {
      "Authorization": "Bearer jwt",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "text": "text"
    }),
});
const data = await response.json();
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "callId": "123e4567-e89b-12d3-a456-426614174000",
  "callFlowId": "123e4567-e89b-12d3-a456-426614174000",
  "status": "text",
  "command": "text"
}

Example 1: Play an announcement when an outbound call is running

curl -X POST "https://nest.messagebird.one/workspaces/8bc02f53-87ac-48d2-b4fd-c2cf856a305f/channels/880d8171-cbab-47bb-81b6-b1a0902da136/calls/4fc2edf7-68f5-437a-89eb-3ce0095409d6
/say" \
     -H 'Authorization: Bearer {Token}'

Last updated