Salesforce B2C Commerce 23.6 > Open Commerce API 23.2 > OCAPI Usage 23.2

API Explorer 23.2

The API Explorer tool allows application developers to interactively explore the Open Commerce APIs in a few ways:

It is built on Swagger-UI and uses Swagger 2.0 specs that get delivered by the meta APIs.

Log in to API Explorer

Select a Different Instance

You can connect API Explorer to a different system as follows:

  1. Enter the target system URL in the field at the top of the page. For example, if the instance is at sandbox_domain.net, the URL might be https://sandbox_domain.net/s/-/dw/meta/v1/rest.
  2. Click Authorize. This opens the Available Authorizations popup.
  3. Click Logout.
  4. Enter the appropriate Client ID and Password for the system and click Authorize.
  5. Click Dismiss to close the popup.
  6. Click Explore to load the metadata from the new target system.

Browse APIs

The navigation bar at the top of the page includes dropdown lists for selecting the specific API and version. Selecting an API refreshes the values available in the version dropdown. For OCAPI, you can view any version of the Data, Shop, or Meta APIs. Here are some usage examples:

Try an HTTP request

Here's an example of launching a request from the explorer.

  1. Select data from the Select API dropdown list. This refreshes the page so the Select API Version dropdown includes the available versions for the Data API.
  2. Select 23.2 from the Select API Version dropdown list. This displays the resources in the Data API version 23.2.
  3. Select the catalogs resource. It expands to display the available endpoints.
  4. Select the GET /catalogs/{catalog_id} operation. It expands to display the details of this endpoint.
  5. Enter electronics-catalog in the catalog_id parameter.
  6. Launch the request by clicking Try it out! The request and response are displayed. A successful call returns HTTP response code 200 and information about the specified catalog.
    Note: You can copy the Curl request displayed here and paste it directly into a terminal.

Running requests against sandboxes using the Shop API

You can use the Shop API to launch HTTP requests against specific sandboxes. To do that, enter the site ID of the sandbox (e.g., SiteGenesis) in the Write Site Id field.
Note: The Write Site Id field is only visible when shop is selected from the API dropdown.

Log out

You may need to log out in order to use different client credentials. Follow these steps to log out:

  1. Click Authorize at the top of the page. This opens the Available Authorizations dialog.
  2. Click Logout in the dialog. This refreshes the page.
X OCAPI versions 15.x and 16.x will be retired on March 31, 2021. For dates and more information, see the OCAPI versioning and deprecation policy and this Knowledge Article.
X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.