Skip to main content

Deleting video with XMLHTTP request?

Comments

3 comments

  • Aditi Madan

    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,
    Aditi

    0
  • Pavel Liser

    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
  • Raya Straus

    Hi Pavel,

    You should indeed change the image to video in cases where you're deleting a video. 

     

    0

Post is closed for comments.