action.skip

Content Types

API description

The CMS system API is divided into separate parts:

  • internal system API
  • user public API

The internal system API is used to define and list Content Types (models), which are OpenAPI 3.0 schemas.

The user public API exposes the user-defined Content Types (models) via a REST interface.

You can learn how to obtain your schema in the next article about OpenAPI schema.

Key concepts

  • Content Repository - the headless part of the Content Management Platform.
  • Content Type - a model of data that has been defined inside the Content Repository.
  • Content Type Definition - a JSON payload that defines the Content Type, it's validation rules, etc.
  • Content Object - an instance of a Content Type.

The central part of the CMS system is the Content Repository. It enables users to store different kinds of content within the system. The users are allowed to design their own content types and define them within the Content Repository by means of Content Type Definitions (a concept similar to DTDs familiar from XML), described in a JSON Schema format.

Every CTD that is created in the system is validated against the predefined schema of ContentTypeDefinitionSchema type. A detailed example will be discussed below.

Once created the Content Type becomes available in the system and Content Objects of that type can be created, updated, deleted via API calls to their respective endpoints.

Every Content Object uploaded to the repository requires a Content Type Definition already present in the system.

Throughout this documentation, we will follow the example of defining a simple Content Type of a BlogPost.

Example:

Example: Content Type Definition for BlogPost

  • Id – string, unique, required
  • Title – string, required
  • PostContent – string, required

API token

API token (described across the documentation as YOUR API TOKEN or YOUR_API_TOKEN) should be obtained from the User profile view of the Flotiq panel. All examples here have authentication in the request header, but you can also use ?auth_token=YOUR_API_TOKEN in the request URL. You can learn how to obtain your API key in the next article.

Working with Content Type Definitions

The API endpoint /api/v1/internal/contenttype can be used to interact with Content Type Definitions inside the Content Repository. The endpoint documentation is provided in the API docs and describes the following actions:

Register to send all requests with your own API today