Deleting an image from a group using rest api


#1

Right now all I want to do is be able to delete an image that got uploaded during a group upload but keep getting 404. Is this the wrong format of the UUID? everything works fine with single files, but cannot delete anything using group. I have also tried removing the /nth/0/ bit and a few other variations but no luck.

  axios({
    method: 'delete',
    url: `https://api.uploadcare.com/files/e4bb0b7a-9667-4164-9f55-d1c3e2e4447d~1/nth/0/`,
    headers: {
      Authorization: `Uploadcare.Simple ${publicKey}:${secretKey}`,
    },
  })

#2

@jamesvitaly1993

It seems you contacted us via help@uploadcare.com as well, and I’ve already answered your question, but anyway I’ll leave the answer here.

The nth operator is used to get individual files from a group without using actual UUIDs of those. In order to copy/remove a file, you need to use its “real” UUID which you can get with an Upload API request
Getting File Group Info

or with a REST API request
Accessing File Groups via REST API

or with JS API of the widget on uploading
https://codepen.io/optlsnd/pen/vjbaMe