Friday, 15 February 2013

How do I get a list of my images from cloudinary from client-side JavaScript? -



How do I get a list of my images from cloudinary from client-side JavaScript? -

using cloudinary api can list of images getting next url:

https://api_key:api_secret@api.cloudinary.com/v1_1/cloud_name/resources/image/upload

however, using client-side javascript expose account's api key , secret.

it seems getting list of images should possible without exposing account's credentials.

i've looked @ cloudinary angularjs client, has sample project implements slideshow of photos in account. can tell, project uses next line list of photos in cloudinary account

var url = $.cloudinary.url('myphotoalbum', {format: 'json', type: 'list'});

but can't phone call homecoming anything.

the cloudinary jquery documentation not describe syntax $.cloudinary.url(); resource i've found on cloudinary jquery github page, states that

$.cloudinary.url(public_id, options) // returns cloudinary url based on over configuration , given options.

what public_id? options?

browsing through of resources indeed require using secured admin api. indeed requires using api_secret should not revealed in client-side code. however, cloudinary supports returning list of images/raw-files sharing tag. response json snippet automatically updated , cached 1 hr @ cdn.

the cloudinary.url api generates url of specified parameters. when using:

var url = $.cloudinary.url('myphotoalbum', {format: 'json', type: 'list'});

this generates cloudinary url, following:

http://res.cloudinary.com/<your_cloud_name>/image/list/myphotoalbum.json

this url returns json of resources in business relationship sharing 'myphotoalbum' tag.

javascript cloudinary

No comments:

Post a Comment