Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

See https://crossmedia.atlassian.net/wiki/spaces/WD/pages/2208301069/Delete+data#Delete-a-resource

The end point is the same as for deleting a single instance. Instead of the identifier of the resource to be deleted, we indicate the list of identifiers of the resources to be deleted, separated by commas.

It is also possible to specify a query.

The maximum number of resources that can be deleted in one call is managed by the max parameter, which works in exactly the same way as for a GET :

  • the default value is 50

  • if you specify a value as a parameter, it defines the limit (e.g. max=100 limits the maximum number of resources that can be deleted to 100)

  • a value greater than 200 cannot be specified: if the parameter value is greater than 200, a maximum of 200 resources will be deleted

Examples

With identifiers

DELETE https://club-wed.wedia-group.com/api/rest/dam/data/asset/4,5,6

Deletes ID assets 4, 5 and 6.

With uniqidentifiers

You can specify unique identifiers.

DELETE https://club-wed.wedia-group.com/api/rest/dam/data/asset/78j1ko1ds3my1,8ges4hm9qkm3w,3gr11uwby8mo6

Delete ID assets 78j1ko1ds3my1, 8ges4hm9qkm3w and 3gr11uwby8mo6.

With query

You can specify a query

DELETE https://club-wed.wedia-group.com/api/rest/dam/data/asset?query={status: archived}

This request will delete all assets with archived status.

Code examples (with identifiers)

HTTP

DELETE /api/rest/dam/data/asset/78j1ko1ds3my1,8ges4hm9qkm3w,3gr11uwby8mo6 HTTP/1.1
Authorization: Basic ZGVtbzpkZW1vcHdk
Host: club-wed.wedia-group.com

cURL

curl --request DELETE 
  --url 'https://club-wed.wedia-group.com/api/rest/dam/data/asset/78j1ko1ds3my1,8ges4hm9qkm3w,3gr11uwby8mo6'
  --header 'Authorization: Basic ZGVtbzpkZW1vcHdk'

JavaScript/fetch

fetch("https://club-wed.wedia-group.com/api/rest/dam/data/asset/78j1ko1ds3my1,8ges4hm9qkm3w,3gr11uwby8mo6", {
  "method": "DELETE",
  "headers": {
    "Authorization": "Basic ZGVtbzpkZW1vcHdk"
  }
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});

JavaScript/XMLHttpRequest

const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://club-wed.wedia-group.com/api/rest/dam/data/asset/78j1ko1ds3my1,8ges4hm9qkm3w,3gr11uwby8mo6");
xhr.setRequestHeader("Authorization", "Basic ZGVtbzpkZW1vcHdk");

xhr.send(data);

Java/Unirest (Basic)

HttpResponse<String> response = Unirest.delete("https://club-wed.wedia-group.com/api/rest/dam/data/asset/78j1ko1ds3my1,8ges4hm9qkm3w,3gr11uwby8mo6")
  .header("Authorization", "BasicZGVtbzpkZW1vcHdk ")
  .asString();

Python/Request

import requests

url = "https://club-wed.wedia-group.com/api/rest/dam/data/asset/78j1ko1ds3my1,8ges4hm9qkm3w,3gr11uwby8mo6"

payload = ""
headers = {
    "Authorization": "Basic ZGVtbzpkZW1vcHdk"
}

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

print(response.text)

  • No labels