Context

Context represents the information about the project locales and the deployment environment.

Get locales and environment information

Response Representation: ProjectContext. It returns information about the project locales setup and the environment in which the requested host acts in.'

GET
https://PROJECT_NAME-COMPANY_NAME.frontastic.TLD/frontastic/context

Returns information about the project locales setup and the environment in which the requested host acts in.

Headers:

  • Accept - application/json - Required
  • Commercetools-Frontend-Extension-Version - Extension version - Required
Path parameters:
PROJECT_NAME
String

Project Name

COMPANY_NAME
String

Company Name

TLD
String

The top-level domain for the environment, which includes .live, .io, and .rocks. For more information, see Hosts.

Response:
200ProjectContextasapplication/json
Request Example:cURL
curl --get https://PROJECT_NAME-COMPANY_NAME.frontastic.TLD/frontastic/context -i \
--header 'Accept: ${ACCEPT}'\
--header 'extension-version: ${EXTENSION_VERSION}'
200 Response Example: ProjectContextjson
{
"locales": ["de_CH", "fr_CH", "it_CH", "de_LI", "en_GB"],
"defaultLocale": "de_CH",
"environment": "development"
}