Creating an App

Your first step will be to create an app for which you will build content types. This might be the client name, website or app that you are building. Under your Company, in the top left, Elegant will list all of the apps that you have created. In addition, you will see the ability to add new apps. You can have multiple Companies, and only the apps under that Company will be displayed.


Building Content Types

Your second step will be to create content types into which you will enter your content. Examples of content types are player metadata, articles, image galleries, configurations, lists of artists joined to their art or anything required by your application.

Creating a content type:

Step 1: Create a new content type

Click create and assign a friendly name. The system will suggest an API identifier, which a developer could use later to pull only this content from the API.

Step 2: Add fields

Elegant has many fields into which you can enter content. Choose the fields that best suit your needs. Once inside a field, you will have additional configuration options. Most fields are self-explanatory.

Step 3: Decide on the title

The title selection decides which field to present when looking up the content. Therefore, it is best to select a title that makes it easy for finding the content. A good example would be if you had a Content Type of “Person”. In this case, you might make the title, “Last Name.”

Step 4: Decide if the item should allow scheduling

Scheduling can be enabled on a content type, which allows content to be scheduled with a start and end date. The API will follow the enabled schedule.

Types of fields:

Text:
Perfect for basic text or html. Once inside the setup, the user can decide which input control to select, such as a simple single line input to a full WYSIWYG editor.

Number:
Allows for both integers and decimals.

Date and Time:
Allows a user to use a simple GUI to enter a date/time.

Image:
Allows a user to upload an image. You can specify validations to enforce both an exact size or a ratio, such as 4:3.

File Upload:
Allows the user to upload a file, such as a PDF or XLS.

Media Collection:
Allows a user to bulk upload and then order a collection of images. This is very useful for galleries often used in content apps.

Content Connector:
This is one of the more powerful fields. This allows you to reference another content type to join the two together. A good example of this would be if you had one content type of “Cars” and another of “Models”. You could create a connector from Cars to Models. Thus, when a user is entering a car, they would be presented with a simple interface to select the model. The list of models will come from all of the data that has been entered into that content type.


Entering Content

In the content tab, you will be presented with a list of your content ordered by the last modified date. You can conduct a search for content, filter your content and order your content to more effectively work with or find your content.

From this interface, you can also create new content for any of the content types that you have established.


Adding Users to All Apps in a Company

In order to add a user to all of the apps in a particular Company, click on “Manage Companies” in the drop down menu in the top right corner next to your icon. Then, choose a Company in order to add a user who will now have access to all of the apps within that Company.


Adding Users to One App

In order to add a user to only one app in a particular Company, while in the app, click on “Settings” in the left menu. Here is where you can add a user who will now have access only to the app on which you are currently working.

Please note that an admin, as opposed to an author, is the only one who can add a user to one or more apps under a Company and can manage content types. Both an admin and an author can manage the actual content.


Getting Data from the API

Step 1: Generate an API key

Navigate to Settings > API

Here you can generate an API key for the app you are currently using. You can create multiple keys if you need to distribute to various consumers of your content and want to control access.

Step 2: Pass the API key via the header

When connected to the API: at api.elegantcms.io, you will need to pass the authorization token in the header.

Authorization = Token token [token_from_site]

The elegant API follows the json:api specification if you would like to learn more about it.

Parameters available:

Filtering:

  • filter[type] = Slug name of content type you want to filter on

  • filter[uuid] = Filter on a single piece of content by its UUID

  • filter[uuid][] = Filter on an several contents by their UUIDs

  • filter[publish_status] = Filter on content status based on schedule settings
  • published
  • expired
  • filter[status] = Filter on user selected status
  • live
  • draft
  • Paging

  • page[number]= Select page number
  • page[size]= Select items to return
  • Sorting

  • sort=Select column to sort your results by
  • updated_at

  • Usage Examples: