CustomObjects Resource (Shop API 15.6)

Summary

Http Method Resource Description
GET /Custom_objects/{Object_type}/{Key} Reads a custom object with a given object type ID and a value for the key attribute of the object which represents its unique identifier.

Read Custom Object

Reads a custom object with a given object type ID and a value for the key attribute of the object which represents its unique identifier.

Url

GET http://hostname:port/dw/shop/v15_6/custom_objects/{object_type}/{key}

Formats

json, xml

Authentication

Name Description
None No authentication.

Response Document

CustomObject

Path Parameters

Parameter Type Description Constraints
key String the key attribute value of the custom object minLength=1, nullable=false
object_type String the ID of the object type minLength=1, nullable=false

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 MalformedKeyParameterException

value (String)

parameter (String)

If the object key must be an integer, but the path parameter has an invalid format
404 ObjectTypeNotFoundException

objectType (String)

For an unknown object type ID
404 CustomObjectNotFoundException

key (String)

objectType (String)

If the custom object cannot be found

Sample

REQUEST:
GET /dw/shop/v15_6/custom_objects/my_object_type/key_0815 HTTP/1.1
Host: sitegenesis.com
Accept: application/json

# in case of success:

RESPONSE:
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Cache-Control: max-age=900,must-revalidate
{
  "_v" : "15.6",
   "_type" : "custom_object",
   "object_type":"my_object_type",
   "key_property":"key_attribute",
   "c_boolean":true,
   "c_date":"2015-02-03T00:00:00.000Z",
   "c_email":"[email protected]",
   "c_integer":42,
   "c_number":42.0,
   "c_string":"some text"
}

# in case of failure:
 
RESPONSE:
HTTP/1.1 404 Requested resource not found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"15.6",
   "_type":"fault",
  "fault":
  {
    "type":"NotFoundException",
    "message":"No custom object with key 'key_0815' found for object type 'my_object_type'."
  }
}