Cloudinary's powerful Admin-API supports listing of resources older than a predefined date by providing a matching start_at
parameter.
Values for this parameter should be provided in a Date & Time representation.
Below are few examples:
PHP:
> (new DateTime(201505200730))->format(DateTime::ISO8601)
Rails:
> Time.new(2015,05,20,07,30)
Java:
> new java.util.Date()
NodeJS:
> new Date("May 20, 2015 07:30:00")
The next resources()
API call (Rails) will collect only, and upto 500 resources which were created earlier than May 20th, 2015:
> Cloudinary::Api.resources(start_at:Time.new(2015,05,20), max_results:500)
If you wish to list resources newer than a specific date, this is done by setting the `direction` parameter to "asc", e.g.:
> Cloudinary::Api.resources(start_at:Time.new(2015,05,20), direction:"asc", max_results:500)
Note that pagination might be essential in order to collect all matching resources.
When there are still more resources to go through, the next_cursor
value is returned as part of the response. You can then specify this value as the next_cursor
parameter of the following call. This way you can go through the full list of your resources.
For more information, see: http://support.cloudinary.com/hc/en-us/articles/205714121-How-do-I-browse-through-all-resources-in-my-account-using-the-API-
Comments
2 comments
Is there a opposite of start_at? I want to list all the images that are created after a specific date?
This can be done by setting the `direction` parameter to `asc`, as mentioned above.
Please sign in to leave a comment.