GET Read a custom object using its object type ID and its unique key attribute value.
GET /organizations/{organizationId}/custom-objects/{objectType}/{key}
Operation ID: getCustomObject. Security: ShopperToken (sfcc.shopper-custom-objects, sfcc.shopper-custom-objects.{objectType}); ShopperClientContextToken (sfcc.shopper-custom-objects, sfcc.shopper-custom-objects.{objectType}).
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_prdsiteId(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
USobjectType(path, string, required) The object type of custom object.
Minimum length: 1. Example:Test_Integer.key(path, string, required) The key to identify the custom object.
Minimum length: 1. Example:1.sfdc_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. When set tonone, the server skips applying personalization to the response.
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
Custom object retrieved successfully.
Media type:
application/json. Schema:CustomObject.Example: CustomObjectResultExample
{ "keyProperty": "global_key", "objectType": "Global_String", "c_BooleanAttribute": true, "c_DateAttribute": "2015-02-03", "c_DateTimeAttribute": "2015-02-20T01:00:00.000Z", "c_EmailAttribute": "tralala@gmail.com", "c_HtmlAttribute": "<html>\r\n<head><title>some title</title></head>\r\n<body>the body</body>\r\n</html>", "c_ImageAttribute": "https://whatever/on/demandware.static/-/Sites/default/v0/home/user/images/image.gif", "c_IntegerAttribute": 42, "c_IntegerEnumAttribute": 3, "c_IntegerSetAttribute": [ 1, 2 ], "c_NumberAttribute": 42, "c_NumberSetAttribute": [ 1, 1.1 ], "c_PasswordAttribute": "UUIG6ydSpJtdBbYDb1JMd7jgiA1rwYmQTzB5AEvz/YjorR6cIl19cu1IN6H/i/Ol", "c_StringAttribute": "Tralala", "c_StringEnumAttribute": "Value3", "c_StringSetAttribute": [ "string1", "string2" ], "c_TextAttribute": "This is a text, which is not very meaningful." } - 400
Bad request
Media type:
application/problem+json. Schema:ErrorResponse.Example: MalformedKeyParameter
{ "title": "Malformed Key Parameter", "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/malformed-key-parameter", "detail": "The format of path parameter 'gdd' for data type 'integer' is invalid.", "value": "gdd", "parameter": "integer" } - 401
Unauthorized
Media type:
application/problem+json. Schema:ErrorResponse.Example: Unauthorized
{ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/unauthorized", "title": "Unauthorized", "detail": "Your access token is invalid or expired and can’t be used to identify a user.", "accessToken": "hbGciOiJIUzI1NiIsenR5cCI6Ikp" } - 404
Not found
Media type:
application/problem+json. Schema:ErrorResponse.Example: CustomObjectNotFound
{ "title": "Custom Object Not Found", "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/custom-object-not-found", "detail": "No custom object with key '2213' for object type 'Test_Integer' could be found.", "key": "2213", "objectType": "Test_Integer" }Example: ObjectTypeNotFound
{ "title": "Object Type Not Found", "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/object-type-not-found", "detail": "No object type with ID 'Test_Integer1' could be found.", "objectType": "Test_Integer1" }