Content Type Operations - Bloomreach Experience - The Headless Digital Experience Platform Built for Commerce

Content Type Operations

GET /core

Get all published content types in the brX instance. The returned list contains only the types that are allowed in the core (master) project in this instance.

Parameters

None

Responses

Code Description
200

OK

Media type: application/json

Schema: [ContentType]

Example:

[
  {
    "name": "exampleDoctype",
    "type": "Document",
    "presentation": {
      "layout": "two-column"
    },
    "fields": [
      {
        "name": "string",
        "required": true,
        "multiple": true,
        "type": "String",
        "defaultValue": [
          "Blogtitle1",
          "Blogtitle2"
        ],
        "validations": {
          "maxLength": 10
        },
        "presentation": {
          "caption": "Title",
          "hint": "Hint for string field",
          "layoutColumn": 1,
          "displayType": "Simple"
        }
      },
      {
        "name": "date",
        "required": true,
        "type": "Date",
        "defaultValue": [
          "2007-12-03T00:00:00.00Z"
        ],
        "presentation": {
          "caption": "Date Field",
          "hint": "Hint for date field",
          "layoutColumn": 2,
          "timeSelectable": false
        }
      }
    ],
    "system": {
      "createdBy": "admin",
      "createdAt": "2021-10-01T15:16:14.146+02:00",
      "updatedBy": "admin",
      "updatedAt": "2021-10-01T15:16:14.22+02:00"
    }
  }
]

403

Forbidden

GET /core/{content_type_name}

Get the published version of a content type by name. 

Parameters

Name Description

content_type_name *

string

(path)

Content type name

Example : mycontenttype

Responses

Code Description
200

OK

Media type: application/json

Schema: ContentType

Example:

{
  "name": "exampleDoctype",
  "type": "Document",
  "presentation": {
    "layout": "two-column"
  },
  "fields": [
    {
      "name": "string",
      "required": true,
      "multiple": true,
      "type": "String",
      "defaultValue": [
        "Blogtitle1",
        "Blogtitle2"
      ],
      "validations": {
        "maxLength": 10
      },
      "presentation": {
        "caption": "Title",
        "hint": "Hint for string field",
        "layoutColumn": 1,
        "displayType": "Simple"
      }
    },
    {
      "name": "date",
      "required": true,
      "type": "Date",
      "defaultValue": [
        "2007-12-03T00:00:00.00Z"
      ],
      "presentation": {
        "caption": "Date Field",
        "hint": "Hint for date field",
        "layoutColumn": 2,
        "timeSelectable": false
      }
    }
  ],
  "system": {
    "createdBy": "admin",
    "createdAt": "2021-10-01T15:16:14.146+02:00",
    "updatedBy": "admin",
    "updatedAt": "2021-10-01T15:16:14.22+02:00"
  }
}

Headers:

Name Description Type
X-Resource-Version

Resource's version. Must be used in any subsequent update requests of this resource

string
403

Forbidden

404

Not Found

GET /development

Get the unpublished version of all content types in the brX instance. If the returned list is empty, it means that there are no content types being currently edited. If no developer project exists, an error response is returned, prompting to create a developer project that includes document types.

Parameters

None

Responses

Code Description
200

OK

Media type: application/json

Schema: [ContentType]

Example:

[
  {
    "name": "exampleDoctype",
    "type": "Document",
    "presentation": {
      "layout": "two-column"
    },
    "fields": [
      {
        "name": "string",
        "required": true,
        "multiple": true,
        "type": "String",
        "defaultValue": [
          "Blogtitle1",
          "Blogtitle2"
        ],
        "validations": {
          "maxLength": 10
        },
        "presentation": {
          "caption": "Title",
          "hint": "Hint for string field",
          "layoutColumn": 1,
          "displayType": "Simple"
        }
      },
      {
        "name": "date",
        "required": true,
        "type": "Date",
        "defaultValue": [
          "2007-12-03T00:00:00.00Z"
        ],
        "presentation": {
          "caption": "Date Field",
          "hint": "Hint for date field",
          "layoutColumn": 2,
          "timeSelectable": false
        }
      }
    ],
    "system": {
      "createdBy": "admin",
      "createdAt": "2021-10-01T15:16:14.146+02:00",
      "updatedBy": "admin",
      "updatedAt": "2021-10-01T15:16:14.22+02:00"
    }
  }
]

403

Forbidden

GET /development/{content_type_name}

Get the unpublished version of a content type by name. If no developer project exists, an error response is returned, prompting to create a developer project that includes document types.

Parameters

Name Description

content_type_name *

string

(path)

Content type name

Example : mycontenttype

Responses

Code Description
200

OK

Media type: application/json

Schema: ContentType

Example:

{
  "name": "exampleDoctype",
  "type": "Document",
  "presentation": {
    "layout": "two-column"
  },
  "fields": [
    {
      "name": "string",
      "required": true,
      "multiple": true,
      "type": "String",
      "defaultValue": [
        "Blogtitle1",
        "Blogtitle2"
      ],
      "validations": {
        "maxLength": 10
      },
      "presentation": {
        "caption": "Title",
        "hint": "Hint for string field",
        "layoutColumn": 1,
        "displayType": "Simple"
      }
    },
    {
      "name": "date",
      "required": true,
      "type": "Date",
      "defaultValue": [
        "2007-12-03T00:00:00.00Z"
      ],
      "presentation": {
        "caption": "Date Field",
        "hint": "Hint for date field",
        "layoutColumn": 2,
        "timeSelectable": false
      }
    }
  ],
  "system": {
    "createdBy": "admin",
    "createdAt": "2021-10-01T15:16:14.146+02:00",
    "updatedBy": "admin",
    "updatedAt": "2021-10-01T15:16:14.22+02:00"
  }
}

Headers:

Name Description Type
X-Resource-Version

Resource's version. Must be used in any subsequent update requests of this resource

string
403

Forbidden

404

Not Found

PUT /development/{content_type_name}

Add or update a content type. 

Parameters

Name Description

X-Resource-Version

string

(header)

Resource's version. Must be used in any subsequent update requests of this resource. Can be obtained when GETting the resource

Example : 433cc90445d29c2356e385b9efe548b19ed86739f27eb7958a81847b9d8517c2

content_type_name *

string

(path)

Content type name

Example : mycontenttype

Request body

application/json

Schema: ContentType

Example:

{
  "name": "exampleDoctype",
  "type": "Document",
  "presentation": {
    "layout": "two-column"
  },
  "fields": [
    {
      "name": "string",
      "required": true,
      "multiple": true,
      "type": "String",
      "defaultValue": [
        "Blogtitle1",
        "Blogtitle2"
      ],
      "validations": {
        "maxLength": 10
      },
      "presentation": {
        "caption": "Title",
        "hint": "Hint for string field",
        "layoutColumn": 1,
        "displayType": "Simple"
      }
    },
    {
      "name": "date",
      "required": true,
      "type": "Date",
      "defaultValue": [
        "2007-12-03T00:00:00.00Z"
      ],
      "presentation": {
        "caption": "Date Field",
        "hint": "Hint for date field",
        "layoutColumn": 2,
        "timeSelectable": false
      }
    }
  ]
}

Responses

Code Description
200

OK

Media type: application/json

Schema: ContentType

Example:

{
  "name": "exampleDoctype",
  "type": "Document",
  "presentation": {
    "layout": "two-column"
  },
  "fields": [
    {
      "name": "string",
      "required": true,
      "multiple": true,
      "type": "String",
      "defaultValue": [
        "Blogtitle1",
        "Blogtitle2"
      ],
      "validations": {
        "maxLength": 10
      },
      "presentation": {
        "caption": "Title",
        "hint": "Hint for string field",
        "layoutColumn": 1,
        "displayType": "Simple"
      }
    },
    {
      "name": "date",
      "required": true,
      "type": "Date",
      "defaultValue": [
        "2007-12-03T00:00:00.00Z"
      ],
      "presentation": {
        "caption": "Date Field",
        "hint": "Hint for date field",
        "layoutColumn": 2,
        "timeSelectable": false
      }
    }
  ],
  "system": {
    "createdBy": "admin",
    "createdAt": "2021-10-01T15:16:14.146+02:00",
    "updatedBy": "admin",
    "updatedAt": "2021-10-01T15:16:14.22+02:00"
  }
}

Headers:

Name Description Type
X-Resource-Version

Must be used in any subsequent update requests of this entity

string
201

Created

Media type: application/json

Schema: ContentType

Example:

{
  "name": "exampleDoctype",
  "type": "Document",
  "presentation": {
    "layout": "two-column"
  },
  "fields": [
    {
      "name": "string",
      "required": true,
      "multiple": true,
      "type": "String",
      "defaultValue": [
        "Blogtitle1",
        "Blogtitle2"
      ],
      "validations": {
        "maxLength": 10
      },
      "presentation": {
        "caption": "Title",
        "hint": "Hint for string field",
        "layoutColumn": 1,
        "displayType": "Simple"
      }
    },
    {
      "name": "date",
      "required": true,
      "type": "Date",
      "defaultValue": [
        "2007-12-03T00:00:00.00Z"
      ],
      "presentation": {
        "caption": "Date Field",
        "hint": "Hint for date field",
        "layoutColumn": 2,
        "timeSelectable": false
      }
    }
  ],
  "system": {
    "createdBy": "admin",
    "createdAt": "2021-10-01T15:16:14.146+02:00",
    "updatedBy": "admin",
    "updatedAt": "2021-10-01T15:16:14.22+02:00"
  }
}

Headers:

Name Description Type
X-Resource-Version

Resource's version. Must be used in any subsequent update requests of this resource

string
403

Forbidden

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?