How can I list all of my existing folders and subfolders?

Follow

Comments

8 comments

  • Avatar
    Michael Hodson

    So, I'm trying to test this using the direct API as per the example above.

    For the signature hash, since there are no other parameters:

    timestamp=1529697857abcd (abcd is the api_secret value)

    I generate the hash and add it to call

    https://api.cloudinary.com/v1_1/my_cloud_name/folders?api_key=1234&timestamp=1529697857&signature=4b569a0f8322b3a285296b3b8c2908c2a1cb1937

    A dialog pops up "Authentication Required" / User Name: / Password: / OK

    Clear the dialog and JSON return says:

    {"error":{"message":"Invalid credentials"}}

    What am I missing?

     

     

     

     

    0
    Comment actions Permalink
  • Avatar
    Aditi Madan

    Hi Michael,

    What was the  Username/Password you provided in the dialog box? Username here should be the API key and password should be the API secret.

    Thanks,
    Aditi

    0
    Comment actions Permalink
  • Avatar
    Jim Klymus

    Why is something as simple as listing the names of the files and folders soooo 1980's-ish?? You have to use something so cumbersome as an API just to LIST the filenames and folders of your media assets? And isn't there some limit to the max number of results you can get back? Something like 500 or so?

    Why is it impossible to put this functionality in the main user interface? Nice and simple.

    0
    Comment actions Permalink
  • Avatar
    Victor Li

    Hi Jim,

    I do see your point here! I've opened up a feature request for this, and our internal team will evaluate it against their other projects and we will update you if or when there is going to be an implementation of this.

    Thanks,
    Victor

    1
    Comment actions Permalink
  • Avatar
    M.Albiero

    Hello,

    I tried the tutorial above and all I can do is get a list of first level folders only.

    I want to list all the folders and corresponding subfolders with a single API call.

    Is it possible?

    Thank you

    1
    Comment actions Permalink
  • Avatar
    Erwin Lukas

    Hi M.Albiero,

    Unfortunately currently at this point it's not possible to have a single API call to list all the subfolders recursively.

    Thanks,
    Erwin Lukas

    0
    Comment actions Permalink
  • Avatar
    Danish

    how can i get the whole folder of the images from the cloudinary. Because if i make to request multiple time  to get the image that wont be a good practice.

    0
    Comment actions Permalink
  • Avatar
    Wissam Khalili

    Hi Danish,

    You could use the following feature client side asset list to get a JSON list containing the image metadata list.

    To use this option, you will need to add a common tag to the images you need.

    For loading a large number of assets at once for use in your application, we recommend making an API call from your server-side code periodically and caching/storing the result on your side - for this example, the equivalent API method would be the get_resources method of the Admin API, which can return up to 500 results in each call (make sure to add max_results=500), and supports pagination to allow you to request more than 500 results by making multiple calls: https://cloudinary.com/documentation/admin_api#get_resources

    You will need to add the parameter prefix to specify the folder name.

    For example, here is a GET request to get the first 500 images from the folder called "sample"

    https://<API_KEY>:<API_SECRET>@api.cloudinary.com/v1_1/<cloud_name>/resources/image/upload?prefix=sample&max_results=500

    If you have more than 500 images in this folder, in the response, you will get another filed at the end called next_cursor.

    You could do another API call with this parameter to get the next 500 and so on.

    https://<API_KEY>:<API_SECRET>@api.cloudinary.com/v1_1/<cloud_name>/resources/image/upload?prefix=sample&max_results=500&next_cursor=<NEXT_CURSOR>

    Thanks,

    Wissam

    0
    Comment actions Permalink

Please sign in to leave a comment.