Previous Next

Search assets in a site by asset type

get
/resources/v1/search/sites/{siteName}/types/{assetType}/assets
The resource endpoint returns the list of all assets in a site based on asset type.
It is a Collection Resource.

The following tables summarize the client request.

Path Parameters
Name Description Format
assetType Asset type string
siteName Name of the site string
Query Parameters
Name Description Format
countonly Accepts a Boolean value. Setting it true displays only the count, and no results are returned. The default is false. boolean
field:[fieldname]:[operation] Specify a query condition for a field of [fieldname] with the specified operation. [Operation] is optional and can be one of equals, range, startswith, phrase, wildcard, similar, or contains; the default is contains. For the range operation, the value's format is {lower bound}:{upper bound}; for example, 1:10. string
fields Accepts a comma-separated list of attribute names for each search result. By default only name and description are given for each search result. 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
orderBy Specify the field on which the results should be sorted.
Usage: orderBy=[fieldname]:[asc/des].
Note: For Lucene, sorting is possible only for fields that were indexed as "not tokenized".
string
q Specify a query string, the search engine-specific query that was specified during the configuration. (The default search engine is Lucene.) string
searchengine Specify what search engine to use to find the results. The default search engine is Lucene. 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.

Supported Media Types
  • application/json
  • application/xml

200 Response

List of all assets in a site based on asset type

Example 1

The following example shows how to get any 2 AVIArticle names 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 self link.

Query param details:

  • "limit=2": Need only 2 results. Since 'offset' is not given, the default is 0.

  • "links=self" : Show only the self link.

curl -i -H "Accept: application/json" -X GET "http://<host>:<port>/<context>/REST/resources/v1/search/sites/avisports/types/AVIArticle/assets?limit=2&links=self"

Example 1 Response Header

The following example shows the response header.

Cache-Control: max-age=0 
ETag: "1e0260979bc3b5d5367fb168cd467227d27ec90beeabd274d5c36e61d01fff44" 
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": 100,
  "count": 2,
  "hasMore": true,
  "links": [
    {
      "href": "http://<host>:<port>/<context>/REST/resources/v1/search/sites/avisports/types/AVIArticle/assets?limit=2&links=self",
      "rel": "self",
      "templated": false,
      "mediaType": "",
      "method": "",
      "profile": ""
    }
  ],
  "items": [
    {
      "name": "Veteran Skier Says Goodbye",
      "link": {
        "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/AVIArticle/1328196047241",
        "rel": "assetReference",
        "templated": false,
        "mediaType": "",
        "method": "GET",
        "profile": ""
      },
      "description": "",
      "id": "AVIArticle:1328196047241"
    },
    {
      "name": "Rookie Skier Makes Her Mark",
      "link": {
        "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/AVIArticle/1328196047309",
        "rel": "assetReference",
        "templated": false,
        "mediaType": "",
        "method": "GET",
        "profile": ""
      },
      "description": "",
      "id": "AVIArticle:1328196047309"
    }
  ]
}

Example 2

The following example shows how to get any 2 AVIArticle names that start with "H" 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 self link.

Query param details:

  • "limit=2": Need only 2 results. Since 'offset' is not given, the default is 0.

  • "field:name:startswith=H": Need an AVIArticle whose name starts with "H".

  • "links=self": Show only the self link.

curl -i -H "Accept: application/json" -X GET "http://<host>:<port>/<context>/REST/resources/v1/search/sites/avisports/types/AVIArticle/assets?limit=2&links=self&field:name:startswith=H"

Example 2 Response Header

The following example shows the response header.

Cache-Control: max-age=0 
ETag: "e515a1e7e9c29bd87cb5ac34628a402671db9b997a1689f26e716b49b3d34663" 
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": 18,
  "count": 2,
  "hasMore": true,
  "links": [
    {
      "href": "http://<host>:<port>/<context>/REST/resources/v1/search/sites/avisports/types/AVIArticle/assets?field:name:startswith=H&limit=2&links=self",
      "rel": "self",
      "templated": false,
      "mediaType": "",
      "method": "",
      "profile": ""
    }
  ],
  "items": [
    {
      "name": "Hurricanes reaches deal with lefty Porter",
      "link": {
        "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/AVIArticle/1328196049231",
        "rel": "assetReference",
        "templated": false,
        "mediaType": "",
        "method": "GET",
        "profile": ""
      },
      "description": "",
      "id": "AVIArticle:1328196049231"
    },
    {
      "name": "How Dial A Spot",
      "link": {
        "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/AVIArticle/1330367422843",
        "rel": "assetReference",
        "templated": false,
        "mediaType": "",
        "method": "GET",
        "profile": ""
      },
      "description": "",
      "id": "AVIArticle:1330367422843"
    }
  ]
}