Sorry, no results found for "".
To retrieve a collection of uploads, send a GET request to the /uploads
endpoint. The collection is paginated, so make sure to iterate over all the pages if you need every record in the collection!
The following table contains the list of all the possible arguments, along with their type, description and examples values.
Pro tip: in case of any doubts you can always inspect the network calls that the CMS interface is doing, as it's using the Content Management API as well!
Attributes to filter uploads
IDs to fetch, comma separated
"12,31"
Textual query to match. If locale
is defined, search within that locale. Otherwise environment's main locale will be used.
"foobar"
Same as GraphQL API uploads filters. Use snake_case for fields names. If locale
is defined, search within that locale. Otherwise environment's main locale will be used.
{ type: { eq: "image" }, size: { gt: 5000000 } }
When filter[query]
or field[fields]
is defined, filter by this locale. Default: environment's main locale
"it"
Fields used to order results. Format: <field_name>_<DIRECTION(ASC|DESC)>
. You can pass multiple comma separated rules.
"_created_at_DESC,size_ASC"
Parameters to control offset-based pagination
The (zero-based) offset of the first entity returned in the collection (defaults to 0)
200
The maximum number of entities to return (defaults to 30, maximum is 500)
Returns an array of resource objects of type upload
The client.uploads.list()
method returns a single page of records, while if you need to iterate over every resource in the collection (and not just the first page of results), you can use the client.uploads.listPagedIterator()
method with an async iteration statement, which automatically handles pagination for you.
All the details on how to use list()
and listPagedIterator()
are outlined on this page.
You can retrieve a list of uploads filtered by a set of conditions. There are different options and you can combine multiple filters together.
In this example we are filtering by type and size. In particular, we are searching for images bigger than 5MB.
The filtering options are the same as the GraphQL API uploads filters. So please check there all the options.