GET Get URL mapping information for a URL segment.
GET /organizations/{organizationId}/url-mapping
Operation ID: getUrlMapping. Security: ShopperToken (sfcc.shopper-seo); ShopperClientContextToken (sfcc.shopper-seo).
The mapping information is based on URL rules and redirects that are set up in Business Manager. For more information about prerequisites and sample usage, see URL Resolution. You can customize the behavior of this endpoint by using hooks. For details, refer to the Hook List.
Parameters
organizationId(path, OrganizationId, required) An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character realm identifier and a 3-character instance type identifier.Example
f_ecom_zzxy_prdurlSegment(query, string, required) The part of the requested URL that comes after the domain name. For example, the urlSegment for "www.abc.com/blue/new-arrivals/tops" is "blue/new-arrivals/tops". There's no limit on the length of the urlSegment. However, for this endpoint, the maximum allowed length of the URL (after URL encoding) is 2047 characters. Make this field URL-encoded so that it properly handles special values such as whitespace. If a urlSegment includes a query string, a 404 error code is returned.
Minimum length: 1. Maximum length: 2047. Example:mens/clothing/shorts.siteId(query, SiteId, required) The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.Example: SiteId
RefArchlocale(query, LocaleCode) A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameterAccept-Languagefollowing RFC 2616 & RFC 1766. This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.Example: LanguageCountry
en-USExample: CountryCode
USsfdc_usid(header, string (uuid)) A unique shopper identifier (USID) for tracking client context. Used with endpoints secured with ShopperClientContextToken. This header is required for all endpoints secured with ShopperClientContextToken.
Example:550e8400-e29b-41d4-a716-446655440000.personalized(query, string)Controls whether personalization is applied to the response. Set to
noneto opt out of personalized response handling so the response is safe to cache at the CDN layer.When set to
none, the server skips applying personalization to the response.Setting
personalized=noneis necessary but not sufficient for CDN caching: a response is only cached when the endpoint is also cacheable in the server-side web-tier cache, subject to its TTLs and invalidation. A call that is uncacheable in the web tier is not cached at the CDN either. See CDN caching.
Allowed values:none. Example:none.sfdc_shopper_context(header, string) Shopper context information (for example clientIP, sourceCode, and customQualifiers) passed in from a trusted backend application.
Responses
- 200
Returns URL mapping information for a URL that a shopper entered or selected.
Media type:
application/json. Schema:UrlMapping.Example: UrlMappingCategory URL mapped to a category with refinements.
{ "resourceType": "CATEGORY", "resourceId": "new-arrivals-tops", "refinements": { "refinementColor": "Blue" } }Example: UrlMappingProduct URL mapped to a product.
{ "resourceType": "PRODUCT", "resourceId": "25695327M" }Example: UrlMappingContentAsset URL mapped to a content asset.
{ "resourceType": "CONTENT_ASSET", "resourceId": "about-us" } - 400
The locale is invalid. Make sure you provide a locale using the correct format: ISO 639-1 for the language code and ISO 3166-1 for the country code. For example, en-US.
Media type:
application/problem+json. Schema:ErrorResponse.Example: getUrlMapping400
{ "title": "Unknown Locale", "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/unknown-locale", "detail": "The locale 'ab-CD' is unknown.", "locale": "ab-CD" } - 401
The user making the call isn't authorized to make this request. For example, the correct scope wasn't added to an SLAS API Client or the access token is invalid or missing.
Media type:
application/problem+json. Schema:ErrorResponse.Example: getUrlMapping401
{ "title": "Invalid Access Token", "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/invalid-access-token", "detail": "The request is unauthorized, the access token is invalid.", "accessToken": "hbGciOiJIUzI1NiIsInR5cCI6Ikp" } - 404
No mapping information for the requested URL exists because there's no corresponding URL rule in Business Manager.
Media type:
application/problem+json. Schema:ErrorResponse.Example: getUrlMapping404
{ "title": "Seo Url Mapping Not Found", "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/seo-url-mapping-not-found", "detail": "black/mens/accessories/luggage", "urlSegment": "black/mens/accessories/luggage", "locale": "en_US" }