Uploading from a remote URL that requires an auth token
Hi,
Is it possible to upload an image from a remote url that requires an auth token to access? I'm using the node SDK, and I don't see anything in the docs about doing this.
I do see an old post about this here: https://support.cloudinary.com/hc/en-us/articles/360021298511-Using-the-Authorization-header
But it doesn't seem to align with the current api/source in the cloudinary 1.4.1 package.
Anyways, is this possible? The use case is needing to grab an image from the whatsapp media API, which is only available at a url behind a token.
Answers
-
Hi there,
Thanks for reaching out.
Passing the
headers
parameter in your upload call is the correct way to go about this. You can reference the documentation here:
https://cloudinary.com/documentation/image_upload_api_reference#upload_optional_parameters:~:text=update script.-,headers,-StringPlease give that a try and let us know if you have questions.
Kind regards,
Tia
Helpful Links For You
💬 Share questions, connect with other users in our Cloudinary Community forums and Discord server!
🧑🎓 Join our Cloudinary Academy for free courses, workshops and other educational resources.
📄 Read our documentation for in-depth details on Cloudinary product features and capabilities
📰 Check out the Cloudinary blog for the latest company news and insights0