How do I retrieve contextual metadata programmatically?
Answers
-
Hi rlux, I managed to solve the problem myself.
The call I was looking for was
const alt_text = await cloudinary.api.resources_by_ids( imageId, {context:true} )
.then(metadata=> metadata.resources[0].context.custom.image_alt_text)
.catch(err=>{console.log({err}); )
Is there a complete list of options and what values they accept anywhere?
0 -
Looping in @JackieDoc for some input on this.
0 -
@SMW - Hi. Just noticed I was tagged here, so delayed response, but maybe still helpful? 🙏
You can find all the details of our Admin API, including syntax, descriptions of all available params, and code examples for all SDKs, here: https://cloudinary.com/documentation/admin_api
FYI - In addition to the totally valid solution you came up with for your requirement, there's also this helper method in SDKs that might be more convenient:
https://cloudinary.com/documentation/admin_api#get_resources_by_context
Hope this will be helpful going forward!
0