Contents
In Atlas CMS, Contents
are the entities you add through the Admin UI or the API.
They are composed by a common set of properties and the set of attributes specified in the underneath Contents
.
Content Object
The Content data model is like the following:
id
The Entity ID.
locale
The Entity Locale. If Model is not localizable this property is not available.
createdAt
Creation date (UCT).
createdBy
The username of the user who created the Entity.
modifiedAt
Modify date (UTC).
modifiedBy
The username of the user who modified the Entity.
stage
published
or unpublished
. If Model doesn't have the Stage mode active this property is not available.
modelId
The Id of the underneath model.
modelKey
The Api Key name of the underneath model.
attributes
The object with the properties defined in the model.
locales
The list of the translations id/culture. If Model is not localizable this property is not available.
hash
The hash representation of the attributes.
Attributes and Fields
The Content object contains an attribute property. Inside it there are all the fields, in the form of Json properties, defined for the model with the relative value inserted for the Content.
In addition, each field has the option of being filtered using specific field operators.
You can check here all the available filtering options for fields.
Field Representations
Each field has its own Json representation which corresponds to the underlying data type. Sometimes, these representations can be different between when you send data and when you receive for the purpose of simplification and freedom of use.
Reference
List Contents
Return a paged list of contents entries
GET
/contents/{model-key}
Path Parameters
Query Parameters
page
Integer
The number of page to return default = 1
size
Integer
The number of entries to return for the page
default = 25
locale
String
The locale to filter contents
default = locale set as default in settings
resolve
String
Accept media, mediagallery, relations. (optional) Tells the API to eagerly load and returns the full object for Media, Galeries and Relations instead the ID reference
stage
String
Accept publish or unpublilshed default = published
sort
String
Count Contents
Return the total number of contents entries
GET
/contents/{model-key}/count
Path Parameters
Query Parameters
locale
String
The locale to filter contents
default = locale set as default in settings
stage
String
Accept publish or unpublilshed default = published
Get Content
Return a content entry by Id
GET
/contents/{model-key}/{id}
Path Parameters
id
String
The Id of the content
Query Parameters
resolve
String
Accept media, mediagallery, relations. (optional) Tells the API to eagerly load and returns the full object for Media, Galeries and Relations instead the ID reference
Create Content
Create a new content entry
POST
/contents/{model-key}
Path Parameters
Request Body
{ }*
Json Object
locale: the locale of the content
attributes: the object representing the field/value defined in the model. The check the data type of each field read here
Update Content
Update a content entry
PUT
/contents/{model-key}/{id}
Path Parameters
id*
String
The content id to update
Request Body
{ }*
Json Object
attributes: the object representing the field/value defined in the model. The check the data type of each field read here
Good to know: To preserve consistency when a model change or to optimize the size of a payload, Atlas CMS content update API act like a patch for the attributes objects. This because the model can change, adding, removing o changing the fields, while your code may not be synchronized with the model at the time of change. If you want clean-up a field in the attribute object you have always to specify it and passing null as long as the fieldexists in the model. On the other side, if you pass fields that are not available in the model they are skipped. The only exceptions on this is when you have new required field in the model and the payload doesn't contains it. In this case you will receive a 429 Http Error.
Delete Content
Delete a content entry
DELETE
/contents/{model-key}/{id}
Path Parameters
Request Body
{ }*
Json Object
Duplicate Content
Create a copy of a content entry
POST
/contents/{model-key}/{id}/duplicate
Path Parameters
Request Body
{ }
Json Object
locales: tells the system to create a copy of the object and all its localized versions
Create Translation
Create a content in a new language
POST
/contents/{model-key}/{id}/create-translations
Path Parameters
id*
String
The content Id
Request Body
{ }*
Json Object
locale: the locale for which to create the content from the content id provided
Publish Content
Publish a content entry
POST
/contents/{model-key}/{id}/publish
Path Parameters
id*
String
The content Id
Unpublish Content
Unpublish a content entry
POST
/contents/{model-key}/{id}/unpublish
Path Parameters
id*
String
The content Id
Delete all contents
Delete all content entries
DELETE
/contents/{model-key}/clear
Path Parameters
Request Body
{ }*
Json Object
Last updated