Delete MMS Media

    Deletes the media files sent or received with an MMS message.

    API Endpoint

    DELETE https://api.plivo.com/v1/Account/{auth_id}/Message/{message_uuid}/Media/

    Arguments

    No arguments need to be passed.

    Response

    HTTP Status Code: 204

    Example Request

    1
    2
    3
    4
    5
    6
    
    import plivo
    
    client = plivo.RestClient("auth_id","auth_token")
    
    response = client.messages.get(message_uuid="your_message_uuid").deleteMedia()
    print str(response)
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    
    require 'rubygems'
    require 'plivo'
    
    include Plivo
    include Plivo::Exceptions
    
    api = RestClient.new("auth_id", "auth_token")
    
    begin
        response = api.messages.get('your_message_uuid').deleteMedia()
        puts response
       rescue PlivoRESTError => e
        puts 'Exception: ' + e.message
       End
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    
    let plivo = require('plivo');
    let client = new plivo.Client('auth_id', 'auth_token');
    
    let optionalParams = {};
    client.messages.get("your_message_uuid").then(function (message) {
      return client.messages.deleteMedia(message.messageUuid)
    })
    .then(function (result) {
      console.log("\n============ delete Media ===========\n", result)
    })
    .catch(function (response) {
      console.log("\n============ Error :: ===========\n", response);
    });
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    
    <?php
    require 'vendor/autoload.php';
    use Plivo\RestClient;
    
    $client = new RestClient("auth_id", "auth_token");
    
    $response = $client->messages->get('your_message_uuid')->deleteMedia();
    print_r($response);
    
    ?>
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    
    import java.io.IOException;
    import java.net.URL;
    import java.util.Collections;
    
    import com.plivo.api.Plivo;
    import com.plivo.api.exceptions.PlivoRestException;
    import com.plivo.api.models.message.Message;
    import com.plivo.api.models.message.MessageCreateResponse;
    
    public class Test {
        public static void main(String[] args) {
          Plivo.init("auth_id", "auth_token");
    
          try {
            Message.getter("message_uuid")
              .get().deleteMedia().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
    
    using System;
    using System.Collections.Generic;
    using Plivo;
    
    namespace PlivoExamples
    {
        internal class Program
        {
            public static void Main(string[] args)
            {
                var api = new PlivoApi("auth_id", "auth_token");
                var response = api.Message.Get("your_message_uuid").DeleteMedia();
                   Console.WriteLine(response);
            }
        }
    }    
    
    1
    2
    
    curl -i --user auth_id:auth_token \
        https://api.plivo.com/v1/Account/{auth_id}/Message/{message_uuid}/Media/
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    
    package main
    
    import "fmt"
    import "github.com/plivo/plivo-go"
    
    func main() {
    	client, err := plivo.NewClient("auth_id", "auth_token", &plivo.ClientOptions{})
    	if err != nil {
    		panic(err)
    	}
    	response, err := client.Messages.DeleteMedia("your_message_uuid")
    	if err != nil {
    		panic(err)
    	}
    	fmt.Printf("Response: %#v\n", response)
    }