---
schema_version: "1"
id: 78914e4f404579e83b2d180c40d5b46e23a11077006b53ed3e7e972a1497384d
title: "SDK Example: getCatalogOffers with the contains parameter (Fall '20 version)"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/comms-t-sdk-examplegetcatalogoffers-with-the-containsparameterfall20-version-.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-t-sdk-examplegetcatalogoffers-with-the-containsparameterfall20-version-.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: fc1e62d6f692f4b41cea29c5ee9c93c7c0cd154bf61a8fcf38e4b81d0c6ce5c2
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# SDK Example: getCatalogOffers with the contains parameter (Fall '20 version)

Use the example SDK code in this topic to obtain catalog offers with the `contains` parameter.

```nolang
// Instantiate the input object for getOffers to specify parameters
const input = digitalCommerce.createGetOffersInput();
input.catalogCode = "Phones"; // use your Catalog Code
input.offset = 0; // use for pagination - optional
input.pageSize = 5; // use for pagination - optional
input.contains = "iPhone8"; // find all offers that CONTAIN "iPhone8" - optional
input.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys
input.secureApiCall = false; // set to true if needs secure api calls without context parameters and session key.

// Invoke GetContainsProducts API via method getOffers()
digitalCommerce
 .getOffers(input)
 .then(result => {
   Logger.info("vlocity get offers anonymous user rest call" + result);
 })
 .catch(error => {
   Logger.info("get offers anonymous user rest call failed" + error);
 });
```

Possible error conditions:

"GetOffersInput::getAPIPath() must have catalogCode."

"GetOffersContainsInput::getAPIPath() should not have both sortBy and contains."

"GetOffersInput::getAnonymousRestUrl() must have catalogCode."

"GetOffersContainsInput::getAnonymousRestUrl() should not have both sortBy and contains."
