Developer

Working with REST API

Introduction

REST API is the most common approach to APIs and suitable for applications with a wide range of purposes. Built with a strong data structure, REST can handle multiple types of requests and return different data formats. One of the most common requests in REST is the GET request. The GET is used to retrieve data from a server at the specified resource. In Nimvio, you can use GET request to retrieve the content list and content details.

Working with REST API, you can use this URL https://api.nimvio.com to access the API. You may also require Environment ID and Content ID to do so. The following guides then will help you to work with each type of endpoint.

 

Get Content List

With this endpoint, you can get a list of content items. The details of the endpoint are shown in the table below. Be noted that Path Parameters are mandatory, while Query Parameters are optional.

 GET /cda/rest/v1/{environment_id}/contents

 Full URL https://api.nimvio.com/cda/rest/v1/{environment_id}/contents

 Path parameters

 Values

 Description

 environment_id

 Environment ID

 String

 Identifies the project

 Query parameters

 Values

 Description

 searchByName

 Content Name

 String

 Use to request by specific content name

 searchByTemplateName

 Content Template Name

 String

 Use to request by specific content template name

 status

 Content Status

 String

 Use to request by specific content status

 searchByCreatedBy

 Content creator name

 String

 Use to request by specific content creator

 page

 Page number

 String

 Use to request specific page

 pageSize

 Page size

 Int

 Use to request specific page Size

 sort

 Field Name

 String

 Use to sort records based on field name

 sortAsc

 true or false

 Boolean

 Sort ascending when true and by default will sort descending

 Responses

 Fields

 Description

 

 status

 The HTTP response status

 

 data

 The content items’s system properties

 

 totalItems

 The total of content items

 

 data.Status

 The content items’s status

 

 data.CreatedBy

 The content items’s creator name

 

 data.CreatedAt

 The content items’s created date

 

 data.Data

 The content’s element or field with its value

 

 data.PublishedBy

 The content items’s publisher name

 

 data.UpdatedAt

 The content items’s updated date

 

 data.Name

 The content items’s name

 

 data.PublishedAt

 The content items’s published date

 

 data.UpdatedBy

 The content items’s editor name

 

 data.TemplateName

 The content items’s template name

 

 data.TemplateID

 The content items’s template ID

 

 data.ContentID

 The content items’s ID

 

The below is a response example when using application/json as the content-type.


  {
      "status": 200,
      "data": [
          {
              "Status": "Published",
              "CreatedBy": "Erian Suwandi",
              "CreatedAt": "2021-04-23T03:24:17.851Z",
              "Data": {
                  "title": "New Blog"
              },
              "PublishedBy": "Erian Suwandi",
              "UpdatedAt": "2021-05-10T06:21:28.079Z",
              "Name": "Blog",
              "PublishedAt": "2021-05-10T06:21:28.079Z",
              "UpdatedBy": "Erian Suwandi",
              "TemplateName": "Blog",
              "TemplateID": "Template_64a5416f-3255-4b2f-b2fd-f86100418eb8",
              "ContentID": "Content_eaea0b46-f440-438c-9c26-92f4006ae03a"
          }
      ],
      "totalItems": 1
  }

 

Get Content Detail

With this endpoint, you can get a specific content item. The details of the endpoint are shown in the table below.

 GET /cda/rest/v1/{environment_id}/contents

 Full URL https://api.nimvio.com/cda/rest/v1/{environment_id}/contents/{content_id}

 Path parameters

 Values

 Description

 environment_id

 Environment ID

 String

 Identifies the project

 content_id

 Content ID

 String

 Identifies the content

 Query parameters

 Values

 Description

 -

 -

 -

 Responses

 Fields

 Description

 

 status

 The HTTP response status

 

 data

 The content items’s system properties

 

 data.Status

 The content items’s status

 

 data.CreatedBy

 The content items’s creator name

 

 data.CreatedAt

 The content items’s created date

 

 data.Data

 The content’s element or field with its value

 

 data.PublishedBy

 The content items’s publisher name

 

 data.UpdatedAt

 The content items’s updated date

 

 data.Name

 The content items’s name

 

 data.PublishedAt

 The content items’s published date

 

 data.UpdatedBy

 The content items’s editor name

 

 data.TemplateName

 The content items’s template name

 

 data.TemplateID

 The content items’s template ID

 

 data.ContentID

 The content items’s ID

 

The below is a response example when using application/json as the content-type.


  {
      "status": 200,
      "data": {
              "Status": "Published",
              "CreatedBy": "Erian Suwandi",
              "CreatedAt": "2021-04-23T03:24:17.851Z",
              "Data": {
                  "title": "New Blog"
              },
              "PublishedBy": "Erian Suwandi",
              "UpdatedAt": "2021-05-10T06:21:28.079Z",
              "Name": "Blog",
              "PublishedAt": "2021-05-10T06:21:28.079Z",
              "UpdatedBy": "Erian Suwandi",
              "TemplateName": "Blog",
              "TemplateID": "Template_64a5416f-3255-4b2f-b2fd-f86100418eb8",
              "ContentID": "Content_eaea0b46-f440-438c-9c26-92f4006ae03a"
          }
  }

 

What is Next?

Congratulations! You have finished the guide. Keep exploring below: