Access site through APIs

In Acoustic Content, you can map individual sites to individual hostnames. The sites can be managed with the authoring sites service API. After you set a domain name, either your custom domain or the Acoustic provided shared domain for your site, Content defines the base URLs for doing API calls and accessing static resources of your site. Every API call to Content can run in the context of the site, where individual APIs can scope their results to the site identified by the site context. When you access a domain that is mapped to a site, Content automatically associates a corresponding site context to all API calls routed through that domain.

Before you begin

To get started, you need:

Address your site content through the API base URL

The API base URL is the base to use for making API calls and has the format of https://your_domain/

For example, the API base URL format:

You can use the API base URL to initialize your wchtools client for scripting access to Content. If you are using multiple domain names, you can use any of your domains. All domains serve the same data except for site-aware delivery APIs. The dedicated routes of site-aware delivery APIs allow access to the specific site context that is associated with the used domain. For more information, see the API documentation.

Access your site content through the resource base URL

The resource base URL is used to directly serve your web assets and managed assets by path and has the format of https://your_domain/.

For example, the resource base URL format:

The resource base URL also addresses your JavaScript application that is hosted on your Content. All domains serve the same resources, but your JavaScript application can use site-aware API calls to open dedicated websites based on the site mapping of the domain.

📘

Note:

As soon as you created your first custom domain, the initial host content-XX-cms.content-cms.com that was assigned to you during onboarding is no longer available.

Addressing sites for any domain through URL path

Calling Content APIs in site context is not limited to using a custom domain to site mappings. It is also possible to address any site on any domain by using a corresponding site-specific base URL.
You can extend the global base URLs (API base URL: https://greenwheels.com/api/ and resource base URL: https://greenwheels.com/) used to call Content APIs in the context of a specific site independent of the domain you are using.

The extension consists of a URL path fragment of the following format "/dxsites/<site.contextRoot>" or "/dxsites/<site.siteId>.

For example for addressing a site with context root "site1" on a initial shared host you can use base URLs like this:

Or with custom domains:

Expected outcome

Whether you map your content to a custom domain name, use the default domain, or the Acoustic provided shared host, you can access your site in a web browser and their static resources through the Content APIs.