Broadleaf Microservices
  • v1.0.0-latest-prod

Browse Entity

Used to resolve some browse entity without knowing beforehand which type will be returned. This is useful if the caller has a URI that can match a Category, Product, or Content but don’t know before hand which entity will be returned.

Resolve Browse Entity

Operation

BrowseClient#resolveBrowseEntity(request, options);

Parameters

Parameter Type Required? Description

request

BrowseEntityRequest

The request details ("uris" to resolve against)

options

BrowseClientCallOptions

Options passed to the HTTP request call to customize the request configuration.

Response

This function returns a BrowseEntityResponse.

Example

Example of retrieving a blog content item by its uri
const response = await browseClient.resolveBrowseEntity({
  uris: ['/blog/blog-post-one']
});

console.log(response);

Get Bulk Content Items

Operation

BrowseClient#getBulkContentItems(request, options);

Parameters

Parameter Type Required? Description

request

BulkContentResolverRequest

Represents a request to retrieve bulk ContentItems from a commerce-facing context.

options

ContentClientCallOptions

Options passed to the HTTP request call to customize the request configuration.

Response

This function returns a BulkContentResolverResponse.

Example

Example of retrieving a blog content item by its uri
const response = await browseClient.getBulkContentItems({
          contentResolverRequests: [
            {
              requestId: 'one',
              modelName: 'Banner Image',
            },
            {
              requestId: 'two',
              modelName: 'Landing Page',
            },
          ],
        },
        {
          locale,
          accessToken,
        });

console.log(response);