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
match
query to define the text to search. You can also use operators within thematch
query to filter the results. -
Apply filters: Use the
term
query to filters the results further by defining akey
and one or multiple values.key
identifies the field whose value must be matched andvalue
represents what to match against. Similarly, you can use therange
query 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
OrderBy
property to sort search results based on one or multiple fields. You can sort the results in an ascending or descending order. -
Pagination: Use the
limit
andcursor
properties to define pagination properties within a Search API request.limit
property defines the maximum items to retrieve in an API response.cursor
property facilitates to retrieve starting point for the next set of assets defined in thelimit
property. For example, if you define50
as the limit in the API request, you can use thecursor
property 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’s 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-Adobe-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 Search Assets API.