Latest Legacy

Send digits on an active call

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

API Endpoint

POST https://api.plivo.com/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 plivo

client = plivo.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 'plivo'

include Plivo
include Plivo::Exceptions

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

begin
  response = api.calls.send_digits(
    'eba53b9e-8fbd-45c1-9444-696d2172fbc8',
    '123',
    'bleg'
  )
  puts response
rescue PlivoRESTError => 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 plivo = require('plivo');

(function main() {
    'use strict';
    
   // If auth id and auth token are not specified, Plivo will fetch them from the environment variables.
    var client = new plivo.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 Plivo\RestClient;
use Plivo\Exceptions\PlivoRestException;
$client = new RestClient("<auth_id>","<auth_token>");

try {
    $response = $client->calls->dtmf(
        'eba53b9e-8fbd-45c1-9444-696d2172fbc8',
        '123',
        'bleg'
    );
    print_r($response);
}
catch (PlivoRestException $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 com.plivo.api.samples.call.dtmf;

import java.io.IOException;
import com.plivo.api.Plivo;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.call.Call;
import com.plivo.api.models.call.actions.CallDtmfCreateResponse;

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

            System.out.println(response);
        } catch (PlivoRestException | 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 Plivo;
using Plivo.Exception;

namespace PlivoExamples
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            var api = new PlivoApi("<auth_id>","<auth_token>");
            try
            {
                var response = api.Call.SendDigits(
                    callUuid:"10c94053-73b4-46fe-b74a-12159d1d3d60",
                    digits:"123"
                );
                Console.WriteLine(response);
            }
            catch (PlivoRestException 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.plivo.com/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/plivo/plivo-go/v7"
)

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