Deleting video with XMLHTTP request?
So we are using XMLHTTP POST request to upload videos to Cloudinary.
Is it possible to use XMLHTTP to delete videos from Cloudinary too?
Thank you in advance!
-
Hi Pavel,
You can do a delete request but delete also requires account's API secret which should not be revealed on client-side. If you have a backend where you can add the API key and secret and just pass the other information from client-side then that should work.
You can test by this curl command:
curl -X DELETE ‘https://<api_key>:<api_secret>@api.cloudinary.com/v1_1/<cloud_name>/resources/image/upload?public_ids[]=<public_id>’
Thanks,
Aditi0 -
Hi Aditi,
Thank you kindly for the response.
So would it look something like this:
xmlhttprequest.open("DELETE", `https://<our api key>:<our api secret>@api.cloudinary.com/v1_1/<our cloud name>/resources/image/upload?public_ids[ ]=<public ID of the video to be deleted>`);
Do I understand you correctly? And the 'image' in the link should still be there even if it is a video?
0 -
Hi Pavel,
You should indeed change the image to video in cases where you're deleting a video.
0
Post is closed for comments.
Comments
3 comments