List All Collections in a Repository
get
/content/management/api/v1.1/repositories/{id}/collections
List all collections in a repository.
Request
Path Parameters
-
id: string
Repository id parameter for collections.
Query Parameters
-
fields(optional): string
This parameter is used to control the returned fields in each collection in the list. This parameter accepts a comma-separated list of field names or all. These fields will be returned for each collection in the list. All the field names are case-sensitive,and users must provide the correct field names in the query. Each collection has both standard fields (id, name, description, createdBy, createdDate, updatedBy, updatedDate) and additional fields (repository, channels). When fields is specified as all (case-insensitive), all the standard and additional fields are returned. The standard fields are always returned in the response and cannot be filtered out. The user can filter out only the additional fields. This parameter is optional in the query, and by default the result shows only standard fields in the response. Any incorrect or invalid field name given in the query will throw an error.
Example: ?fields=channels
This returns all standard fields along with the channels additional fields for each collection.
Example: ?fields=all
This will return all standard fields and all additional fields for each collection.
-
limit(optional): integer(int32)
This parameter accepts a non negative integer and is used to control the size of the result.Default Value:
100
-
links(optional): string
This parameter accepts a comma-separated list of link names. By default, this parameter gives all the links applicable. Possible values are: self, canonical, describedby, first, last, prev, next
-
offset(optional): integer(int32)
This parameter accepts a non negative integer and is used to control the start index of the result.Default Value:
0
-
orderBy(optional): string
This parameter is used to control the order of results. The value of this query parameter follows the format of fieldName:[asc/desc]. asc stands for ascending order desc stands for descending order, and the default order is asc. The only field names allowed are name and updatedDate.Default Value:
name:asc
-
q(optional): string
This parameter accepts a query expression condition that matches the field values. The value of query condition follows the format of {fieldName} {operator} "{fieldValue}". The only fieldNames allowed for now are roleName, repositoryId and name and only allowed operators for now are mt on name and eq on the others. This query param is optional and defaults to roleName eq "viewer" which filters the resources with at least given role.
Example:
?q=(roleName eq "manager")Default Value:roleName eq "viewer"
-
roleName(optional): string
This parameter is used to filter the returned collections with the given role name.Default Value:
viewer
Allowed Values:[ "viewer", "contributor", "manager" ]
-
totalResults(optional): boolean
This parameter accepts a boolean flag. If specified as true, then the returned result must include the total result count.Default Value:
false
Response
Supported Media Types
- application/json
200 Response
OK.
Root Schema : Collections
Type:
object
Collections
Show Source
-
aggregationResults(optional):
array aggregationResults
Aggregation results.
-
count(optional):
integer(int32)
Total number of records in the current response.
-
hasMore(optional):
boolean
Check whether there are more pages to fetch.
-
items(optional):
array items
Singular resources contained in the collection.
-
limit(optional):
integer(int32)
Actual page size used by the server. This might not be the same as what the client requests.
-
links(optional):
array links
Links of the resource.
-
offset(optional):
integer(int32)
The actual index from which the singular resources are returned.
-
pinned(optional):
array pinned
Pinned items. Shows items pinned at the top of search list
-
scrollId(optional):
string
scrollId if the search resolved to a scroll search.
-
totalResults(optional):
integer(int32)
Total number of rows that satisfy the client request (excluding the paging parameters.)
Nested Schema : items
Type:
array
Singular resources contained in the collection.
Show Source
-
Array of:
object Collection
Collection
Nested Schema : links
Type:
array
Links of the resource.
Show Source
-
Array of:
object Link
Link of the resource.
Nested Schema : pinned
Type:
array
Pinned items. Shows items pinned at the top of search list
Show Source
Nested Schema : Collection
Type:
object
Collection
Show Source
-
channels(optional):
array channels
Channels associated with the collection.
-
createdBy(optional):
string
createdBy user of the Collection.
-
createdDate(optional):
object date
date
-
description(optional):
string
Description of the collection.
-
id(optional):
string
id of the collection. It is a required property in the get response and put request whereas it is not required in the post request.
-
isDynamic(optional):
boolean
true
-
links(optional):
array links
Links
-
name(optional):
string
Name of the collection. It is a required property in the get response and post/put request.
-
repository(optional):
object RepositoryIdentifier
RepositoryIdentifier
-
roleName(optional):
string
Name of the user's role on the collection.
-
ruleGroups(optional):
array ruleGroups
-
updatedBy(optional):
string
updatedBy user of the Collection.
-
updatedDate(optional):
object date
date
Nested Schema : channels
Type:
array
Channels associated with the collection.
Show Source
-
Array of:
object ChannelInCollections
ChannelInCollections
Nested Schema : RepositoryIdentifier
Type:
object
RepositoryIdentifier
Show Source
-
id(optional):
string
id of the collection repository. It is a required property in the get response.
-
name(optional):
string
Name of the collection repository. It is a required property in the get response.
-
role(optional):
string
Role on the collection repository.
Nested Schema : ChannelInCollections
Type:
object
ChannelInCollections
Show Source
-
id(optional):
string
id of the channel.
-
name(optional):
string
Name of the channel.
Nested Schema : Link
Type:
object
Link of the resource.
Show Source
-
href(optional):
string
The target resource's URI. It could be template URI. It is a required property in the get response.
-
mediaType(optional):
string
Media type.
-
method(optional):
string
What HTTP method can be used to access the target resource.
-
profile(optional):
string
Link to the metadata that describes the target resource.
-
rel(optional):
string
Relation type. It is a required property in the get response.
-
templated(optional):
boolean
Whether the URI is a template.
Nested Schema : RuleGroup
Type:
object
rule group definition
Show Source
-
assetType(optional):
string
asset type associated with the rule group, all rules within the rule group are based on properties related to this asset typeExample:
File
-
conjunction(optional):
string
the operator to be used while joining this rule group with a previous groupExample:
OR
-
ruleSet(optional):
array ruleSet
set of rules associated with the rule group
Nested Schema : ruleSet
Type:
array
set of rules associated with the rule group
Show Source
-
Array of:
object RuleSet
Set of rules or conditions
Nested Schema : RuleSet
Type:
object
Set of rules or conditions
Show Source
-
conjunction(optional):
string
The operator to be used when combining this rule set with an existing rule setExample:
and
-
rule(optional):
object Rule
-
ruleSet(optional):
array ruleSet
The child or sub rule set associated with the given rule set
Nested Schema : ruleSet
Type:
array
The child or sub rule set associated with the given rule set
Show Source
-
Array of:
object RuleSet
Set of rules or conditions
304 Response
Not modified.
400 Response
Bad request.
403 Response
Forbidden.
404 Response
Not found.
500 Response
Internal server error.
Examples
The following example shows published Digital assets native file by submitting a GET request on the REST resource using cURL:
curl -X GET -H 'Accept: application/json' 'https://host:port/content/management/api/v1.1/repositories/{id}/collections'
Example 1:
This lists all collections exists in a repository with id: F264EF72737B35991E381047D5B43D87656640771B3C, order by field-name name in descending order.
/content/management/api/v1.1/repositories/F264EF72737B35991E381047D5B43D87656640771B3C/collections?orderBy=name:desc
Response Body
{ "hasMore": false, "offset": 0, "count": 2, "limit": 2, "items": [{ "id": "OB19FE8746BD86E83DA44EF1FA5ED83E361FEC1D24C4", "name": "collection2", "description": "", "createdBy": "marketing.user", "createdDate": { "value": "2018-12-13T10:01:17.054Z", "timezone": "UTC" }, "updatedBy": "marketing.user", "updatedDate": { "value": "2018-12-13T10:01:17.054Z", "timezone": "UTC" }, "links": [{ "href": "https://host:port/content/management/api/v1.1/repositories/F264EF72737B35991E381047D5B43D87656640771B3C/collections/OB19FE8746BD86E83DA44EF1FA5ED83E361FEC1D24C4", "rel": "self", "method": "GET", "mediaType": "application/json" } ] }, { "id": "O6912875370B2BE96EEA1AC678D08D4359DF5BC30363", "name": "collection1", "description": "", "createdBy": "marketing.user", "createdDate": { "value": "2018-12-10T06:58:55.935Z", "timezone": "UTC" }, "updatedBy": "marketing.user", "updatedDate": { "value": "2018-12-10T06:58:55.935Z", "timezone": "UTC" }, "links": [{ "href": "https://host:port/content/management/api/v1.1/repositories/F264EF72737B35991E381047D5B43D87656640771B3C/collections/O6912875370B2BE96EEA1AC678D08D4359DF5BC30363", "rel": "self", "method": "GET", "mediaType": "application/json" } ] } ], "links": [{ "href": "https://host:port/content/management/api/v1.1/repositories/F264EF72737B35991E381047D5B43D87656640771B3C/collections?orderBy=name:desc", "rel": "self", "method": "GET", "mediaType": "application/json" }, { "href": "https://host:port/content/management/api/v1.1/repositories/F264EF72737B35991E381047D5B43D87656640771B3C/collections?orderBy=name:desc", "rel": "canonical", "method": "GET", "mediaType": "application/json" }, { "href": "https://host:port/content/management/api/v1.1/metadata-catalog/repositories/F264EF72737B35991E381047D5B43D87656640771B3C/collections", "rel": "describedby", "method": "GET", "mediaType": "application/schema+json" }, { "href": "https://host:port/content/management/api/v1.1/repositories/F264EF72737B35991E381047D5B43D87656640771B3C/collections?offset=0&orderBy=name:desc", "rel": "first", "method": "GET", "mediaType": "application/json" }, { "href": "https://host:port/content/management/api/v1.1/repositories/F264EF72737B35991E381047D5B43D87656640771B3C/collections?offset=0&orderBy=name:desc", "rel": "last", "method": "GET", "mediaType": "application/json" } ] }
Example 2:
This lists first 2 collections, start index from 1, role as manager, exists in a repository with id:F264EF72737B35991E381047D5B43D87656640771B3C, order by field-name name in descending order, including totalResults and all fields examples, such as channels, repositories in response.
/content/management/api/v1.1/repositories/F264EF72737B35991E381047D5B43D87656640771B3C/collections?limit=1&offset=1&totalResults=true&orderBy=name:desc&fields=all&roleName=manager
Response Body
{ "hasMore": true, "offset": 1, "count": 2, "limit": 4, "totalResults": 4, "items": [{ "id": "O8BDF919B2A16305DC4FE1E5059C53173092B7A2B7A6", "repository": { "id": "F264EF72737B35991E381047D5B43D87656640771B3C", "name": "repository4", "role": "manager" }, "name": "collection3", "description": "", "createdBy": "marketing.user", "createdDate": { "value": "2018-12-13T10:31:24.892Z", "timezone": "UTC" }, "updatedBy": "marketing.user", "updatedDate": { "value": "2018-12-13T10:31:24.892Z", "timezone": "UTC" }, "channels": [], "links": [{ "href": "https://host:port/content/management/api/v1.1/repositories/F264EF72737B35991E381047D5B43D87656640771B3C/collections/O8BDF919B2A16305DC4FE1E5059C53173092B7A2B7A6", "rel": "self", "method": "GET", "mediaType": "application/json" } ] }, { "id": "OB19FE8746BD86E83DA44EF1FA5ED83E361FEC1D24C4", "repository": { "id": "F264EF72737B35991E381047D5B43D87656640771B3C", "name": "repository4", "role": "manager" }, "name": "collection2", "description": "", "createdBy": "marketing.user", "createdDate": { "value": "2018-12-13T10:01:17.054Z", "timezone": "UTC" }, "updatedBy": "marketing.user", "updatedDate": { "value": "2018-12-13T10:01:17.054Z", "timezone": "UTC" }, "channels": [], "links": [{ "href": "https://host:port/content/management/api/v1.1/repositories/F264EF72737B35991E381047D5B43D87656640771B3C/collections/OB19FE8746BD86E83DA44EF1FA5ED83E361FEC1D24C4", "rel": "self", "method": "GET", "mediaType": "application/json" } ] } ], "links": [{ "href": "https://host:port/content/management/api/v1.1/repositories/F264EF72737B35991E381047D5B43D87656640771B3C/collections?totalResults=true&offset=1&limit=2&roleName=manager&orderBy=name:desc&fields=all", "rel": "self", "method": "GET", "mediaType": "application/json" }, { "href": "https://host:port/content/management/api/v1.1/repositories/F264EF72737B35991E381047D5B43D87656640771B3C/collections?totalResults=true&offset=1&limit=2&roleName=manager&orderBy=name:desc&fields=all", "rel": "canonical", "method": "GET", "mediaType": "application/json" }, { "href": "https://host:port/content/management/api/v1.1/metadata-catalog/repositories/F264EF72737B35991E381047D5B43D87656640771B3C/collections", "rel": "describedby", "method": "GET", "mediaType": "application/schema+json" }, { "href": "https://host:port/content/management/api/v1.1/repositories/F264EF72737B35991E381047D5B43D87656640771B3C/collections?totalResults=true&offset=0&limit=2&roleName=manager&orderBy=name:desc&fields=all", "rel": "prev", "method": "GET", "mediaType": "application/json" }, { "href": "https://host:port/content/management/api/v1.1/repositories/F264EF72737B35991E381047D5B43D87656640771B3C/collections?totalResults=true&offset=3&limit=2&roleName=manager&orderBy=name:desc&fields=all", "rel": "next", "method": "GET", "mediaType": "application/json" }, { "href": "https://host:port/content/management/api/v1.1/repositories/F264EF72737B35991E381047D5B43D87656640771B3C/collections?totalResults=true&offset=0&limit=2&roleName=manager&orderBy=name:desc&fields=all", "rel": "first", "method": "GET", "mediaType": "application/json" }, { "href": "https://host:port/content/management/api/v1.1/repositories/F264EF72737B35991E381047D5B43D87656640771B3C/collections?totalResults=true&offset=3&limit=2&roleName=manager&orderBy=name:desc&fields=all", "rel": "last", "method": "GET", "mediaType": "application/json" } ] }