curl -X POST 'https://api.telapi.com/v1/Accounts/{AccountSid}/Calls/{CallSid}
' -u '{AccountSid}:{AuthToken}' -d ''
require_once 'library/TelApi.php';
# Always use singleton design pattern
$telapi = TelApi::getInstance();
# TelAPI REST API credentials are required
$telapi -> setOptions(array(
'account_sid' => '{AccountSid}',
'auth_token' => '{AuthToken}'
));
# You will need to have valid {CallSid} in order to
# send digits to the call
$call = $telapi->update(
array( 'calls', '{InprogessCallSid}
' ),
array( )
);
# Print content of the call object
print_r($call->getResponse());
# Access call sid
print_r($call->sid);
from telapi import rest
account_sid = '{AccountSid}'
auth_token = '{AuthToken}'
client = rest.Client(account_sid, auth_token)
account = client.accounts[client.account_sid]
call = account.calls['{CallSid}
']
call.save()
var util = require("util");
var Client = require('telapi').client;
var client = new Client(
'{AccountSid}',
'{AuthToken}'
);
client.update(
[ 'calls', '{CallSid}
' ],
{
},
function(response) {
util.log( "Call SID: " + response.sid );
},
function(error) {
util.log("Error: " + error)
}
);
require 'telapi'
Telapi.config do |config|
config.account_sid = '{AccountSid}'
config.auth_token = '{AuthToken}'
end
Telapi::Call.send_digits( {CallSid}
, )
using System;
using TelAPI;
namespace TelAPI.Example
{
public class SendDigits
{
public static void Main(string[] args)
{
var client = new TelAPIRestClient(
"{AccountSid}",
"{AuthToken}"
);
try
{
var call = client.SendDigits("{InprogessCallSid}
",
);
Console.WriteLine("Call sid : {0}", call.Sid);
}
catch (TelAPIException ex)
{
Console.WriteLine("{0}", ex.Message);
}
}
}
}
package com.telapi.api.example;
import com.telapi.api.TelapiConnector;
import com.telapi.api.configuration.BasicTelapiConfiguration;
import com.telapi.api.domain.Call;
import com.telapi.api.exceptions.TelapiException;
public class SendDigitsExample {
public static void main(String[] args) {
BasicTelapiConfiguration conf = new BasicTelapiConfiguration();
conf.setSid("{AccountSid}");
conf.setAuthToken("{AuthToken}");
TelapiConnector conn = new TelapiConnector(conf);
try {
Call call = conn.sendDigits("{CallSid}", "www2113", null);
System.out.println(call.getSid());
} catch (TelapiException e) {
e.printStackTrace();
}
}
}