How to Create a digit collector in an active voice call

To create a digit collector in an active voice call, follow the steps below

1. Create an active voice call

Request:

curl -X POST \

  https://api.syniverse.com/scg-external-api/api/v1/calling/calls \

  -H 'Authorization: Bearer <TOKEN>' \

  -H 'Content-Type: application/json' \

  -d '{

    "from": "USfmJmPpEw4uXRjdQfN9J4",

    "to": "+14085551212"

}'
               Response: {"id": "dX9qqkH0b2UPEBL0WBsCz6"} - Active call ID

 2. Create Digit collector

Using the response id from the Active Call, submit a Digit collector call

curl -X POST \

        https://api.syniverse.com/scg-external-api/api/v1/calling/calls/dX9qqkH0b2UPEBL0WBsCz6/digits_collector \

        -H 'Authorization: Bearer <Token>' \

        -H 'Content-Type: application/json' \

        -d '{"max_digits":"10","terminating_digits":"#","timeout":"15","prompt":{"sentence":"<speak><prosody rate=\"slow\">Hello, please type your passcode digit and press #</prosody></speak>","voice":"matthew"}}'
               Response {"id": "9M5HBv1LIXTv1BLDCz6iL1"}  - collector ID

Please note that "#" is the only supported value for the "terminating_digits" parameter.

Webhook Events:

  • Active Voice call
{

  "topic": "SCG-Voice-Call",

  "attempt": 1,

  "event": {

    "fld-val-list": {

      "reason_code": "200",

      "previous_state": "STARTED",

     "company-id": 1500,

      "external_call_id": "",

      "call_price": 0.0175,

      "new_state": "ACTIVE",

      "to_address": "+14085551212",

      "reason_description": "SUCCESS",

      "from_address": "+16282222222",

     "application_id": 1700,

      "call_duration": 60,

      "call_id": "dX9qqkH0b2UPEBL0WBsCz6"

    },

    "evt-tp": "call_state_change",

    "timestamp": "2019-05-23T22:23:35.429Z"

  },

  "event-id": "TfE426OOR423QyKcLED7iw"

}

 

  • Digit Collector event
{

  "topic": "SCG-Voice-Call",

  "attempt": 1,

  "event": {

    "fld-val-list": {

      "reason": "TERMINATING_DIGIT",

     "company-id": 1500,

      "collect_id": "9dnDlyHA2dcXFa6zIeGG15",

      "external_collect_id": "",

      "digits": "58052",

      "call_external_id": "",

     "application_id": 1700,

      "call_id": "dX9qqkH0b2UPEBL0WBsCz6"

    },

    "evt-tp": "collector_state_change",

    "timestamp": "2019-05-23T22:23:48.229Z"

  },

  "event-id": "XghpT6ZeSFS93ecFPoQCtA"

}

 

For more information, check out the API reference: https://sdcdocumentation.syniverse.com/index.php/omni-channel/api-reference/explore-api-reference#tag/Digits-Collector

 

Was this article helpful?
1 out of 1 found this helpful

0 Comments

Article is closed for comments.