Delete an Application

    This API would delete the Application permanently.

    API Endpoint

    DELETE https://api.plivo.com/v1/Account/{auth_id}/Application/{app_id}/

    Arguments

    cascadeOptionalBoolean

    If cascade is set to true, the Endpoints associated with the Application, if any, are also deleted.

    When set to false, the Endpoints associated with the Application, if any, are not deleted. If a new_endpoint_application has been specified, then the Endpoints are reassociated with the given Application. If a new_endpoint_application is not specified, then the Endpoints remain orphaned. (i.e. not associated with any Application.)

    cascade is set to true by default when not specified.

    new_endpoint_applicationOptionalString

    The app_id of the new Application to which the Endpoints should be associated upon deletion of this Application.

    Response

    HTTP Status Code: 204

    Example Request

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    
    import plivo
    
    client = plivo.RestClient()
    response = client.applications.delete(
        app_id='21686794894743506', )
    print(response)
    
    # You can updated an application directly using the application object
    application = client.applications.get('21686794894743506')
    application.delete()
    print(response)
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    
    #
    # Example for Application Delete
    #
    require 'rubygems'
    require 'plivo'
    
    include Plivo
    include Plivo::Exceptions
    
    api = RestClient.new("YOUR_AUTH_ID", "YOUR_AUTH_TOKEN")
    
    begin
      response = api.applications.delete(
        '15784735442685051'
      )
      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
    
    // Example for Application delete
    
    var plivo = require('plivo');
    
    (function main() {
        'use strict';
        
        // As the auth_id and auth_token are unspecified, Plivo will fetch them from the PLIVO_AUTH_ID and PLIVO_AUTH_TOKEN environment variables.
        var client = new plivo.Client();
        client.applications.delete(
            "15784735442685051", // app id
        ).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 Application delete
     */
    require 'vendor/autoload.php';
    use Plivo\RestClient;
    use Plivo\Exceptions\PlivoRestException;
    $client = new RestClient("YOUR_AUTH_ID", "YOUR_AUTH_TOKEN");
    
    try {
        $response = $client->applications->delete(
            '15784735442685051'
        );
        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
    
    package com.plivo.api.samples.application;
    
    import java.io.IOException;
    import com.plivo.api.Plivo;
    import com.plivo.api.exceptions.PlivoRestException;
    import com.plivo.api.models.application.Application;
    
    /**
    * Example for Application delete
    */
    class ApplicationDelete {
        public static void main(String [] args) {
            Plivo.init();
            try {
                Application.deleter("15784735442685051")
                    .delete();
    
                System.out.println("Deleted successfully.");
            } 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
    
    /**
     * Example for Application Delete
     */
    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("YOUR_AUTH_ID", "YOUR_AUTH_TOKEN");
                try
                {
                    var response = api.Application.Delete(
                        appId:"15784735442685051"
                    );
                    Console.WriteLine(response);
                }
                catch (PlivoRestException e)
                {
                    Console.WriteLine("Exception: " + e.Message);
                }
            }
        }
    }
    
    1
    2
    
    curl -X DELETE -i --user AUTH_ID:AUTH_TOKEN \
        https://api.plivo.com/v1/Account/{auth_id}/Application/{app_id}/
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    
    // Example for Application delete
    package main
    
    import "fmt"
    import "github.com/plivo/plivo-go"
     
    func main() {
    	client, err := plivo.NewClient("", "", &plivo.ClientOptions{})
    	if err != nil {
    		panic(err)
    	}
    	err = client.Applications.Delete(
    		"15784735442685051",
    	)
    	if err != nil {
    		panic(err)
    	}
    	fmt.Println("Deleted successfully.")
    }