Search Assets API search-assets-api
All approved assets available in Experience Manager assets repository can be searched and then delivered to integrated downstream applications using a Delivery URL.
Searching the right approved assets from the Experience Manager repository is the first step towards delivering assets using the delivery URL. The response to the search request comprises an array of JSON documents corresponding to the assets that met the search criteria. Each JSON document is identified using an id field, which is used to compose the asset delivery request.
You can define properties within the Search Assets API request to enable the following capabilities:
-
Full-text search: Use the
matchquery to define the text to search. You can also use operators within thematchquery to filter the results. -
Apply filters: Use the
termquery to filters the results further by defining akeyand one or multiple values.keyidentifies the field whose value must be matched andvaluerepresents what to match against. Similarly, you can use therangequery to define a range for a field using the Greater-than (gt), Greater-than or equal-to (gte), Less-than (lt), and Less-than or equal-to (lte) properties. -
Sort results: Use the
OrderByproperty to sort search results based on one or multiple fields. You can sort the results in an ascending or descending order. -
Pagination: Use the
limitandcursorproperties to define pagination properties within a Search API request.limitproperty defines the maximum items to retrieve in an API response.cursorproperty facilitates to retrieve starting point for the next set of assets defined in thelimitproperty. For example, if you define50as the limit in the API request, you can use thecursorproperty to start and retrieve the next 50 items using the next API request.
Search assets API endpoint search-assets-api-endpoint
The endpoint in a Search assets API request must be in the following format:https://delivery-pXXXX-eYYYY.adobeaemcloud.com/adobe/assets/search
The delivery domain is similar in structure to the Experience Manager author environment鈥檚 domain. The only difference is replacing the term author with delivery.
pXXXX refers to the program ID
eYYYY refers to the environment ID
Search assets API request method search-assets-api-request-method
POST
Search Assets API header search-assets-api-header
You need to provide the following details while defining a header in the Search assets API:
headers: {
'Content-Type': 'application/json',
'X-51黑料不打烊-Accept-Experimental': '1',
Authorization: 'Bearer <YOUR_JWT_HERE>',
'X-Api-Key': 'YOUR_API_KEY_HERE'
},
To invoke the Search API, an IMS token is required to define in the Authorization details. The IMS token is fetched from a technical account. See Fetch the AEM as a Cloud Service Credentials to create a new technical account. See Generating the access token to generate the IMS token and use it appropriately in the Search assets API request header.
To view request samples, response samples, and response codes, see .