In general, our APIs deal with image as the default `resource_type` including our Admin API delete and Upload API destroy methods.
That is why when trying to delete resources of another type (i.e. `video` or `raw`), the resource_type
parameter must be included.
Deleting videos using the Admin API in NodeJS
cloudinary.v2.api
.delete_resources(['video1', 'video2'], { resource_type: 'video'})
.then(result=>console.log(result));
Deleting a video using the Upload API in NodeJS
cloudinary.v2.uploader
.destroy('video1', {resource_type: 'video'})
.then(result => console.log(result))
Deleting raw assets using the Admin API in NodeJS
cloudinary.v2.api
.delete_resources(['raw_asset1', 'raw_asset2'], { resource_type: 'raw'})
.then(result=>console.log(result));
Deleting a raw asset using the Upload API in NodeJS
cloudinary.v2.uploader
.destroy('raw_asset1', {resource_type: 'raw'})
.then(result => console.log(result))
Comments
2 comments
The callback should be the last parameter shouldn't it?
Hi Isaak,
The callback is the last parameter in the 'v2' methods in the SDK, but the methods without 'v2' still support the older convention, which has the callback earlier. This was changed due to what you said, the callback being the last parameters as a common Node convention, but both are supported depending on which version of the method you use.
If you use cloudinary.v2.api.delete_resources, the callback is the last parameter.
Thanks,
Stephen
Please sign in to leave a comment.