Call Actions

makeCall

This function should be used to connect the first call with another party.

The following is an example of the JSON response you would need to provide:

{
  "clientActionId": "NumberMaskingId1",
    "callflow": [
    {
      "action": "makeCall",
      "params": {
        "source": "6512345678", 
        "destination": "6587654321"
      }
    } 
    ]
}

The action should contain the following parameters:

Name

Type

Description

action

String

MakeCall – Action to Connect/Bridge call between two users

destination

String

Number of the called party in E.164 format (The second user's number).

source

String

Number of the calling party in E.164 format. This should be the Virtual Number allocated to your sub-account

say

This action should be used to play a text to speech message on the call.

The following is an example of the JSON response you would need to provide:

{
    "clientActionId": "NumberMaskingId1",
    "callflow": [ 
            {
                "action": "say",
        "params": {
          "text": "Hello This is a test message", 
          "language": "en",
          "voiceProfile": "generic-en-male",
          "repetition": 1
        }
            } 
     ]
}

The above example would be used if you want the message “This is a test message” to be pronounced in an English female voice.

The action should contain the following parameters:

Name

Type

Description

action

String

say – Text to speech function

text

String

The text to speech message that will be played on the call

language

String

The language of the spoken text, see in the table below of supported languages

voiceProfile

String

The voice profile of the spoken text, see in the table below the supported voice profiles

repetition

Integer

Defines the number of times the text will be repeated during the call.

Supported TTS Voice and language are:

Language

Language code

Male voice profile

Female voice profile

English

EN

generic-en-male

generic-en-female

Chinese

ZN

N/A

generic-zn-female

Danish

DA

generic-da-male

generic-da-female

Dutch

NL

generic-nl-male

generic-nl-female

French

FR

generic-fr-male

generic-fr-female

German

DE

generic-de-male

generic-de-female

Hindi

Hi

N/A

generic-hi-female

Icelandic

IS

generic-is-male

generic-is-female

Italian

IT

generic-it-male

generic-it-female

Japanese

JA

generic-ja-male

generic-ja-female

Korean

SV

N/A

generic-sv-female

Norwegian

NB

N/A

generic-nb-female

Polish

PL

generic-pl-male

generic-pl-female

Portuguese

PT

generic-pt-male

generic-pt-female

Romanian

RO

N/A

generic-ro-female

Russian

RU

generic-ru-male

generic-ru-female

Spanish

ES

generic-es-male

generic-es-female

Swedish

SV

N/A

generic-sv-female

Thai

TH

N/A

generic-th-female

Turkish

TR

N/A

generic-tr-female

Vietnamese

VN

generic-vn-male

generic-vn-female

Welsh

CY

N/A

generic-cy-female

say&capture

This action should be used to play a text to speech message and capture user inputs.

The following is an example of the JSON response you would need to provide:

{
  "clientActionId": "NumberMaskingId1",
    "callflow": [ 
    {
      "action": "say&capture",
        "params": {
          "text": "Hello This is a test message", 
          "language": "en",
          "voiceProfile": "generic-en-male",
          "repetition": 1,
          "minDigits": 5
       }
    }
  ] 
}

The action should contain the following parameters:

Name

Type

Description

action

String

say&capture – Action to play an TTS message and capture user inputs

text

String

The text to speech message that will be played on the call

language

String

The language code of the spoken text, see in the table above the supported languages

voiceProfile

String

The voice profile of the spoken text, see in the table above the supported voice profiles

repetition

Integer

Defines the number of times the text will be repeated during the call.

minDigits

Integer

(Optional) Minimum number of dial-pad inputs that the calling user can make. Accepted values are from 1 to 20.

Hangup

This action should be used to hang up the incoming call.

The following is an example of the JSON response you would need to provide:

{
    "clientActionId": "NumberMaskingId1",
    "callflow": [ 
        {
        "action": "hangup" 
    }
  ]
}

Note: The Hangup action is needed only if you do not want to complete any other action. This action is not necessary if the calling user hangs up the call.

Commands Example

On the following example it is demonstrated how multiple actions can be used in the same callHandle reply:

{
  "clientActionId": "NumberMaskingId1",
    "callflow": [ 
    {
      "action": "say&capture",
        "params": {
          "text": "Hello This is a test message", 
          "language": "en",
          "voiceProfile": "generic-en-male",
          "repetition": 1,
          "minDigits": 5
      }
    },
    {
        "action": "hangup" 
    }
  ] 
}