Skip navigation

Filter content items (examples)

When building your apps, you'll use the Delivery API to get content items. The Delivery API provides several filters to help you refine your requests based on your requirements.

What do you know about the content you want to get? Find a relevant scenario below and adjust the code to get the content you need.

Table of contents

    Item ID, codename, or external ID

    To get an item based on its identifier (like ID, codename, or external ID), use the equals filter. For example, if you need to get an item by its internal ID, you match the item's ID (system.id) against the ID you have. 

    • Java
    // Gets an item by its internal ID List<object> items = deliveryService.<object>items() .equalsFilter("system.id", "2f7288a1-cfc8-47be-9bf1-b1d312f7da18") .get() .getItems();
    // Gets an item by its internal ID List<object> items = deliveryService.<object>items() .equalsFilter("system.id", "2f7288a1-cfc8-47be-9bf1-b1d312f7da18") .get() .getItems();
    • Swift
    // Gets an item by its internal ID let customQuery = "items?system.id=2f7288a1-cfc8-47be-9bf1-b1d312f7da18" client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    // Gets an item by its internal ID let customQuery = "items?system.id=2f7288a1-cfc8-47be-9bf1-b1d312f7da18" client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    • Java
    // Gets an item by its internal ID DeliveryClient client = new DeliveryClient("<YOUR_PROJECT_ID>"); List<NameValuePair> params = DeliveryParameterBuilder.params() .filterEquals("system.id", "2f7288a1-cfc8-47be-9bf1-b1d312f7da18") .build(); CompletionStage<ContentItem> item = client.getItems(params) .thenApply(contentItemsListingResponse -> contentItemsListingResponse.getItems().get(0));
    // Gets an item by its internal ID DeliveryClient client = new DeliveryClient("<YOUR_PROJECT_ID>"); List<NameValuePair> params = DeliveryParameterBuilder.params() .filterEquals("system.id", "2f7288a1-cfc8-47be-9bf1-b1d312f7da18") .build(); CompletionStage<ContentItem> item = client.getItems(params) .thenApply(contentItemsListingResponse -> contentItemsListingResponse.getItems().get(0));
    • JavaScript
    // Gets an item by its internal ID deliveryClient.items() .equalsFilter('system.id', '2f7288a1-cfc8-47be-9bf1-b1d312f7da18') .toObservable() .subscribe(response => console.log(response));
    // Gets an item by its internal ID deliveryClient.items() .equalsFilter('system.id', '2f7288a1-cfc8-47be-9bf1-b1d312f7da18') .toObservable() .subscribe(response => console.log(response));
    • C#
    // Gets an item by its internal ID DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new EqualsFilter("system.id", "2f7288a1-cfc8-47be-9bf1-b1d312f7da18") );
    // Gets an item by its internal ID DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new EqualsFilter("system.id", "2f7288a1-cfc8-47be-9bf1-b1d312f7da18") );
    • PHP
    // Gets an item by its internal ID $items = $client->getItems((new QueryParams()) ->equals('system.id', '2f7288a1-cfc8-47be-9bf1-b1d312f7da18'));
    // Gets an item by its internal ID $items = $client->getItems((new QueryParams()) ->equals('system.id', '2f7288a1-cfc8-47be-9bf1-b1d312f7da18'));
    • cURL
    # Gets an item by its internal ID curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?system.id=2f7288a1-cfc8-47be-9bf1-b1d312f7da18' \ --header 'content-type: application/json'
    # Gets an item by its internal ID curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?system.id=2f7288a1-cfc8-47be-9bf1-b1d312f7da18' \ --header 'content-type: application/json'
    • Ruby
    # Gets an item by its internal ID delivery_client.items('system.id'.equals('2f7288a1-cfc8-47be-9bf1-b1d312f7da18'))
    # Gets an item by its internal ID delivery_client.items('system.id'.equals('2f7288a1-cfc8-47be-9bf1-b1d312f7da18'))
    • TypeScript
    // Gets an item by its internal ID deliveryClient.items<ContentItem>() .equalsFilter('system.id', '2f7288a1-cfc8-47be-9bf1-b1d312f7da18') .toObservable() .subscribe(response => console.log(response));
    // Gets an item by its internal ID deliveryClient.items<ContentItem>() .equalsFilter('system.id', '2f7288a1-cfc8-47be-9bf1-b1d312f7da18') .toObservable() .subscribe(response => console.log(response));

    If you have multiple identifiers of a single type (for example, only IDs or codenames) and want to retrieve them in a single request, use the in filter.

    • Java
    // Gets three items by their codenames. The codenames are unique per project. List<ContentItem> items = deliveryService.<ContentItem>items() .inFilter("system.codename", Arrays.asList("delivery_api", "get_content", "hello_world")) .get() .getItems();
    // Gets three items by their codenames. The codenames are unique per project. List<ContentItem> items = deliveryService.<ContentItem>items() .inFilter("system.codename", Arrays.asList("delivery_api", "get_content", "hello_world")) .get() .getItems();
    • Swift
    // Gets three items by their codenames. The codenames are unique per project. let customQuery = "items?system.codename[in]=delivery_api,get_content,hello_world" client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    // Gets three items by their codenames. The codenames are unique per project. let customQuery = "items?system.codename[in]=delivery_api,get_content,hello_world" client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    • Java
    // Gets three items by their codenames. The codenames are unique per project. List<NameValuePair> params = DeliveryParameterBuilder.params() .filterIn("system.codename", "delivery_api", "get_content", "hello_world") .build() CompletionStage<ContentItemsListingResponse> listingResponse = deliveryClient.getItems(params);
    // Gets three items by their codenames. The codenames are unique per project. List<NameValuePair> params = DeliveryParameterBuilder.params() .filterIn("system.codename", "delivery_api", "get_content", "hello_world") .build() CompletionStage<ContentItemsListingResponse> listingResponse = deliveryClient.getItems(params);
    • JavaScript
    // Gets three items by their codenames. The codenames are unique per project. deliveryClient.items() .inFilter('system.codename', ['delivery_api', 'get_content', 'hello_world']) .toObservable() .subscribe(response => console.log(response));
    // Gets three items by their codenames. The codenames are unique per project. deliveryClient.items() .inFilter('system.codename', ['delivery_api', 'get_content', 'hello_world']) .toObservable() .subscribe(response => console.log(response));
    • C#
    // Gets three items by their codenames. The codenames are unique per project. DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new InFilter("system.codename", "delivery_api", "get_content", "hello_world") );
    // Gets three items by their codenames. The codenames are unique per project. DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new InFilter("system.codename", "delivery_api", "get_content", "hello_world") );
    • PHP
    // Gets three items by their codenames. The codenames are unique per project. $items = $client->getItems((new QueryParams()) ->in('system.codename', 'delivery_api', 'get_content', 'hello_world'));
    // Gets three items by their codenames. The codenames are unique per project. $items = $client->getItems((new QueryParams()) ->in('system.codename', 'delivery_api', 'get_content', 'hello_world'));
    • cURL
    # Gets three items by their codenames. The codenames are unique per project. curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?system.codename[in]=delivery_api,get_content,hello_world' \ --header 'content-type: application/json'
    # Gets three items by their codenames. The codenames are unique per project. curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?system.codename[in]=delivery_api,get_content,hello_world' \ --header 'content-type: application/json'
    • Ruby
    # Gets three items by their codenames. The codenames are unique per project. delivery_client.items('system.codename'.in('delivery_api', 'get_content', 'hello_world'))
    # Gets three items by their codenames. The codenames are unique per project. delivery_client.items('system.codename'.in('delivery_api', 'get_content', 'hello_world'))
    • TypeScript
    // Gets three items by their codenames. The codenames are unique per project. deliveryClient.items<ContentItem>() .inFilter('system.codename', ['delivery_api', 'get_content', 'hello_world']) .toObservable() .subscribe(response => console.log(response));
    // Gets three items by their codenames. The codenames are unique per project. deliveryClient.items<ContentItem>() .inFilter('system.codename', ['delivery_api', 'get_content', 'hello_world']) .toObservable() .subscribe(response => console.log(response));

    If you know the item's codename, use the retrieve a content item endpoint for better performance.

    Content types

    To get items based on a single content type, specify the content type's codename using the equals filter.

    • Java
    // Gets items of content type Product List<Product> items = deliveryService.<Product>items() .equalsFilter("system.type", "product") .get() .getItems();
    // Gets items of content type Product List<Product> items = deliveryService.<Product>items() .equalsFilter("system.type", "product") .get() .getItems();
    • Swift
    // Gets items based on the type Product let customQuery = "items?system.type=product" client.getItems(modelType: Product.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let products = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    // Gets items based on the type Product let customQuery = "items?system.type=product" client.getItems(modelType: Product.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let products = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    • Java
    // Gets items based on the type Product List<NameValuePair> params = DeliveryParameterBuilder.params() .filterEquals("system.type", "product") .build(); CompletionStage<List<ProductItem>> items = deliveryClient.getItems(ProductItem.class, params);
    // Gets items based on the type Product List<NameValuePair> params = DeliveryParameterBuilder.params() .filterEquals("system.type", "product") .build(); CompletionStage<List<ProductItem>> items = deliveryClient.getItems(ProductItem.class, params);
    • JavaScript
    // Gets items based on the type Product deliveryClient.items<ContentItem>() .equalsFilter('system.type', 'product') // Same as using .type('product') .toObservable() .subscribe(response => console.log(response));
    // Gets items based on the type Product deliveryClient.items<ContentItem>() .equalsFilter('system.type', 'product') // Same as using .type('product') .toObservable() .subscribe(response => console.log(response));
    • C#
    // Gets items based on the type Product DeliveryItemListingResponse<Product> response = await deliveryClient.GetItemsAsync<Product>( new EqualsFilter("system.type", "product") );
    // Gets items based on the type Product DeliveryItemListingResponse<Product> response = await deliveryClient.GetItemsAsync<Product>( new EqualsFilter("system.type", "product") );
    • PHP
    // Gets items based on the type Product $items = $deliveryClient->getItems((new QueryParams()) ->equals('system.type', 'product'));
    // Gets items based on the type Product $items = $deliveryClient->getItems((new QueryParams()) ->equals('system.type', 'product'));
    • cURL
    # Gets items based on the type Product curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?system.type=product' \ --header 'content-type: application/json'
    # Gets items based on the type Product curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?system.type=product' \ --header 'content-type: application/json'
    • Ruby
    # Gets items of content type Product delivery_client.items('system.type'.eq('product'))
    # Gets items of content type Product delivery_client.items('system.type'.eq('product'))
    • TypeScript
    // Gets items based on the type Product deliveryClient.items<ContentItem>() .equalsFilter('system.type', 'product') // Same as using .type('product') .toObservable() .subscribe(response => console.log(response));
    // Gets items based on the type Product deliveryClient.items<ContentItem>() .equalsFilter('system.type', 'product') // Same as using .type('product') .toObservable() .subscribe(response => console.log(response));

    To get items based on multiple content types, specify the content types' codenames using the in  filter. 

    • Java
    // Gets items based on the types Article, Product, and News List<ContentItem> items = deliveryService.<ContentItem>items() .inFilter("system.type", Arrays.asList("article", "product", "news")) .get() .getItems();
    // Gets items based on the types Article, Product, and News List<ContentItem> items = deliveryService.<ContentItem>items() .inFilter("system.type", Arrays.asList("article", "product", "news")) .get() .getItems();
    • Swift
    // Gets items of following content types let customQuery = "items?system.type[in]=product,article,news" client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    // Gets items of following content types let customQuery = "items?system.type[in]=product,article,news" client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    • Java
    // Gets items based on the types Product, Article, and News List<NameValuePair> params = DeliveryParameterBuilder.params() .filterIn("system.type", "product", "article", "news") .build(); CompletionStage<ContentItemsListingResponse> listingResponse = deliveryClient.getItems(params);
    // Gets items based on the types Product, Article, and News List<NameValuePair> params = DeliveryParameterBuilder.params() .filterIn("system.type", "product", "article", "news") .build(); CompletionStage<ContentItemsListingResponse> listingResponse = deliveryClient.getItems(params);
    • JavaScript
    // Gets items based on the type Product, Article, and News deliveryClient.items() .inFilter('system.type', ['product', 'article', 'news']) .toObservable() .subscribe(response => console.log(response));
    // Gets items based on the type Product, Article, and News deliveryClient.items() .inFilter('system.type', ['product', 'article', 'news']) .toObservable() .subscribe(response => console.log(response));
    • C#
    // Gets items based on the types Product, Article, and News DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new InFilter("system.type", "product", "article", "news") );
    // Gets items based on the types Product, Article, and News DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new InFilter("system.type", "product", "article", "news") );
    • PHP
    // Gets items based on the types Product, Article, and News $items = $deliveryClient->getItems((new QueryParams()) ->in('system.type', 'product', 'article', 'news'));
    // Gets items based on the types Product, Article, and News $items = $deliveryClient->getItems((new QueryParams()) ->in('system.type', 'product', 'article', 'news'));
    • cURL
    # Gets items based on the types Product, Article, and News curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?system.type[in]=product,article,news' \ --header 'content-type: application/json'
    # Gets items based on the types Product, Article, and News curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?system.type[in]=product,article,news' \ --header 'content-type: application/json'
    • Ruby
    # Gets items based on the types Product, Article, and News delivery_client.items('system.type'.in('product', 'article', 'news'))
    # Gets items based on the types Product, Article, and News delivery_client.items('system.type'.in('product', 'article', 'news'))
    • TypeScript
    // Gets items based on the types Product, Article, and News deliveryClient.items<ContentItem>() .inFilter('system.type', ['product', 'article', 'news']) .toObservable() .subscribe(response => console.log(response));
    // Gets items based on the types Product, Article, and News deliveryClient.items<ContentItem>() .inFilter('system.type', ['product', 'article', 'news']) .toObservable() .subscribe(response => console.log(response));

    Date & time and numbers

    To get items by a datetime value, you can use one of the comparison filters. This lets you retrieve content modified or released before or after a certain date. The following code shows the filters used on the last content modification date and a date & time element.

    • Java
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified after April 9 2020, 9 am UTC+0 List<ContentItem> items1 = deliveryService.<ContentItem>items() .greaterThanFilter("system.last_modified", "2020-05-09T09:00:00.000000Z") .get() .getItems(); // Gets items released at or after April 9 2020, 7 am UTC+0 List<ContentItem> items2 = deliveryService.<ContentItem>items() .greaterThanOrEqualFilter("elements.release_date", "2020-05-09T07:00:00Z") .get() .getItems(); // Gets items modified before April 5 2020 UTC+0. Last match would be at 2020-05-04T23:59:59. List<ContentItem> items3 = deliveryService.<ContentItem>items() .lessThanFilter("system.last_modified", "2020-05-05") .get() .getItems(); // Gets items released at or before April 5 2020 10:30 am UTC+0 List<ContentItem> items4 = deliveryService.<ContentItem>items() .lessThanOrEqualFilter("elements.release_date", "2020-05-05T10:30:00Z") .get() .getItems();
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified after April 9 2020, 9 am UTC+0 List<ContentItem> items1 = deliveryService.<ContentItem>items() .greaterThanFilter("system.last_modified", "2020-05-09T09:00:00.000000Z") .get() .getItems(); // Gets items released at or after April 9 2020, 7 am UTC+0 List<ContentItem> items2 = deliveryService.<ContentItem>items() .greaterThanOrEqualFilter("elements.release_date", "2020-05-09T07:00:00Z") .get() .getItems(); // Gets items modified before April 5 2020 UTC+0. Last match would be at 2020-05-04T23:59:59. List<ContentItem> items3 = deliveryService.<ContentItem>items() .lessThanFilter("system.last_modified", "2020-05-05") .get() .getItems(); // Gets items released at or before April 5 2020 10:30 am UTC+0 List<ContentItem> items4 = deliveryService.<ContentItem>items() .lessThanOrEqualFilter("elements.release_date", "2020-05-05T10:30:00Z") .get() .getItems();
    • Swift
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Filters items modified after April 9 2020, 9 am UTC+0 let customQuery = "items?system.last_modified[gt]=2020-05-09T09:00:00.000000Z" // Other examples: // Filters items released at or after April 9 2020, 7 am UTC+0 // let customQuery = "elements.release_date[gte]=2020-05-09T07:00:00Z" // Filters items modified before April 5 2020 UTC+0 // let customQuery = "system.last_modified[lt]=2020-05-05" // Filters items released at or before April 5 2020 10:30 am UTC+0 // let customQuery = "elements.release_date[lte]=2020-05-05T10:30:00Z" client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Filters items modified after April 9 2020, 9 am UTC+0 let customQuery = "items?system.last_modified[gt]=2020-05-09T09:00:00.000000Z" // Other examples: // Filters items released at or after April 9 2020, 7 am UTC+0 // let customQuery = "elements.release_date[gte]=2020-05-09T07:00:00Z" // Filters items modified before April 5 2020 UTC+0 // let customQuery = "system.last_modified[lt]=2020-05-05" // Filters items released at or before April 5 2020 10:30 am UTC+0 // let customQuery = "elements.release_date[lte]=2020-05-05T10:30:00Z" client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    • Java
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified after April 9 2020, 9 am UTC+0 List<NameValuePair> params1 = DeliveryParameterBuilder.params() .filterGreaterThan("system.last_modified", "2020-05-09T09:00:00.000000Z") .build(); CompletionStage<ContentItemsListingResponse> listingResponse = deliveryClient.getItems(params1); // Gets items released at or after April 9 2020, 7 am UTC+0 List<NameValuePair> params2 = DeliveryParameterBuilder.params() .filterGreaterThanOrEqual("elements.release_date", "2020-05-09T07:00:00Z") .build(); CompletionStage<ContentItemsListingResponse> listingResponse = deliveryClient.getItems(params2); // Gets items modified before April 5 2020 UTC+0. Last match would be at 2020-05-04T23:59:59. List<NameValuePair> params3 = DeliveryParameterBuilder.params() .filterLessThan("system.last_modified", "2020-05-05") .build(); CompletionStage<ContentItemsListingResponse> listingResponse = deliveryClient.getItems(params3); // Gets items released at or before April 5 2020 10:30 am UTC+0 List<NameValuePair> params4 = DeliveryParameterBuilder.params() .filterLessThanOrEqual("elements.release_date", "2020-05-05T10:30:00Z") .build(); CompletionStage<ContentItemsListingResponse> listingResponse = deliveryClient.getItems(params4);
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified after April 9 2020, 9 am UTC+0 List<NameValuePair> params1 = DeliveryParameterBuilder.params() .filterGreaterThan("system.last_modified", "2020-05-09T09:00:00.000000Z") .build(); CompletionStage<ContentItemsListingResponse> listingResponse = deliveryClient.getItems(params1); // Gets items released at or after April 9 2020, 7 am UTC+0 List<NameValuePair> params2 = DeliveryParameterBuilder.params() .filterGreaterThanOrEqual("elements.release_date", "2020-05-09T07:00:00Z") .build(); CompletionStage<ContentItemsListingResponse> listingResponse = deliveryClient.getItems(params2); // Gets items modified before April 5 2020 UTC+0. Last match would be at 2020-05-04T23:59:59. List<NameValuePair> params3 = DeliveryParameterBuilder.params() .filterLessThan("system.last_modified", "2020-05-05") .build(); CompletionStage<ContentItemsListingResponse> listingResponse = deliveryClient.getItems(params3); // Gets items released at or before April 5 2020 10:30 am UTC+0 List<NameValuePair> params4 = DeliveryParameterBuilder.params() .filterLessThanOrEqual("elements.release_date", "2020-05-05T10:30:00Z") .build(); CompletionStage<ContentItemsListingResponse> listingResponse = deliveryClient.getItems(params4);
    • JavaScript
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified after April 9 2020, 9 am UTC+0 deliveryClient.items() .greaterThanFilter('system.last_modified', '2020-05-09T09:00:00.000000Z') .toObservable() .subscribe(response => console.log(response)); // Gets items released at or after April 9 2020, 7 am UTC+0 deliveryClient.items() .greaterThanOrEqualFilter('elements.release_date', '2020-05-09T07:00:00Z') .toObservable() .subscribe(response => console.log(response)); // Gets items modified before April 5 2020 UTC+0. Last match would be at 2020-05-04T23:59:59. deliveryClient.items() .lessThanFilter('system.last_modified', '2020-05-05') .toObservable() .subscribe(response => console.log(response)); // Gets items released at or before April 5 2020 10:30 am UTC+0 deliveryClient.items() .lessThanOrEqualFilter('elements.release_date', '2020-05-05T10:30:00Z') .toObservable() .subscribe(response => console.log(response));
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified after April 9 2020, 9 am UTC+0 deliveryClient.items() .greaterThanFilter('system.last_modified', '2020-05-09T09:00:00.000000Z') .toObservable() .subscribe(response => console.log(response)); // Gets items released at or after April 9 2020, 7 am UTC+0 deliveryClient.items() .greaterThanOrEqualFilter('elements.release_date', '2020-05-09T07:00:00Z') .toObservable() .subscribe(response => console.log(response)); // Gets items modified before April 5 2020 UTC+0. Last match would be at 2020-05-04T23:59:59. deliveryClient.items() .lessThanFilter('system.last_modified', '2020-05-05') .toObservable() .subscribe(response => console.log(response)); // Gets items released at or before April 5 2020 10:30 am UTC+0 deliveryClient.items() .lessThanOrEqualFilter('elements.release_date', '2020-05-05T10:30:00Z') .toObservable() .subscribe(response => console.log(response));
    • C#
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified after April 9 2020, 9 am UTC+0 DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new GreaterThanFilter("system.last_modified", "2020-05-09T09:00:00.000000Z") ); // Gets items released at or after April 9 2020, 7 am UTC+0 DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new GreaterThanOrEqualFilter("elements.release_date", "2020-05-09T07:00:00Z") ); // Gets items modified before April 5 2020 UTC+0. Last match would be at 2020-05-04T23:59:59. DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new LessThanFilter("system.last_modified", "2020-05-05") ); // Gets items released at or before April 5 2020 10:30 am UTC+0 DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new LessThanOrEqualFilter("elements.release_date", "2020-05-05T10:30:00Z") );
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified after April 9 2020, 9 am UTC+0 DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new GreaterThanFilter("system.last_modified", "2020-05-09T09:00:00.000000Z") ); // Gets items released at or after April 9 2020, 7 am UTC+0 DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new GreaterThanOrEqualFilter("elements.release_date", "2020-05-09T07:00:00Z") ); // Gets items modified before April 5 2020 UTC+0. Last match would be at 2020-05-04T23:59:59. DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new LessThanFilter("system.last_modified", "2020-05-05") ); // Gets items released at or before April 5 2020 10:30 am UTC+0 DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new LessThanOrEqualFilter("elements.release_date", "2020-05-05T10:30:00Z") );
    • PHP
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified after April 9 2020, 9 am UTC+0 $items1 = $client->getItems((new QueryParams()) ->greaterThan('system.last_modified', '2020-05-09T09:00:00.000000Z')); // Gets items released at or after April 9 2020, 7 am UTC+0 $items2 = $client->getItems((new QueryParams()) ->greaterThanOrEqual('elements.release_date', '2020-05-09T07:00:00Z')); // Gets items modified before April 5 2020 UTC+0. Last match would be at 2020-05-04T23:59:59. $items3 = $client->getItems((new QueryParams()) ->lessThan('system.last_modified', '2020-05-05')); // Gets items released at or before April 5 2020 10:30 am UTC+0 $items4 = $client->getItems((new QueryParams()) ->lessThanOrEqual('elements.release_date', '2020-05-05T10:30:00Z'));
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified after April 9 2020, 9 am UTC+0 $items1 = $client->getItems((new QueryParams()) ->greaterThan('system.last_modified', '2020-05-09T09:00:00.000000Z')); // Gets items released at or after April 9 2020, 7 am UTC+0 $items2 = $client->getItems((new QueryParams()) ->greaterThanOrEqual('elements.release_date', '2020-05-09T07:00:00Z')); // Gets items modified before April 5 2020 UTC+0. Last match would be at 2020-05-04T23:59:59. $items3 = $client->getItems((new QueryParams()) ->lessThan('system.last_modified', '2020-05-05')); // Gets items released at or before April 5 2020 10:30 am UTC+0 $items4 = $client->getItems((new QueryParams()) ->lessThanOrEqual('elements.release_date', '2020-05-05T10:30:00Z'));
    • cURL
    # Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. # Gets items modified after April 9 2020, 9 am UTC+0 curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?system.last_modified[gt]=2020-05-09T09:00:00.000000Z' \ --header 'content-type: application/json' # Gets items released at or after April 9 2020, 7 am UTC+0 curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?"elements.release_date[gte]=2020-05-09T07:00:00Z"' \ --header 'content-type: application/json' # Gets items modified before April 5 2020 UTC+0. Last match would be at 2020-05-04T23:59:59. curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?system.last_modified[lt]=2020-05-05' \ --header 'content-type: application/json' # Gets items released at or before April 5 2020 10:30 am UTC+0 curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.release_date", "2020-05-05T10:30:00Z' \ --header 'content-type: application/json'
    # Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. # Gets items modified after April 9 2020, 9 am UTC+0 curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?system.last_modified[gt]=2020-05-09T09:00:00.000000Z' \ --header 'content-type: application/json' # Gets items released at or after April 9 2020, 7 am UTC+0 curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?"elements.release_date[gte]=2020-05-09T07:00:00Z"' \ --header 'content-type: application/json' # Gets items modified before April 5 2020 UTC+0. Last match would be at 2020-05-04T23:59:59. curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?system.last_modified[lt]=2020-05-05' \ --header 'content-type: application/json' # Gets items released at or before April 5 2020 10:30 am UTC+0 curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.release_date", "2020-05-05T10:30:00Z' \ --header 'content-type: application/json'
    • Ruby
    # Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. # Gets items modified after April 9 2020, 9 am UTC+0 delivery_client.items('system.last_modified'.greaterThan('2020-05-09T09:00:00.000000Z')) # Gets items released at or after April 9 2020, 7 am UTC+0 delivery_client.items('elements.release_date'.greaterThanOrEqual('2020-05-09T07:00:00Z')) # Gets items modified before April 5 2020 UTC+0; Last match would be at 2020-05-04T23:59:59 delivery_client.items('system.last_modified'.lessThan('2020-05-05')) # Gets items released at or before April 5 2020 10:30 am UTC+0 delivery_client.items('elements.release_date'.lessThanOrEqual('2020-05-05T10:30:00Z'))
    # Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. # Gets items modified after April 9 2020, 9 am UTC+0 delivery_client.items('system.last_modified'.greaterThan('2020-05-09T09:00:00.000000Z')) # Gets items released at or after April 9 2020, 7 am UTC+0 delivery_client.items('elements.release_date'.greaterThanOrEqual('2020-05-09T07:00:00Z')) # Gets items modified before April 5 2020 UTC+0; Last match would be at 2020-05-04T23:59:59 delivery_client.items('system.last_modified'.lessThan('2020-05-05')) # Gets items released at or before April 5 2020 10:30 am UTC+0 delivery_client.items('elements.release_date'.lessThanOrEqual('2020-05-05T10:30:00Z'))
    • TypeScript
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified after April 9 2020, 9 am UTC+0 deliveryClient.items<ContentItem>() .greaterThanFilter('system.last_modified', '2020-05-09T09:00:00.000000Z') .toObservable() .subscribe(response => console.log(response)); // Gets items released at or after April 9 2020, 7 am UTC+0 deliveryClient.items<ContentItem>() .greaterThanOrEqualFilter('elements.release_date', '2020-05-09T07:00:00Z') .toObservable() .subscribe(response => console.log(response)); // Gets items modified before April 5 2020 UTC+0. Last match would be at 2020-05-04T23:59:59. deliveryClient.items<ContentItem>() .lessThanFilter('system.last_modified', '2020-05-05') .toObservable() .subscribe(response => console.log(response)); // Gets items released at or before April 5 2020 10:30 am UTC+0 deliveryClient.items<ContentItem>() .lessThanOrEqualFilter('elements.release_date', '2020-05-05T10:30:00Z') .toObservable() .subscribe(response => console.log(response));
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified after April 9 2020, 9 am UTC+0 deliveryClient.items<ContentItem>() .greaterThanFilter('system.last_modified', '2020-05-09T09:00:00.000000Z') .toObservable() .subscribe(response => console.log(response)); // Gets items released at or after April 9 2020, 7 am UTC+0 deliveryClient.items<ContentItem>() .greaterThanOrEqualFilter('elements.release_date', '2020-05-09T07:00:00Z') .toObservable() .subscribe(response => console.log(response)); // Gets items modified before April 5 2020 UTC+0. Last match would be at 2020-05-04T23:59:59. deliveryClient.items<ContentItem>() .lessThanFilter('system.last_modified', '2020-05-05') .toObservable() .subscribe(response => console.log(response)); // Gets items released at or before April 5 2020 10:30 am UTC+0 deliveryClient.items<ContentItem>() .lessThanOrEqualFilter('elements.release_date', '2020-05-05T10:30:00Z') .toObservable() .subscribe(response => console.log(response));

    You can use the same approach for number elements.

    Range of dates and numbers

    To get items based on a date range, you need to specify the two datetime values using the range filter.

    • Java
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified between April 5, 2020 10:30 UTC and April 7, 2020, 7:00 UTC List<ContentItem> items = deliveryService.<ContentItem>items() .rangeFilter("system.last_modified", "2020-05-05T10:30:00", "2020-05-07T07:00:00") .get() .getItems();
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified between April 5, 2020 10:30 UTC and April 7, 2020, 7:00 UTC List<ContentItem> items = deliveryService.<ContentItem>items() .rangeFilter("system.last_modified", "2020-05-05T10:30:00", "2020-05-07T07:00:00") .get() .getItems();
    • Swift
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified between April 5, 2020 10:30 UTC and April 7, 2020, 7:00 UTC let customQuery = "items?system.last_modified[range]=2020-05-05T10:30:00,2020-05-07T07:00:00" client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified between April 5, 2020 10:30 UTC and April 7, 2020, 7:00 UTC let customQuery = "items?system.last_modified[range]=2020-05-05T10:30:00,2020-05-07T07:00:00" client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    • Java
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified between April 5, 2020 10:30 UTC and April 7, 2020, 7:00 UTC List<NameValuePair> params = DeliveryParameterBuilder.params() .filterRange("system.last_modified", "2020-05-05T10:30:00", "2020-05-07T07:00:00") .build() CompletionStage<ContentItemsListingResponse> listingResponse = deliveryClient.getItems(params);
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified between April 5, 2020 10:30 UTC and April 7, 2020, 7:00 UTC List<NameValuePair> params = DeliveryParameterBuilder.params() .filterRange("system.last_modified", "2020-05-05T10:30:00", "2020-05-07T07:00:00") .build() CompletionStage<ContentItemsListingResponse> listingResponse = deliveryClient.getItems(params);
    • JavaScript
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified between April 5, 2020 10:30 UTC and April 7, 2020, 7:00 UTC deliveryClient.items() .rangeFilter('system.last_modified', '2020-05-05T10:30:00', '2020-05-07T07:00:00') .toObservable() .subscribe(response => console.log(response));
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified between April 5, 2020 10:30 UTC and April 7, 2020, 7:00 UTC deliveryClient.items() .rangeFilter('system.last_modified', '2020-05-05T10:30:00', '2020-05-07T07:00:00') .toObservable() .subscribe(response => console.log(response));
    • C#
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified between April 5, 2020 10:30 UTC and April 7, 2020, 7:00 UTC DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new RangeFilter("system.last_modified", "2020-05-05T10:30:00", "2020-05-07T07:00:00") );
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified between April 5, 2020 10:30 UTC and April 7, 2020, 7:00 UTC DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new RangeFilter("system.last_modified", "2020-05-05T10:30:00", "2020-05-07T07:00:00") );
    • PHP
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified between April 5, 2020 10:30 UTC and April 7, 2020, 7:00 UTC $items = $client->getItems((new QueryParams()) ->range('system.last_modified', '2020-05-05T10:30:00', '2020-05-07T07:00:00'));
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified between April 5, 2020 10:30 UTC and April 7, 2020, 7:00 UTC $items = $client->getItems((new QueryParams()) ->range('system.last_modified', '2020-05-05T10:30:00', '2020-05-07T07:00:00'));
    • cURL
    # Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. # Gets items modified between April 5, 2020 10:30 UTC and April 7, 2020, 7:00 UTC curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?system.last_modified[range]=2020-05-05T10:30:00,2020-05-07T07:00:00' \ --header 'content-type: application/json'
    # Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. # Gets items modified between April 5, 2020 10:30 UTC and April 7, 2020, 7:00 UTC curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?system.last_modified[range]=2020-05-05T10:30:00,2020-05-07T07:00:00' \ --header 'content-type: application/json'
    • Ruby
    # Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. # Gets items modified between April 5, 2020 10:30 UTC and April 7, 2020, 7:00 UTC delivery_client.items('system.last_modified'.range('2020-05-05T10:30:00','2020-05-07T07:00:00'))
    # Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. # Gets items modified between April 5, 2020 10:30 UTC and April 7, 2020, 7:00 UTC delivery_client.items('system.last_modified'.range('2020-05-05T10:30:00','2020-05-07T07:00:00'))
    • TypeScript
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified between April 5, 2020 10:30 UTC and April 7, 2020, 7:00 UTC deliveryClient.items<ContentItem>() .rangeFilter('system.last_modified', '2020-05-05T10:30:00', '2020-05-07T07:00:00') .toObservable() .subscribe(response => console.log(response));
    // Note: Date & time element values are provided by users and stored with minute precision. The system.last_modified value reflects Last content change to an item and is stored with ms precision. // Gets items modified between April 5, 2020 10:30 UTC and April 7, 2020, 7:00 UTC deliveryClient.items<ContentItem>() .rangeFilter('system.last_modified', '2020-05-05T10:30:00', '2020-05-07T07:00:00') .toObservable() .subscribe(response => console.log(response));

    To get items based on a number range, you need to specify the two numbers. The numbers can be either integers like 3 or floats like 3.14.

    • Java
    // Gets items whose rating is at least 6.5 and at most 9 List<object> items = deliveryService.<object>items() .rangeFilter("elements.product_rating", "6.5", "9") .get() .getItems();
    // Gets items whose rating is at least 6.5 and at most 9 List<object> items = deliveryService.<object>items() .rangeFilter("elements.product_rating", "6.5", "9") .get() .getItems();
    • Swift
    // Gets items whose rating is at least 7 and at most 9 let customQuery = "items?elements.product_rating[range]=7,9" client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    // Gets items whose rating is at least 7 and at most 9 let customQuery = "items?elements.product_rating[range]=7,9" client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    • Java
    // Gets items whose rating is at least 6.5 and at most 9 List<NameValuePair> params = DeliveryParameterBuilder.params() .filterRange("elements.product_rating", "7.5", "9") .build(); CompletionStage<ContentItemsListingResponse> listingResponse = client.getItems();
    // Gets items whose rating is at least 6.5 and at most 9 List<NameValuePair> params = DeliveryParameterBuilder.params() .filterRange("elements.product_rating", "7.5", "9") .build(); CompletionStage<ContentItemsListingResponse> listingResponse = client.getItems();
    • JavaScript
    // Gets items whose rating is at least 6.5 and at most 9 deliveryClient.items() .rangeFilter('elements.product_rating', '6.5', '9') .toObservable() .subscribe(response => console.log(response));
    // Gets items whose rating is at least 6.5 and at most 9 deliveryClient.items() .rangeFilter('elements.product_rating', '6.5', '9') .toObservable() .subscribe(response => console.log(response));
    • C#
    // Gets items whose rating is at least 6.5 and at most 9 DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new RangeFilter("elements.product_rating", "6.5", "9") );
    // Gets items whose rating is at least 6.5 and at most 9 DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new RangeFilter("elements.product_rating", "6.5", "9") );
    • PHP
    // Gets items whose rating is at least 6.5 and at most 9 $items = $client->getItems((new QueryParams()) ->range('elements.product_rating', '6.5', '9')
    // Gets items whose rating is at least 6.5 and at most 9 $items = $client->getItems((new QueryParams()) ->range('elements.product_rating', '6.5', '9')
    • cURL
    # Gets items whose rating is at least 6.5 and at most 9 curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.product_rating[range]=6.5,9' \ --header 'content-type: application/json'
    # Gets items whose rating is at least 6.5 and at most 9 curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.product_rating[range]=6.5,9' \ --header 'content-type: application/json'
    • Ruby
    # Gets items whose rating is at least 6.5 and at most 9 delivery_client.items('elements.product_rating'.range('7', '9'))
    # Gets items whose rating is at least 6.5 and at most 9 delivery_client.items('elements.product_rating'.range('7', '9'))
    • TypeScript
    // Gets items whose rating is at least 6.5 and at most 9 deliveryClient.items<ContentItem>() .rangeFilter('elements.product_rating', '6.5', '9') .toObservable() .subscribe(response => console.log(response));
    // Gets items whose rating is at least 6.5 and at most 9 deliveryClient.items<ContentItem>() .rangeFilter('elements.product_rating', '6.5', '9') .toObservable() .subscribe(response => console.log(response));

    Text and rich text

    To get items based on the value of a text or rich text element, you need to specify the value using the equals filter.

    • Java
    // Gets items whose Title element value equals to "Hello World" List<ContentItem> items = deliveryService.<ContentItem>items() .filterEquals("elements.title", "Hello World") .get() .getItems();
    // Gets items whose Title element value equals to "Hello World" List<ContentItem> items = deliveryService.<ContentItem>items() .filterEquals("elements.title", "Hello World") .get() .getItems();
    • Swift
    // Filters items whose Title element value equals to "Hello World" let customQuery = "items?elements.title=Hello World" client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    // Filters items whose Title element value equals to "Hello World" let customQuery = "items?elements.title=Hello World" client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    • Java
    // Gets items whose Title element value equals to "Hello World" List<NameValuePair> params = DeliveryParameterBuilder.params() .filterEquals("elements.title", "Hello World") .build(); CompletionStage<ContentItemsListingResponse> listingResponse = deliveryClient.getItems(params);
    // Gets items whose Title element value equals to "Hello World" List<NameValuePair> params = DeliveryParameterBuilder.params() .filterEquals("elements.title", "Hello World") .build(); CompletionStage<ContentItemsListingResponse> listingResponse = deliveryClient.getItems(params);
    • JavaScript
    // Gets items whose Title element value equals to "Hello World" deliveryClient.items() .equalsFilter('elements.title', 'Hello World') .toObservable() .subscribe(response => console.log(response));
    // Gets items whose Title element value equals to "Hello World" deliveryClient.items() .equalsFilter('elements.title', 'Hello World') .toObservable() .subscribe(response => console.log(response));
    • C#
    // Gets items whose Title element value equals to "Hello World" DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new EqualsFilter("elements.title", "Hello World") );
    // Gets items whose Title element value equals to "Hello World" DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new EqualsFilter("elements.title", "Hello World") );
    • PHP
    // Gets items whose Title element value equals to 'Hello World' $items = $client->getItems((new QueryParams()) ->equals('elements.title', 'Hello World'));
    // Gets items whose Title element value equals to 'Hello World' $items = $client->getItems((new QueryParams()) ->equals('elements.title', 'Hello World'));
    • cURL
    # Gets items whose Title element value equals to "Hello World" curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.title=Hello World' \ --header 'content-type: application/json'
    # Gets items whose Title element value equals to "Hello World" curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.title=Hello World' \ --header 'content-type: application/json'
    • Ruby
    # Gets items whose Title element value equals to "Hello World" delivery_client.items('elements.title'.eq('Hello World'))
    # Gets items whose Title element value equals to "Hello World" delivery_client.items('elements.title'.eq('Hello World'))
    • TypeScript
    // Gets items whose Title element value equals to 'Hello World' deliveryClient.items<ContentItem>() .equalsFilter('elements.title', 'Hello World') .toObservable() .subscribe(response => console.log(response));
    // Gets items whose Title element value equals to 'Hello World' deliveryClient.items<ContentItem>() .equalsFilter('elements.title', 'Hello World') .toObservable() .subscribe(response => console.log(response));

    Taxonomy and multiple choice

    To get items tagged with specific terms, you need to specify the terms using the contains, any, or all filters.

    • Java
    // Note: Filters work with codenames of the tags. // Gets items tagged with one specific tag List<ContentItem> items = deliveryService.<ContentItem>items() .containsFilter("elements.tags", Arrays.asList("kentico")) .get() .getItems(); // Gets items tagged with a list of specific tags List<object> items = deliveryService.<object>items() .allFilter("elements.tags", Arrays.asList("kontent", "headless")) .get() .getItems(); // Gets items tagged with at least one of multiple tags List<object> items = deliveryService.<object>items() .anyFilter("elements.tags", Arrays.asList("football", "soccer")) .get() .getItems();
    // Note: Filters work with codenames of the tags. // Gets items tagged with one specific tag List<ContentItem> items = deliveryService.<ContentItem>items() .containsFilter("elements.tags", Arrays.asList("kentico")) .get() .getItems(); // Gets items tagged with a list of specific tags List<object> items = deliveryService.<object>items() .allFilter("elements.tags", Arrays.asList("kontent", "headless")) .get() .getItems(); // Gets items tagged with at least one of multiple tags List<object> items = deliveryService.<object>items() .anyFilter("elements.tags", Arrays.asList("football", "soccer")) .get() .getItems();
    • Swift
    // Note: Filters work with codenames of the tags. // Gets items tagged with one specific tag let customQuery = "items?elements.tags[contains]=kontent" // Gets items tagged with a list of specific tags // let customQuery = "items?elements.tags[all]=kontent,headless" // Gets items tagged with at least one of multiple tags // let customQuery = "items?elements.tags[any]=football,soccer" client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    // Note: Filters work with codenames of the tags. // Gets items tagged with one specific tag let customQuery = "items?elements.tags[contains]=kontent" // Gets items tagged with a list of specific tags // let customQuery = "items?elements.tags[all]=kontent,headless" // Gets items tagged with at least one of multiple tags // let customQuery = "items?elements.tags[any]=football,soccer" client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    • Java
    // Note: Filters work with codenames of the tags. // Gets items tagged with one specific tag List<NameValuePair> params1 = DeliveryParameterBuilder.params() .filterContains("elements.tags", "kontent") .build(); CompletionStage<ContentItemsListingResponse> listingResponse1 = deliveryClient.getItems(params1); // Gets items tagged with a list of specific tags List<NameValuePair> params2 = DeliveryParameterBuilder.params() .filterAll("elements.tags", "kontent", "headless") .build(); CompletionStage<ContentItemsListingResponse> listingResponse2 = deliveryClient.getItems(params2); // Gets items tagged with at least one of multiple tags List<NameValuePair> params3 = DeliveryParameterBuilder.params() .filterAny("elements.tags", "football", "soccer") .build(); CompletionStage<ContentItemsListingResponse> listingResponse3 = deliveryClient.getItems(params3);
    // Note: Filters work with codenames of the tags. // Gets items tagged with one specific tag List<NameValuePair> params1 = DeliveryParameterBuilder.params() .filterContains("elements.tags", "kontent") .build(); CompletionStage<ContentItemsListingResponse> listingResponse1 = deliveryClient.getItems(params1); // Gets items tagged with a list of specific tags List<NameValuePair> params2 = DeliveryParameterBuilder.params() .filterAll("elements.tags", "kontent", "headless") .build(); CompletionStage<ContentItemsListingResponse> listingResponse2 = deliveryClient.getItems(params2); // Gets items tagged with at least one of multiple tags List<NameValuePair> params3 = DeliveryParameterBuilder.params() .filterAny("elements.tags", "football", "soccer") .build(); CompletionStage<ContentItemsListingResponse> listingResponse3 = deliveryClient.getItems(params3);
    • JavaScript
    // Note: Filters work with codenames of the tags. // Gets items tagged with one specific tag deliveryClient.items() .containsFilter('elements.tags', ['kontent']) .toObservable() .subscribe(response => console.log(response)); // Gets items tagged with a list of specific tags deliveryClient.items() .allFilter('elements.tags', ['kontent', 'headless']) .toObservable() .subscribe(response => console.log(response)); // Gets items tagged with at least one tag from the list deliveryClient.items() .anyFilter('elements.tags', ['football', 'soccer']) .toObservable() .subscribe(response => console.log(response));
    // Note: Filters work with codenames of the tags. // Gets items tagged with one specific tag deliveryClient.items() .containsFilter('elements.tags', ['kontent']) .toObservable() .subscribe(response => console.log(response)); // Gets items tagged with a list of specific tags deliveryClient.items() .allFilter('elements.tags', ['kontent', 'headless']) .toObservable() .subscribe(response => console.log(response)); // Gets items tagged with at least one tag from the list deliveryClient.items() .anyFilter('elements.tags', ['football', 'soccer']) .toObservable() .subscribe(response => console.log(response));
    • C#
    // Note: Filters work with codenames of the tags. // Gets items tagged with one specific tag DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new ContainsFilter("elements.tags", "kontent") ); // Gets items tagged with a list of specific tags DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new AllFilter("elements.tags", "kontent", "headless") ); // Gets items tagged with at least one tag from the list DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new AnyFilter("elements.tags", "football", "soccer") );
    // Note: Filters work with codenames of the tags. // Gets items tagged with one specific tag DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new ContainsFilter("elements.tags", "kontent") ); // Gets items tagged with a list of specific tags DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new AllFilter("elements.tags", "kontent", "headless") ); // Gets items tagged with at least one tag from the list DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new AnyFilter("elements.tags", "football", "soccer") );
    • PHP
    // Note: Filters work with codenames of the tags. // Gets items tagged with one specific tag $items = $client->getItems((new QueryParams()) ->contains('elements.tags', ['kontent']) // Gets items tagged with a list of specific tags $items = $client->getItems((new QueryParams()) ->all('elements.tags', ['kontent'], ['headless']) // Gets items tagged with at least one of multiple tags $items = $client->getItems((new QueryParams()) ->any('elements.tags', ['football'], ['soccer'])
    // Note: Filters work with codenames of the tags. // Gets items tagged with one specific tag $items = $client->getItems((new QueryParams()) ->contains('elements.tags', ['kontent']) // Gets items tagged with a list of specific tags $items = $client->getItems((new QueryParams()) ->all('elements.tags', ['kontent'], ['headless']) // Gets items tagged with at least one of multiple tags $items = $client->getItems((new QueryParams()) ->any('elements.tags', ['football'], ['soccer'])
    • cURL
    # Note: Filters work with codenames of the tags. # Gets items tagged with one specific tag curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.tags[contains]=kontent' \ --header 'content-type: application/json' # Gets items tagged with a list of specific tags curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.tags[all]=kontent,headless' \ --header 'content-type: application/json' # Gets items tagged with at least one of multiple tags curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.tags[any]=football,soccer' \ --header 'content-type: application/json'
    # Note: Filters work with codenames of the tags. # Gets items tagged with one specific tag curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.tags[contains]=kontent' \ --header 'content-type: application/json' # Gets items tagged with a list of specific tags curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.tags[all]=kontent,headless' \ --header 'content-type: application/json' # Gets items tagged with at least one of multiple tags curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.tags[any]=football,soccer' \ --header 'content-type: application/json'
    • Ruby
    # Note: Filters work with codenames of the tags. # Gets itmes tagged with one specific tag delivery_client.items('elements.tags'.contains('kontent')) # Gets items tagged with a list of specific tags delivery_client.items('elements.tags'.any('football', 'soccer')) # Gets items tagged with at least one of multiple tags delivery_client.items('elements.tags'.contains('mvc', 'kontent', 'headless'))
    # Note: Filters work with codenames of the tags. # Gets itmes tagged with one specific tag delivery_client.items('elements.tags'.contains('kontent')) # Gets items tagged with a list of specific tags delivery_client.items('elements.tags'.any('football', 'soccer')) # Gets items tagged with at least one of multiple tags delivery_client.items('elements.tags'.contains('mvc', 'kontent', 'headless'))
    • TypeScript
    // Note: Filters work with codenames of the tags. // Gets items tagged with one specific tag deliveryClient.items<ContentItem>() .containsFilter('elements.tags', ['kontent']) .toObservable() .subscribe(response => console.log(response)); // Gets items tagged with a list of specific tags deliveryClient.items<ContentItem>() .allFilter('elements.tags', ['kontent', 'headless']) .toObservable() .subscribe(response => console.log(response)); // Gets items tagged with at least one tag from the list deliveryClient.items<ContentItem>() .anyFilter('elements.tags', ['football', 'soccer']) .toObservable() .subscribe(response => console.log(response));
    // Note: Filters work with codenames of the tags. // Gets items tagged with one specific tag deliveryClient.items<ContentItem>() .containsFilter('elements.tags', ['kontent']) .toObservable() .subscribe(response => console.log(response)); // Gets items tagged with a list of specific tags deliveryClient.items<ContentItem>() .allFilter('elements.tags', ['kontent', 'headless']) .toObservable() .subscribe(response => console.log(response)); // Gets items tagged with at least one tag from the list deliveryClient.items<ContentItem>() .anyFilter('elements.tags', ['football', 'soccer']) .toObservable() .subscribe(response => console.log(response));

    Use the same approach to get items based on a specific value or values of multiple choice elements.

    URL slug

    URL slug value is stored in the same way as text or rich text. This means the approach to get items by a specific URL slug is the same, using the equals filter.

    • Java
    // Gets items whose URL slug equals to sample-url-slug List<object> items = deliveryService.<object>items() .equalsFilter("elements.url_slug", "sample-url-slug") .get() .getItems();
    // Gets items whose URL slug equals to sample-url-slug List<object> items = deliveryService.<object>items() .equalsFilter("elements.url_slug", "sample-url-slug") .get() .getItems();
    • Swift
    // Gets items whose URL slug equals to sample-url-slug let customQuery = "items?elements.url_slug=sample-url-slug" client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    // Gets items whose URL slug equals to sample-url-slug let customQuery = "items?elements.url_slug=sample-url-slug" client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    • Java
    // Gets items whose URL slug equals to sample-url-slug List<NameValuePair> params = DeliveryParameterBuilder.params() .filterEquals("elements.url_slug", "sample-url-slug") .build() CompletionStage<ContentItemsListingResponse> listingResponse = deliveryClient.getItems(params);
    // Gets items whose URL slug equals to sample-url-slug List<NameValuePair> params = DeliveryParameterBuilder.params() .filterEquals("elements.url_slug", "sample-url-slug") .build() CompletionStage<ContentItemsListingResponse> listingResponse = deliveryClient.getItems(params);
    • JavaScript
    // Gets items whose URL slug equals to sample-url-slug deliveryClient.items() .equalsFilter('elements.url_slug', 'sample-url-slug') .toObservable() .subscribe(response => console.log(response));
    // Gets items whose URL slug equals to sample-url-slug deliveryClient.items() .equalsFilter('elements.url_slug', 'sample-url-slug') .toObservable() .subscribe(response => console.log(response));
    • C#
    // Gets items whose URL slug equals to sample-url-slug DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new EqualsFilter("elements.url_slug", "sample-url-slug") );
    // Gets items whose URL slug equals to sample-url-slug DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new EqualsFilter("elements.url_slug", "sample-url-slug") );
    • PHP
    // Gets items whose URL slug equals to sample-url-slug $items = $client->getItems((new QueryParams()) ->equals('elements.url_slug', 'sample-url-slug')
    // Gets items whose URL slug equals to sample-url-slug $items = $client->getItems((new QueryParams()) ->equals('elements.url_slug', 'sample-url-slug')
    • cURL
    # Gets items whose URL slug equals to sample-url-slug curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.url_slug=sample-url-slug' \ --header 'content-type: application/json'
    # Gets items whose URL slug equals to sample-url-slug curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.url_slug=sample-url-slug' \ --header 'content-type: application/json'
    • Ruby
    # Gets items whose URL slug equals to sample-url-slug delivery_client.items('elements.url_slug'.eq('sample-url-slug'))
    # Gets items whose URL slug equals to sample-url-slug delivery_client.items('elements.url_slug'.eq('sample-url-slug'))
    • TypeScript
    // Gets items whose URL slug equals to sample-url-slug deliveryClient.items<ContentItem>() .equalsFilter('elements.url_slug', 'sample-url-slug') .toObservable() .subscribe(response => console.log(response));
    // Gets items whose URL slug equals to sample-url-slug deliveryClient.items<ContentItem>() .equalsFilter('elements.url_slug', 'sample-url-slug') .toObservable() .subscribe(response => console.log(response));

    To ensure you get content in a specific language, use the language parameter in your requests.

    Author of an article and other relationships

    When you link multiple items together you might want to retrieve items based on the relationships.

    For example, you can have several articles written by a single author, Jane. Each article has a linked items element named Author. This element contains a reference to a content item that represents the author Jane. The reference in the Author element is stored as a codename of the Jane content item.

    • Java
    // Gets items attributed to Jane. List<ContentItem> items = deliveryService.<ContentItem>items() .containsFilter("elements.author", Arrays.asList("jane_doe")) .get() .getItems(); // Gets items attributed to at least Jane, John, or both. List<ContentItem> items = deliveryService.<ContentItem>items() .anyFilter("elements.author", Arrays.asList("jane_doe", "john_wick")) .get() .getItems();
    // Gets items attributed to Jane. List<ContentItem> items = deliveryService.<ContentItem>items() .containsFilter("elements.author", Arrays.asList("jane_doe")) .get() .getItems(); // Gets items attributed to at least Jane, John, or both. List<ContentItem> items = deliveryService.<ContentItem>items() .anyFilter("elements.author", Arrays.asList("jane_doe", "john_wick")) .get() .getItems();
    • Swift
    // Gets items attributed to Jane. let customQuery = "items?elements.author[contains]=jane_doe" // Gets items attributed to at least Jane, John, or both. // let customQuery = "items?elements.author[any]=jane_doe,john_wick" client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    // Gets items attributed to Jane. let customQuery = "items?elements.author[contains]=jane_doe" // Gets items attributed to at least Jane, John, or both. // let customQuery = "items?elements.author[any]=jane_doe,john_wick" client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    • Java
    // Gets items attributed to Jane. List<NameValuePair> params1 = DeliveryParameterBuilder.params() .filterContains("elements.author", "jane_doe") .build(); CompletionStage<ContentItemsListingResponse> listingResponse1 = deliveryClient.getItems(params1); // Gets items attributed to at least Jane, John, or both. List<NameValuePair> params2 = DeliveryParameterBuilder.params() .filterAny("elements.authors", "jane_doe", "john_wick") .build(); CompletionStage<ContentItemsListingResponse> listingResponse2 = deliveryClient.getItems(params2);
    // Gets items attributed to Jane. List<NameValuePair> params1 = DeliveryParameterBuilder.params() .filterContains("elements.author", "jane_doe") .build(); CompletionStage<ContentItemsListingResponse> listingResponse1 = deliveryClient.getItems(params1); // Gets items attributed to at least Jane, John, or both. List<NameValuePair> params2 = DeliveryParameterBuilder.params() .filterAny("elements.authors", "jane_doe", "john_wick") .build(); CompletionStage<ContentItemsListingResponse> listingResponse2 = deliveryClient.getItems(params2);
    • JavaScript
    // Gets items attributed to Jane. deliveryClient.items() .containsFilter('elements.author', ['jane_doe']) .toObservable() .subscribe(response => console.log(response)); // Gets items attributed to at least Jane, John, or both. deliveryClient.items() .anyFilter('elements.author', ['jane_doe', 'john_wick']) .toObservable() .subscribe(response => console.log(response));
    // Gets items attributed to Jane. deliveryClient.items() .containsFilter('elements.author', ['jane_doe']) .toObservable() .subscribe(response => console.log(response)); // Gets items attributed to at least Jane, John, or both. deliveryClient.items() .anyFilter('elements.author', ['jane_doe', 'john_wick']) .toObservable() .subscribe(response => console.log(response));
    • C#
    // Gets items attributed to Jane. DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new ContainsFilter("elements.author", "jane_doe") ); // Gets items attributed to at least Jane, John, or both. DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new AnyFilter("elements.author", "jane_doe", "john_wick") );
    // Gets items attributed to Jane. DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new ContainsFilter("elements.author", "jane_doe") ); // Gets items attributed to at least Jane, John, or both. DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new AnyFilter("elements.author", "jane_doe", "john_wick") );
    • PHP
    // Gets items attributed to Jane. $items = $client->getItems((new QueryParams()) ->contains('elements.author', ['jane_doe'])); // Gets items attributed to at least Jane, John, or both. $items = $client->getItems((new QueryParams()) ->any('elements.author', ['jane_doe'], ['john_wick']));
    // Gets items attributed to Jane. $items = $client->getItems((new QueryParams()) ->contains('elements.author', ['jane_doe'])); // Gets items attributed to at least Jane, John, or both. $items = $client->getItems((new QueryParams()) ->any('elements.author', ['jane_doe'], ['john_wick']));
    • cURL
    # Gets items attributed to Jane. curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.author[contains]=jane_doe' \ --header 'content-type: application/json' # Gets items attributed to at least Jane, John, or both. curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.author[any]=jane_doe,john_wick' \ --header 'content-type: application/json'
    # Gets items attributed to Jane. curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.author[contains]=jane_doe' \ --header 'content-type: application/json' # Gets items attributed to at least Jane, John, or both. curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.author[any]=jane_doe,john_wick' \ --header 'content-type: application/json'
    • Ruby
    # Gets items attributed to Jane. delivery_client.items('elements.author'.contains('jane_doe')) # Gets items attributed to at least Jane, John, or both. delivery_client.items('elements.author'.any('jane_doe', 'john_wick'))
    # Gets items attributed to Jane. delivery_client.items('elements.author'.contains('jane_doe')) # Gets items attributed to at least Jane, John, or both. delivery_client.items('elements.author'.any('jane_doe', 'john_wick'))
    • TypeScript
    // Gets items attributed to Jane. deliveryClient.items<ContentItem>() .containsFilter('elements.author', ['jane_doe']) .toObservable() .subscribe(response => console.log(response)); // Gets items attributed to at least Jane, John, or both. deliveryClient.items<ContentItem>() .anyFilter('elements.author', ['jane_doe', 'john_wick']) .toObservable() .subscribe(response => console.log(response));
    // Gets items attributed to Jane. deliveryClient.items<ContentItem>() .containsFilter('elements.author', ['jane_doe']) .toObservable() .subscribe(response => console.log(response)); // Gets items attributed to at least Jane, John, or both. deliveryClient.items<ContentItem>() .anyFilter('elements.author', ['jane_doe', 'john_wick']) .toObservable() .subscribe(response => console.log(response));

    Subpages

    When using Web Spotlight to manage your website content, you can retrieve subpages the same way as your linked items.

    For example, you can have various insurance-related pages linked in multiple places on your website. To get the pages that reference the Travel insurance page in a subpages element called Subpages, use the contains filter in your request.

    • Java
    // Gets pages linking travel insurance as their subpage. List<ContentItem> items = deliveryService.<ContentItem>items() .containsFilter("elements.subpages", Arrays.asList("travel_insurance")) .get() .getItems(); // Gets pages linking at least travel insurance, car insurance, or both as their subpage. List<ContentItem> items = deliveryService.<ContentItem>items() .anyFilter("elements.subpages", Arrays.asList("travel_insurance", "car_insurance")) .get() .getItems();
    // Gets pages linking travel insurance as their subpage. List<ContentItem> items = deliveryService.<ContentItem>items() .containsFilter("elements.subpages", Arrays.asList("travel_insurance")) .get() .getItems(); // Gets pages linking at least travel insurance, car insurance, or both as their subpage. List<ContentItem> items = deliveryService.<ContentItem>items() .anyFilter("elements.subpages", Arrays.asList("travel_insurance", "car_insurance")) .get() .getItems();
    • Swift
    // Gets pages linking travel insurance as their subpage. let customQuery = "items?elements.subpages[contains]=travel_insurance" // Gets pages linking at least travel insurance, car insurance, or both as their subpage. // let customQuery = "items?elements.subpages[any]=travel_insurance,car_insurance" client.getItems(modelType: Page.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let pages = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    // Gets pages linking travel insurance as their subpage. let customQuery = "items?elements.subpages[contains]=travel_insurance" // Gets pages linking at least travel insurance, car insurance, or both as their subpage. // let customQuery = "items?elements.subpages[any]=travel_insurance,car_insurance" client.getItems(modelType: Page.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let pages = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    • Java
    // Gets pages linking travel insurance as their subpage. List<NameValuePair> params1 = DeliveryParameterBuilder.params() .filterContains("elements.subpages", "travel_insurance") .build(); CompletionStage<ContentItemsListingResponse> listingResponse1 = deliveryClient.getItems(params1); // Gets pages linking at least travel insurance, car insurance, or both as their subpage. List<NameValuePair> params2 = DeliveryParameterBuilder.params() .filterAny("elements.subpages", "travel_insurance", "car_insurance") .build(); CompletionStage<ContentItemsListingResponse> listingResponse2 = deliveryClient.getItems(params2);
    // Gets pages linking travel insurance as their subpage. List<NameValuePair> params1 = DeliveryParameterBuilder.params() .filterContains("elements.subpages", "travel_insurance") .build(); CompletionStage<ContentItemsListingResponse> listingResponse1 = deliveryClient.getItems(params1); // Gets pages linking at least travel insurance, car insurance, or both as their subpage. List<NameValuePair> params2 = DeliveryParameterBuilder.params() .filterAny("elements.subpages", "travel_insurance", "car_insurance") .build(); CompletionStage<ContentItemsListingResponse> listingResponse2 = deliveryClient.getItems(params2);
    • JavaScript
    // Gets pages linking travel insurance as their subpage. deliveryClient.items() .containsFilter('elements.subpages', ['travel_insurance']) .toObservable() .subscribe(response => console.log(response)); // Gets pages linking at least travel insurance, car insurance, or both as their subpage. deliveryClient.items() .anyFilter('elements.subpages', ['travel_insurance', 'car_insurance']) .toObservable() .subscribe(response => console.log(response));
    // Gets pages linking travel insurance as their subpage. deliveryClient.items() .containsFilter('elements.subpages', ['travel_insurance']) .toObservable() .subscribe(response => console.log(response)); // Gets pages linking at least travel insurance, car insurance, or both as their subpage. deliveryClient.items() .anyFilter('elements.subpages', ['travel_insurance', 'car_insurance']) .toObservable() .subscribe(response => console.log(response));
    • C#
    // Gets pages linking travel insurance as their subpage. DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new ContainsFilter("elements.subpages", "travel_insurance") ); // Gets pages linking at least travel insurance, car insurance, or both as their subpage. DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new AnyFilter("elements.subpages", "travel_insurance", "car_insurance") );
    // Gets pages linking travel insurance as their subpage. DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new ContainsFilter("elements.subpages", "travel_insurance") ); // Gets pages linking at least travel insurance, car insurance, or both as their subpage. DeliveryItemListingResponse<object> response = await deliveryClient.GetItemsAsync<object>( new AnyFilter("elements.subpages", "travel_insurance", "car_insurance") );
    • PHP
    // Gets pages linking travel insurance as their subpage. $items = $client->getItems((new QueryParams()) ->contains('elements.subpages', ['travel_insurance'])); // Gets pages linking at least travel insurance, car insurance, or both as their subpage. $items = $client->getItems((new QueryParams()) ->any('elements.subpages', ['travel_insurance'], ['car_insurance']));
    // Gets pages linking travel insurance as their subpage. $items = $client->getItems((new QueryParams()) ->contains('elements.subpages', ['travel_insurance'])); // Gets pages linking at least travel insurance, car insurance, or both as their subpage. $items = $client->getItems((new QueryParams()) ->any('elements.subpages', ['travel_insurance'], ['car_insurance']));
    • cURL
    # Gets pages linking travel insurance as their subpage. curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.subpages[contains]=travel_insurance' \ --header 'content-type: application/json' # Gets pages linking at least travel insurance, car insurance, or both as their subpage. curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.subpages[any]=travel_insurance,car_insurance' \ --header 'content-type: application/json'
    # Gets pages linking travel insurance as their subpage. curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.subpages[contains]=travel_insurance' \ --header 'content-type: application/json' # Gets pages linking at least travel insurance, car insurance, or both as their subpage. curl --request GET \ --url 'https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items?elements.subpages[any]=travel_insurance,car_insurance' \ --header 'content-type: application/json'
    • Ruby
    # Gets pages linking travel insurance as their subpage. delivery_client.items('elements.subpages'.contains('travel_insurance')) # Gets pages linking at least travel insurance, car insurance, or both as their subpage. delivery_client.items('elements.subpages'.any('travel_insurance', 'car_insurance'))
    # Gets pages linking travel insurance as their subpage. delivery_client.items('elements.subpages'.contains('travel_insurance')) # Gets pages linking at least travel insurance, car insurance, or both as their subpage. delivery_client.items('elements.subpages'.any('travel_insurance', 'car_insurance'))
    • TypeScript
    // Gets pages linking travel insurance as their subpage. deliveryClient.items<ContentItem>() .containsFilter('elements.subpages', ['travel_insurance']) .toObservable() .subscribe(response => console.log(response)); // Gets pages linking at least travel insurance, car insurance, or both as their subpage. deliveryClient.items<ContentItem>() .anyFilter('elements.subpages', ['travel_insurance', 'car_insurance']) .toObservable() .subscribe(response => console.log(response));
    // Gets pages linking travel insurance as their subpage. deliveryClient.items<ContentItem>() .containsFilter('elements.subpages', ['travel_insurance']) .toObservable() .subscribe(response => console.log(response)); // Gets pages linking at least travel insurance, car insurance, or both as their subpage. deliveryClient.items<ContentItem>() .anyFilter('elements.subpages', ['travel_insurance', 'car_insurance']) .toObservable() .subscribe(response => console.log(response));

    What's next?