CREATE OUTBOUND CALL USING TEXT

CREATE OUTBOUND CALL USING TEXT

Using Text2Speech API we can trigger a call using text as input and that text will be played as voice message once recipient answers the call.

API Endpoint

https://eu.cpaas.bics.com/api/v2/

Note: Few elements in the endpoint may change from service to service.

POST

{endpoint}outgoing/tts

MANDATORY PARAMETERS

Name Descriptions
bridge Bridge number for call initiation
to Phone number with country code to which call has to connect
text Message text you want to send which will be played as speech once call is answered

OPTIONAL PARAMETERS

Name Descriptions
options Extra options for TTS API
break definition of the break that you can add in the text to Play
>identifier Identifier for the break characters in message text to play
>time Break duration
voice definition of voice options
>language language in which the text will be played. Possible values are English, French, German, Dutch, Spanish, Italian, Portuguese, Russian. Default language: Engish
>gender gender of the voice in which the text will be played. Possible values are Female and Male. Default gender: Female
iteration_tries number of iterations the text will be played. By default, iterationsNumber is set to 1
iteration_delay break time between 2 iterations of the text. delay is mentioned in sec.Default 0.5 sec
voiceid id of the voice in which the text will be played, these Ids can be chosen from this list: Nicole, Kevin, Enrique, Tatyana, Russell, Olivia, Lotte, Geraint, Carmen, Mads, Penelope, Mia, Joanna, Matthew, Brian, Seoyeon, Ruben, Ricardo, Maxim, Lea, Giorgio, Carla, Naja, Maja, Astrid, Ivy, Kimberly, Chantal, Amy, Vicki, Marlene, Ewa, Conchita, Camila, Karl, Zeina, Miguel, Mathieu, Justin, Lucia, Jacek, Bianca, Takumi, Ines, Gwyneth, Cristiano, Mizuki, Celine, Zhiyu, Jan, Liv, Joey, Raveena, Filiz, Dora, Salli, Aditi, Vitoria, Emma, Lupe, Hans, Kendra read more
cURL - cURL
curl --location --globoff '{endpoint}api/v2/outgoing/tts' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_key}' \
--data '{
    "bridge": "{bridge_num}",
    "to":"{receiver}",
    "text": "Hi## This is the text to speech using ##outgoing api",
    "options": {
        "language": "en-US",
        "break": {
            "identifier": "##",
            "time": 1
        }
    }
}'

Example Response

{
  "status": "OK",
  "message": "Calls queued successfully",
  "data": [
    {
      "id": "52ecf5da-259b-4e0f-a2eb-XXXXXX",
      "channel": "outgoing",
      "caller_id": "917200XXXXXX",
      "mobile": "918867XXXXXX",
      "flow_id": "5784",
      "credits": "0.0005",
      "created_at": "2023-01-23T12:13:25.666366Z",
      "foreign_id": null,
      "options": null,
      "status": "queued"
    }
  ]
}
cURL - cURL
curl --location --globoff '{endpoint}api/v2/outgoing/tts' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_key}' \
--data '{
    "bridge": "{bridge_num}",
    "to":"{receiver}",
    "text": "A wish for you on your birthday, whatever you ask may you receive, whatever you seek may you find, whatever you wish may it be fulfilled on your birthday and always. Happy birthday!",
    "options": {
        "voiceid":"Ayanda"
    }
 }'

Example Response

{
  "status": "OK",
  "message": "Calls queued successfully",
  "data": [
    {
      "id": "52ecf5da-259b-4e0f-a2eb-XXXXXX",
      "channel": "outgoing",
      "caller_id": "917200XXXXXX",
      "mobile": "918867XXXXXX",
      "flow_id": "5784",
      "credits": "0.0005",
      "created_at": "2023-01-23T12:13:25.666366Z",
      "foreign_id": null,
      "options": null,
      "status": "queued"
    }
  ]
}
cURL - cURL
curl --location --globoff '{endpoint}api/v2/outgoing/tts' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_key}' \
--data '{
    "bridge": "{bridge_num}",
    "to": {receiver},
    "text": "Hi## welcome to mobtexting",
    "options": {
        "language": "en-US",
        "break": {
            "identifier": "##",
            "time": 1
        },
        "iteration_tries": 2,
        "iteration_delay":3
    }
}'

Example Response

{
  "status": "OK",
  "message": "Calls queued successfully",
  "data": [
    {
      "id": "52ecf5da-259b-4e0f-a2eb-XXXXXX",
      "channel": "outgoing",
      "caller_id": "917200XXXXXX",
      "mobile": "918867XXXXXX",
      "flow_id": "5784",
      "credits": "0.0005",
      "created_at": "2023-01-23T12:13:25.666366Z",
      "foreign_id": null,
      "options": null,
      "status": "queued"
    }
  ]
}