Remove Media File

Deletes a media file from Bandwidth API server. Make sure you don't have any application scripts still using the media before you delete. If you accidentally delete a media file, you can immediately upload a new file with the same name.

Request URL

DELETEhttps://messaging.bandwidth.com/api/v2/users/{accountId}/media/{mediaName}

Basic Authentication

Bandwidth's Messaging API leverages Basic Authentication with your API user's username and password. Read more about how Bandwidth secures endpoints in the Security & Credentials document.

Example 1 of 1: Delete an MP3 File

curl -X DELETE \
    --url 'https://messaging.bandwidth.com/api/v2/users/{accountId}/media/{mediaName}' \
    -u '{username}:{password}'
msgClient.DeleteMedia(MSG_ACCOUNT_ID, mediaId);
messagingClient.deleteMedia(MESSAGING_ACCOUNT_ID, "mediaId");
messaging_client.delete_media(MESSAGING_ACCOUNT_ID, "mediaId")
messaging_client.delete_media(MESSAGING_ACCOUNT_ID, "mediaId")
import { Client, ApiController } from '@bandwidth/messaging';

const client = new Client({
  basicAuthUserName: 'username',
  basicAuthPassword: 'password'
});

const controller = new ApiController(client);

const accountId = '1111111';
const mediaId = 'abc12345-6def-abc1-2345-6defabc12345/1/1.mp3';

const response = await controller.deleteMedia(accountId, mediaId);
$messagingClient->deleteMedia($messagingAccountId, "mediaId");

results matching ""

    No results matching ""