Any Media [DELETE] method (DELETE)

Any Media [DELETE] method is used to delete files.

Additional Request Parameters.

  • media_id: unique identifier of the target file (in the request headline).

Request Examples.

Example of running the Any Media [DELETE] method in Postman:

Examples of DELETE request syntax using Any Media [DELETE] method with following parameters:

  • File ID “2d678796-933d-450e-b488-6dcf47011095”.

HTTP

Bash

Python

php

Java


DELETE /api/media/2d678796-933d-450e-accf-6dcf47011095 HTTP/1.1
Host: youradress.ru
X-Forensic-Access-Token: 0ccbdb4627c9d07c6c5b8f6e6cca44b5f8cb0c54ad7659098fa336240d494b0f9035e14bc42fc461224a9719f105e41026fed0f6f14188d9107b8c3d697a0cb1
User-Agent: PostmanRuntime/7.15.2
Accept: */*
Cache-Control: no-cache
Postman-Token: 1de873f7-2106-4718-b245-a431e11320f4,724a6653-c077-4435-8bca-cc189230f1e3
Host: youradress.ru
Accept-Encoding: gzip, deflate
Content-Length: 
Connection: keep-alive
cache-control: no-cache


curl -X DELETE \
  https://youradress.ru/api/media/2d678796-933d-450e-accf-6dcf47011095 \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Length: ' \
  -H 'Host: youradress.ru' \
  -H 'Postman-Token: 1de873f7-2106-4718-b245-a431e11320f4,d8f2adb1-533c-468c-880a-d586b8c47129' \
  -H 'User-Agent: PostmanRuntime/7.15.2' \
  -H 'X-Forensic-Access-Token: 0ccbdb4627c9d07c6c5b8f6e6cca44b5f8cb0c54ad7659098fa336240d494b0f9035e14bc42fc461224a9719f105e41026fed0f6f14188d9107b8c3d697a0cb1' \
  -H 'cache-control: no-cache'


import requests

url = "https://youradress.ru/api/media/2d678796-933d-450e-accf-6dcf47011095"

payload = ""
headers = {
    'X-Forensic-Access-Token': "0ccbdb4627c9d07c6c5b8f6e6cca44b5f8cb0c54ad7659098fa336240d494b0f9035e14bc42fc461224a9719f105e41026fed0f6f14188d9107b8c3d697a0cb1",
    'User-Agent': "PostmanRuntime/7.15.2",
    'Accept': "*/*",
    'Cache-Control': "no-cache",
    'Postman-Token': "1de873f7-2106-4718-b245-a431e11320f4,30278f93-a770-41e9-aef7-e7a10ba29da3",
    'Host': "youradress.ru",
    'Accept-Encoding': "gzip, deflate",
    'Content-Length': "",
    'Connection': "keep-alive",
    'cache-control': "no-cache"
    }

response = requests.request("DELETE", url, data=payload, headers=headers)

print(response.text)


setUrl('https://youradress.ru/api/media/2d678796-933d-450e-accf-6dcf47011095');
$request->setMethod(HTTP_METH_DELETE);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'Connection' => 'keep-alive',
  'Content-Length' => '',
  'Accept-Encoding' => 'gzip, deflate',
  'Host' => 'youradress.ru',
  'Postman-Token' => '1de873f7-2106-4718-b245-a431e11320f4,6e929780-f005-4272-b1d8-083ef8411e8a',
  'Cache-Control' => 'no-cache',
  'Accept' => '*/*',
  'User-Agent' => 'PostmanRuntime/7.15.2',
  'X-Forensic-Access-Token' => '0ccbdb4627c9d07c6c5b8f6e6cca44b5f8cb0c54ad7659098fa336240d494b0f9035e14bc42fc461224a9719f105e41026fed0f6f14188d9107b8c3d697a0cb1'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://youradress.ru/api/media/2d678796-933d-450e-accf-6dcf47011095")
  .delete(null)
  .addHeader("X-Forensic-Access-Token", "0ccbdb4627c9d07c6c5b8f6e6cca44b5f8cb0c54ad7659098fa336240d494b0f9035e14bc42fc461224a9719f105e41026fed0f6f14188d9107b8c3d697a0cb1")
  .addHeader("User-Agent", "PostmanRuntime/7.15.2")
  .addHeader("Accept", "*/*")
  .addHeader("Cache-Control", "no-cache")
  .addHeader("Postman-Token", "1de873f7-2106-4718-b245-a431e11320f4,9c786c5e-9c06-4823-9d64-8e54426a3e2f")
  .addHeader("Host", "youradress.ru")
  .addHeader("Accept-Encoding", "gzip, deflate")
  .addHeader("Content-Length", "")
  .addHeader("Connection", "keep-alive")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();

An empty JSON response is returned after a successful accomplishment of the method.