Create a Collection
post
/content/management/api/v1.1/repositories/{id}/collections
Creates a collection with the given payload.
Request
Supported Media Types
- application/json
Path Parameters
-
id: string
Repository id parameter for collections.
Query Parameters
-
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
Header Parameters
-
X-Requested-With: string
A custom header to mitigate CSRF attacks.Allowed Values:
[ "XMLHttpRequest" ]
Creates a collection with the given information in the payload. The fields id, createdBy, createdDate, updatedBy, updatedDate and links will be ignored even if given in the payload.
Root 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
Response
Supported Media Types
- application/json
201 Response
Created.
Root 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
400 Response
Bad request.
403 Response
Forbidden.
404 Response
Not found.
409 Response
Conflict.
500 Response
Internal server error.
Examples
The following example shows how to create a new collection by submitting a POST request on the REST resource using cURL.
curl -X POST -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' 'https://host:port/content/management/api/v1.1/repositories/{id}/collections'
Example:
This creates a simple collection with name, description and a list of channels in an existing repository. Where F264EF72737B35991E381047D5B43D87656640771B3C is id of existing repository and CCB59F44D5015819EBC0F86A2B3133B22638AF433F1E, CCB70F44D5015819EBC0F86A2B3133B22638AF123V8A are id's of existing channel associated to the repository. Replace payload with your own data.
/content/management/api/v1.1/repositories/{id}/collections
Request Body
{ "name": "Collection2", "description": "Collection2 description.", "channels": [ { "id": "CCB59F44D5015819EBC0F86A2B3133B22638AF433F1E" }, { "id": "CCB70F44D5015819EBC0F86A2B3133B22638AF123V8A" } ] }