Delete a media object
Use this endpoint for the Media method to delete a media instance from your Project so it no longer appears in the Dashboard or on the API.
Parameters
Parameter |
---|
No Parameters |
Request
In this example, we will delete a media instance from your Project so it no longer appears in the Dashboard or on the API.
- cURL
- Node.js
- C#
- Python
- Ruby
curl https://example.signalwire.com/api/laml/2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}/Media/{MediaSid}.json \
-X DELETE \
-u "YourProjectID:YourAuthToken"
const { RestClient } = require('@signalwire/compatibility-api')
const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
client.messages('MessageSid')
.media('MediaSid')
.remove()
.then(media => console.log(media.sid))
.done();
using System;
using System.Collections.Generic;
using Twilio;
using Twilio.Rest.Api.V2010.Account.Message;
class Program
{
static void Main(string[] args)
{
TwilioClient.Init("YourProjectID", "YourAuthToken", new Dictionary<string, object> { ["signalwireSpaceUrl"] = "{SPACE}.signalwire.com" });
MediaResource.Delete(
pathMessageSid: "MessageSid",
pathSid: "MediaSid"
);
}
}
from signalwire.rest import Client as signalwire_client
client = signalwire_client("YourProjectID", "YourAuthToken", signalwire_space_url = 'example.signalwire.com')
client.messages('MessageSid') \
.media('MediaSid') \
.delete()
require 'signalwire/sdk'
@client = Signalwire::REST::Client.new 'YourProjectID', 'YourAuthToken', signalwire_space_url: "example.signalwire.com"
@client.messages('MessageSid')
.media('MediaSid')
.delete
Responses
204 NO CONTENT
A 204 No Content
response indicates the Media object was successfully deleted.