Latest Legacy

Send digits on an active call

This endpoint lets you send DTMF digits on an active call.

API Endpoint

POST https://api.vtscom.net/v1/Account/{auth_id}/Call/{call_uuid}/DTMF/

Arguments

digitsRequired

Set of digits that need to be sent over the call.

legstring

This is the leg of the call in which the DTMF should be sent. This can take the values aleg (the current call) or bleg (the other party in a call).

Defaults to aleg.

Returns

Returns the acknowledgement that the DTMF is sent.

Response

HTTP Status Code: 202

{
  "message": "digits sent",
  "api_id": "07abfd94-58c0-11e1-86da-adf28403fe48"
}

Example Request

1
2
3
4
5
6
7
8
import vts

client = vts.RestClient('<auth_id>','<auth_token>')

response = client.calls.send_digits(
    call_uuid='eba53b9e-8fbd-45c1-9444-696d2172fbc8',
    digits='123', )
print(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#
# Example for Call DTMF Create
#
require 'rubygems'
require 'vts'

include vts
include vts::Exceptions

api = RestClient.new("<auth_id>","<auth_token>")

begin
  response = api.calls.send_digits(
    'eba53b9e-8fbd-45c1-9444-696d2172fbc8',
    '123',
    'bleg'
  )
  puts response
rescue VtsRESTError => e
  puts 'Exception: ' + e.message
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Example for Call DTMF create

var vts = require('vts');

(function main() {
    'use strict';
    
   // If auth id and auth token are not specified, vts will fetch them from the environment variables.
    var client = new vts.Client("<auth_id>","<auth_token>");
    client.calls.sendDigits(
        "eba53b9e-8fbd-45c1-9444-696d2172fbc8", // call uuid
        "123", // digits
    ).then(function (response) {
        console.log(response);
    }, function (err) {
        console.error(err);
    });
})();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
/**
 * Example for Call DTMF create
 */
require 'vendor/autoload.php';
use VTS\RestClient;
use VTS\Exceptions\VTSRestException;
$client = new RestClient("<auth_id>","<auth_token>");

try {
    $response = $client->calls->dtmf(
        'eba53b9e-8fbd-45c1-9444-696d2172fbc8',
        '123',
        'bleg'
    );
    print_r($response);
}
catch (VTSRestException $ex) {
    print_r($ex);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package net.vts.api.samples.call.dtmf;

import java.io.IOException;
import net.vts.api.Vts;
import net.vts.api.exceptions.VTSRestException;
import net.vts.api.models.call.Call;
import net.vts.api.models.call.actions.CallDtmfCreateResponse;

/**
* Example for Call DTMF create
*/
class DTMFCreate {
    public static void main(String [] args) {
        vts.init("<auth_id>","<auth_token>");
        try {
            CallDtmfCreateResponse response = Call.digitSender("eba53b9e-8fbd-45c1-9444-696d2172fbc8", "123")
                .sendDigits();

            System.out.println(response);
        } catch (VTSRestException | IOException e) {
            e.printStackTrace();
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
 * Example for Call DTMF Create
 */
using System;
using System.Collections.Generic;
using vts;
using vts.Exception;

namespace VTSExamples
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            var api = new VTSApi("<auth_id>","<auth_token>");
            try
            {
                var response = api.Call.SendDigits(
                    callUuid:"10c94053-73b4-46fe-b74a-12159d1d3d60",
                    digits:"123"
                );
                Console.WriteLine(response);
            }
            catch (VTSRestException e)
            {
                Console.WriteLine("Exception: " + e.Message);
            }
        }
    }
}
1
2
3
4
curl -i --user AUTH_ID:AUTH_TOKEN \
    -H "Content-Type: application/json" \
    -d '{"digits":"8743#"}' \
    https://api.vts.net/v1/Account/{auth_id}/Call/{call_uuid}/DTMF/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Example for Call DTMF create
package main

import (
	"fmt"

	"github.com/vts/vts-go/v7"
)

func main() {
	client, err := vts.NewClient("<auth_id>", "<auth_token>", &vts.ClientOptions{})
	if err != nil {
		fmt.Print("Error", err.Error())
		return
	}
	response, err := client.Calls.SendDigits(
		"eba53b9e-8fbd-45c1-9444-696d2172fbc8",
		vts.CallDTMFParams{
			Digits: "123",
		},
	)
	if err != nil {
		fmt.Print("Error", err.Error())
		return
	}
	fmt.Printf("Response: %#v\n", response)
}