This method lets you hang up an ongoing call or cancel a queued outbound call. If you want to hang up an incoming call without answering it, see the documentation on the Hangup XML element.
## Example for Call Delete#require'rubygems'require'plivo'includePlivoincludePlivo::Exceptionsapi=RestClient.new("<auth_id>","<auth_token>")beginresponse=api.calls.delete('eba53b9e-8fbd-45c1-9444-696d2172fbc8')putsresponserescuePlivoRESTError=>eputs'Exception: '+e.messageend
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Example for Call deletevarplivo=require('plivo');(functionmain(){'use strict';// If auth id and auth token are not specified, Plivo will fetch them from the environment variables.varclient=newplivo.Client("<auth_id>","<auth_token>");client.calls.hangup("eba53b9e-8fbd-45c1-9444-696d2172fbc8",// call uuid).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
<?php/**
* Example for Call delete
*/require'vendor/autoload.php';usePlivo\RestClient;usePlivo\Exceptions\PlivoRestException;$client=newRestClient("<auth_id>","<auth_token>");try{$response=$client->calls->delete('eba53b9e-8fbd-45c1-9444-696d2172fbc8');print_r($response);}catch(PlivoRestException$ex){print_r($ex);}
packagecom.plivo.api.samples.call;importjava.io.IOException;importcom.plivo.api.Plivo;importcom.plivo.api.exceptions.PlivoRestException;importcom.plivo.api.models.call.Call;/**
* Example for Call delete
*/classCallDelete{publicstaticvoidmain(String[]args){Plivo.init("<auth_id>","<auth_token>");try{Call.deleter("eba53b9e-8fbd-45c1-9444-696d2172fbc8").delete();System.out.println("Deleted successfully.");}catch(PlivoRestException|IOExceptione){e.printStackTrace();}}}
/**
* Example for Call Delete
*/usingSystem;usingSystem.Collections.Generic;usingPlivo;usingPlivo.Exception;namespacePlivoExamples{internalclassProgram{publicstaticvoidMain(string[]args){varapi=newPlivoApi("<auth_id>","<auth_token>");try{varresponse=api.Call.Delete(callUuid:"10c94053-73b4-46fe-b74a-12159d1d3d60");Console.WriteLine(response);}catch(PlivoRestExceptione){Console.WriteLine("Exception: "+e.Message);}}}}
// Example for Call deletepackagemainimport("fmt""github.com/plivo/plivo-go/v7")funcmain(){client,err:=plivo.NewClient("<auth_id>","<auth_token>",&plivo.ClientOptions{})iferr!=nil{fmt.Print("Error",err.Error())return}err=client.Calls.Delete("eba53b9e-8fbd-45c1-9444-696d2172fbc8",)iferr!=nil{fmt.Print("Error",err.Error())return}fmt.Println("Deleted successfully.")}
Example Request
1
2
3
4
5
6
7
8
9
10
11
12
importplivo,plivoxmlauth_id="Your AUTH_ID"auth_token="Your AUTH_TOKEN"p=plivo.RestAPI(auth_id,auth_token)# params references the UUID of the call to be hung up
params={'call_uuid':'defb0706-86a6-11e4-b303-498d468c930b'}# Hang up a call
response=p.hangup_call(params)printstr(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
require'rubygems'require'plivo'includePlivoAUTH_ID="Your AUTH_ID"AUTH_TOKEN="Your AUTH_TOKEN"p=RestAPI.new(AUTH_ID,AUTH_TOKEN)# params references the UUID of the call to be hung upparams={'call_uuid':'defb0706-86a6-11e4-b303-498d468c930b'}response=p.hangup_call(params)printresponse
1
2
3
4
5
6
7
8
9
10
11
12
13
14
varplivo=require('plivo');varp=plivo.RestAPI({authId:'Your AUTH_ID',authToken:'Your AUTH_TOKEN'});// UUID of the call to be hung upvarparams={'call_uuid':'defb0706-86a6-11e4-b303-498d468c930b'};// Prints the complete responsep.hangup_call(params,function(status,response){console.log('Status: ',status);console.log('API Response:\n',response);});
1
2
3
4
5
6
7
8
9
10
11
12
13
<?phprequire'vendor/autoload.php';usePlivo\RestAPI;$auth_id="Your AUTH_ID";$auth_token="Your AUTH_TOKEN";$p=newRestAPI($auth_id,$auth_token);# params references the UUID of the call to be hung up$params=array('call_uuid'=>'defb0706-86a6-11e4-b303-498d468c930b');$response=$p->hangup_call($params);print_r($response)?>
packagecom.plivo.test;importjava.util.LinkedHashMap;importcom.plivo.helper.api.client.*;importcom.plivo.helper.api.response.response.GenericResponse;importcom.plivo.helper.exception.PlivoException;publicclassApp{publicstaticvoidmain(String[]args)throwsIllegalAccessException{Stringauth_id="Your AUTH_ID";Stringauth_token="Your AUTH_TOKEN";RestAPIapi=newRestAPI(auth_id,auth_token,"v1");LinkedHashMap<String,String>parameters=newLinkedHashMap<String,String>();// parameters references the UUID of the call to be hung upparameters.put("call_uuid","defb0706-86a6-11e4-b303-498d468c930b");try{GenericResponseresp=api.hangupCall(parameters);System.out.println(resp);}catch(PlivoExceptione){System.out.println(e.getLocalizedMessage());}}}
usingSystem;usingSystem.Collections.Generic;usingRestSharp;usingPlivo.API;namespacehangup{classProgram{staticvoidMain(string[]args){RestAPIplivo=newRestAPI("Your AUTH_ID","Your AUTH_TOKEN");IRestResponse<GenericResponse>resp=plivo.hangup_call(newDictionary<string,string>(){// this references the UUID of the call to be hung up{"call_uuid","defb0706-86a6-11e4-b303-498d468c930b"}});//Prints the responseConsole.Write(resp.Content);Console.ReadLine();}}}
// Example for Call deletepackagemainimport("fmt""github.com/plivo/plivo-go/v7")funcmain(){client,err:=plivo.NewClient("<auth_id>","<auth_token>",&plivo.ClientOptions{})iferr!=nil{fmt.Print("Error",err.Error())return}err=client.Calls.Delete("eba53b9e-8fbd-45c1-9444-696d2172fbc8",)iferr!=nil{fmt.Print("Error",err.Error())return}fmt.Println("Deleted successfully.")}
Rate this page
🥳 Thank you! It means a lot to us!
×
Help Us Improve
Thank you so much for rating the page, we would like to get your input
for further improvements!