Walkthrough: Testing a Search and Recommendation API request in the API Explorer

You can use the API Explorer tab on the Developer Resources page of the Customer Engagement Console (CEC) to build a JSON request and fetch data using the Search and Recommendation API endpoint.

This walkthrough describes how to:

  • Build a request.

  • View the request.

  • Run the request and copy the response.

Build a request

This section describes how to build a request using the Builder pane of the API Explorer. Alternatively, you can paste a request data object directly into the Request pane and click Build.

To build a request using the builder pane:

  1. In the CEC, on the menu bar, click Developer Resources.

  2. In the Builder pane, in the Page drop-down menu, click the name of the page you want to test.

    Tip

    If you want to clear a previously built request, in the Builder pane, click Reset.

  3. Optionally, click in the Widget field and select or deselect widgets to add or remove them from the request object.

  4. Optionally, enter values in the Limit and Offset fields.

    Tip

    You can use the Limit value to limit the number of results in the response or use Offset to show a different subsection of results.

  5. Optionally, if your domain uses multiple locales, under Locale, in the Country & Language drop-down menu, click a country and language.

    Note

    If you are working with a multi-locale domain and do not select a locale, the default domain locale is used automatically.

  6. Click Build. The request appears in the Request panel.

View the request

After you build a request, you should check for errors by examining the output in the Request pane. If there are any missing required keys, a warning appears above the JSON output.

To view the request:

  1. Read the request in JSON format in the Request pane of the API Explorer.

    Tip

    If the generated request is incorrect, you can fix it by entering different values in the Builder pane and then clicking Build again. Alternatively, you can directly edit the JSON in the Request pane.

  2. Optionally, to copy the request, click Copy to clipboard as... and then click your preferred format.

    Note

    You can copy the request as a data object or as a cURL object using a Sitecore host or your subdomain.

Run the request and copy the response

After creating a request, run it to make sure it is being sent correctly and that there are no errors.

To run the request and copy the response:

  1. In the Request pane, click Run.

  2. Read the response in JSON format in the Response pane of the API Explorer. You can scaffold and scroll through the response.

  3. Click Copy to clipboard as... and click Copy as data object.

Do you have some feedback for us?

If you have suggestions for improving this article,