Handling "Authors"

Intro

The “Authors“ are entities which are added to different types of content (Articles/Videos/Galleries).

In this tutorial we will be exploring the Author CRUD operations. To better understand the topic, we will go through the following steps:

  1. Components of an Author

  2. Creating an Author

  3. Updating an Author

  4. Deleting an Author

  5. Get a single Author

  6. Get list of Authors

Components of an Author

 

{ "name": "string", "bio": "string", "active": true, "default": true, "avatar_url": "string", "generic": {}, "weight": "string" }

 

id - Automatically generated by the system.

name - The name of the Author

bio - Author biography

active - The state of the author: active or inactive. This configuration is used to indicate if the author is active or inactive.

default - When used, the specified author will be set as a default one if no author is added in the following content: Article/Video/Galley

avatar_url - Url of the authors' avatar. The image is uploaded using the Image processing API, for more about uploading images: Using the Image Processing API

weight - Used to indicate the position of the author.

Creating an Author

To create an author the following request must be made:

End-point: /authors Request Type: POST Headers: { "Authorization": "Bearer <your token>", "Project": "<project domain>" } Request body: { "name": "string", //mandatory "bio": "string", "active": true, "default": true, "avatar_url": "string" }

Updating an Author

To update an author the following request must be made:

End-point: /authors/<author id> Request Type: PATCH Headers: { "Authorization": "Bearer <your token>", "Project": "<project domain>" } Request body: { "name": "string", "bio": "string", "active": true, "default": true, "avatar_url": "string" }  

Deleting an Author

To delete am author the following request must be made:

 

Get list of Authors

To get a list authors the following request must be made:

The author listing endpoint supports pagination. There are additional parameters that can be used:

Parameters

  • limit

    • Description: Controls how many authors will be returned per page

    • Values:

      • Maximum value: 200

      • Default value: 20

    • Behaviour: Affects how many pages are generated.
      Example: If there are 60 authors and the limit is set to 10, this will generate 6 pages of authors.

    • Request:

       

  • page

    • Description: Controls which authors' page will be retrieved

    • Values:

    • Behaviours: Affected by the “limit“ parameter

    • Request

      • Without “limit“ parameter

      • With “limit“ parameter