Get the collection asset and its evalauted results by ID
Important Note: It is a Collection Resource. All the evaluated results for the given collection asset are available in an items array in response. Each result is again an aggregated asset. So all the aggregate asset query params (assetDepth, expand, fields, segments, profileName) are also applicable to this resource. These aggregate asset query params are applied to each result in the items array. To know more about an aggregate asset and its query params, refer to Asset Resource end point.
The following tables summarize the client request.
Name | Description | Format |
---|---|---|
assetId | ID of the collection asset | integer double |
collectionAssetType | Name of the collection asset type | string |
siteName | Name of the site | string |
Name | Description | Format |
---|---|---|
assetDepth | To know about this parameter, refer to the 'assetDepth' query param in Asset Resource end point. Applicable to each result in the items array. | number |
expand | Accepts a comma-separated list of assetTypes. To know more about this parameter, refer to the 'expand' query param in Asset Resource end point. Applicable to each result in the items array. | string |
fields | To know about this parameter, refer to the 'fields' query param in Asset Resource end point. Applicable to each result in the items array. | string |
limit | Specify the total number of items to be returned. | number |
links | Accepts a comma-separated list of link names. By default, this parameter gives all the links (next, prev, first, last, schema, self, and canonical resources). | string |
offset | Specify the starting index from where the results will be returned. | number |
profileName | To know about this parameter, refer to the 'profileName' query param in Asset Resource. Applicable to each result in the items array. | string |
segments | To know about this refer to the 'segments' query param in Asset Resource. Applicable to each result in the items array. | string |
totalResults | Accepts a Boolean value. Setting it to true displays the total results field in the response. The default is false. | boolean |
The following tables summarize the server response.
- application/json
200 Response
Example 1
The following example shows how to get first 4 AVIArticle names in the ContentQuery with the ID 1395380847207 under the avisports sample site in WebCenter Sites, by submitting a GET request on the REST resource using cURL.
The REST URL also specifies to give only the describedby link.
Query param details:
"limit=4" : The first 4 results. Since 'offset' is not given, the default is 0.
"assetDepth=0&fields=name&expand=AVIArticle": All results (AVIArticles) are available in an 'items' array. Each item (AVIArticle) is an aggregated asset, and so it is a root asset for that item. We are interested only in the name of that root asset - AVIArticle.
"links=describedby": Show only the describedby link.
curl -i -H "Accept: application/json" -X GET "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ContentQuery/1395380847207/items?limit=4&assetDepth=0&fields=name&expand=AVIArticle&links=describedby"
Example 1 Response Header
The following example shows the response header.
HTTP/1.1 200 OK ETag: "9f4bca655ec8f44549cebba1c5e5351c732a38f7320692b76c5a4bad8c0fd8c0" Cache-Control: max-age=0 Content-Type: application/json;charset=utf-8
Example 1 Response Body
The following example shows the contents of the response body, in JSON format.
{ "offset": 0, "limit": 50, "count": 4, "hasMore": true, "links": [ { "href": "http://<host>:<port>/<context>/REST/resources/v1/metadata-catalog/aggregates/avisports/ContentQuery/1395380847207/items", "rel": "describedby", "templated": false, "mediaType": "application/schema+json", "method": "GET", "profile": "" } ], "items": [ { "AVIArticle:1328196047241": { "name": "Veteran Skier Says Goodbye", "parents": [ { "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ArticleCategory/1327351719208", "rel": "assetReference", "templated": false, "mediaType": "", "method": "GET", "profile": "" } ] }, "start": "AVIArticle:1328196047241" }, { "start": "AVIArticle:1328196047309", "AVIArticle:1328196047309": { "name": "Rookie Skier Makes Her Mark ", "parents": [ { "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ArticleCategory/1327351719208", "rel": "assetReference", "templated": false, "mediaType": "", "method": "GET", "profile": "" } ] } }, { "start": "AVIArticle:1328196047338", "AVIArticle:1328196047338": { "name": "25 Nevada Resorts Serving Snow", "parents": [ { "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ArticleCategory/1327351719208", "rel": "assetReference", "templated": false, "mediaType": "", "method": "GET", "profile": "" } ] } }, { "AVIArticle:1328196047367": { "name": "Ski Castle and Snowboard Wizards Unite ", "parents": [ { "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ArticleCategory/1327351719208", "rel": "assetReference", "templated": false, "mediaType": "", "method": "GET", "profile": "" } ] }, "start": "AVIArticle:1328196047367" } ] }
Example 2
The following example shows how to get the first 2 AVIArticle names along with their relatedImage names in the ContentQuery with the ID 1395380847207 in the avisports sample site in WebCenter Sites, by submitting a GET request on the REST resource using cURL.
The REST URL also specifies to give only the next link.
Query param details:
"offset=0&limit=2" : The first 2 results.
Note: All results (AVIArticles) are available in an 'items' array. Each item (AVIArticle) is an aggregated asset.
"assetDepth=1": We also need details of a relatedImage asset at depth 1, so we need the aggregate asset data for each item until depth 1.
"fields=name,relatedImage;AVIImage(name)": We are interested in (1) the name and relatedImage attributes for the root asset (AVIArticle:1328196047241) and (2) the name attribute for the relatedImage asset .
"expand=AVIArticle,AVIImage": In each item, we are interested only in the root asset of type AVIArticle and its relatedImage asset of type AVIImage.
"links=next": Show only next link.
curl -i -H "Accept: application/json" -X GET "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ContentQuery/1395380847207/items?offset=0&limit=2&assetDepth=1&fields=name,relatedImage;AVIImage(name)&expand=AVIArticle,AVIImage&links=next"
Example 2 Response Header
The following shows an example of the response header.
HTTP/1.1 200 OK ETag: "3cb52510c786d128a15809407911f85d1dca06afe7cd228a122f3c39834e26f6" Cache-Control: max-age=0 Content-Type: application/json;charset=utf-8
Example 2 Response Body
The following example shows the contents of the response body, in JSON format.
{ "offset": 0, "limit": 50, "count": 2, "hasMore": true, "links": [ { "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ContentQuery/1395380847207/items?expand=AVIArticle,AVIImage&offset=2&limit=2&links=next&fields=name,relatedImage;AVIImage(name)&assetDepth=1", "rel": "next", "templated": false, "mediaType": "", "method": "", "profile": "" } ], "items": [ { "AVIImage:1327351719292": { "name": "Yellow Skier", "parents": [ { "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ImageCategory/1327351718428", "rel": "assetReference", "templated": false, "mediaType": "", "method": "GET", "profile": "" } ] }, "AVIArticle:1328196047241": { "name": "Veteran Skier Says Goodbye", "relatedImage": { "id": 1327351719292, "type": "AVIImage" }, "parents": [ { "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ArticleCategory/1327351719208", "rel": "assetReference", "templated": false, "mediaType": "", "method": "GET", "profile": "" } ] }, "start": "AVIArticle:1328196047241" }, { "AVIImage:1328196052533": { "name": "Female Snowboarder", "parents": [ { "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ImageCategory/1327351718428", "rel": "assetReference", "templated": false, "mediaType": "", "method": "GET", "profile": "" } ] }, "start": "AVIArticle:1328196047309", "AVIArticle:1328196047309": { "name": "Rookie Skier Makes Her Mark ", "relatedImage": { "id": 1328196052533, "type": "AVIImage" }, "parents": [ { "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ArticleCategory/1327351719208", "rel": "assetReference", "templated": false, "mediaType": "", "method": "GET", "profile": "" } ] } } ] }