contentstack / contentstack-openapi

Contentstack provides OpenAPI JSON files for its Content Delivery and Content Management REST APIs. They are a set of preconfigured requests that will make it easy for you to automatically generate the API documentation and try out our API requests using Swagger Editor.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Contentstack provides OpenAPI files for its Content Delivery and Content Management REST APIs. These files are in JSON format. Using these JSON files, you can automatically generate API documentation, test API, and do a lot more.

This tutorial will walk you through the process of using Contentstack APIs (Content Delivery and Content Management APIs) with Swagger.


Content Delivery API (CDA)

Version: 3.0.0 [Download]

Last Updated: Feb 06, 2023

Note: To use the latest version, download the CDA file on your system.

To use Contentstack Content Delivery API (CDA) with Swagger, perform the following steps:

  1. Download the CDA file and go to the Swagger Editor.
  2. On the “Swagger Editor” page, click on File, and select the Import file option.

Alternatively, if you want to use the Import URL option, you can upload the CDA file as an asset in Contentstack, and then paste the asset’s URL in the prompt.

  1. Open any API request and click on the Try it out button. Clicking this button will unlock the fields, so you can either run the API request on our demo stack or can use your own values.
  2. Click on Execute.

In the Responses section, you can see the following details:

  • API request in CURL format
  • Response body
  • Status code

Content Management API

Version: 3.0.0 [Download]

Last Updated: Feb 06, 2023

Note: To use the latest version, download the CMA file on your system.

To use Contentstack Content Management API (CMA) with Swagger, perform the following steps:

  1. Download the CMA file and go to the Swagger Editor.
  2. On the “Swagger Editor” page, click on File, and select the Import file option.
  3. Alternatively, you can upload the CMA file as an asset in Contentstack. Then, you can use the Import URL option and paste the asset’s URL in the prompt.
  4. To run any API request for CMA, make sure you have either the Management token or Auth token in hand.
    1. To use a management token, refer to the Generate Management token guide.
    2. To use Auth token, run the Login API request, located under the User Session section.
  5. Open any API request and click on the Try it out button. Clicking this button will unlock the fields for you to use your enter the values.
  6. Click Execute.

In the Responses section, you can see the following details:

  • API request in CURL format
  • Response body
  • Status code

Points to note:

  • We recommend using the Management token for executing CMA requests rather than Auth token.
  • For any DELETE request that has a request body in it, you won’t be able to run it in Swagger. In such scenarios, refer to the documentation link provided in the call for more details.

About

Contentstack provides OpenAPI JSON files for its Content Delivery and Content Management REST APIs. They are a set of preconfigured requests that will make it easy for you to automatically generate the API documentation and try out our API requests using Swagger Editor.

License:MIT License