Skip to content

Latest commit

 

History

History
85 lines (59 loc) · 3.49 KB

File metadata and controls

85 lines (59 loc) · 3.49 KB

Contentstack CDA/CMA OpenAPI

Contentstack provides OpenAPI files for its Content Delivery and Content Management APIs in JSON format. These files allow you to automatically generate API documentation, test requests, and streamline your development workflow.

This tutorial walks you through how to use these JSON files with Swagger Editor to interact with Contentstack’s APIs.

Content Delivery API (CDA)

To use CDA with Swagger, follow these steps:

  1. Download the latest CDA JSON file and navigate to Swagger Editor.
  2. Click File on top-right and select Import File to upload the JSON.
  3. Open any API request and click the Try it out button to unlock the parameter fields.
  4. Enter your stack's values or use the default demo stack credentials.
  5. Click Execute.

The Responses section will display the following:

  • The API request in cURL format.
  • The response body (JSON).
  • The HTTP status code.

Note: To ensure you are testing against the most accurate environment, always download the latest CDA file from the Contentstack documentation site.

Content Management API (CMA)

To use CDA with Swagger, follow these steps:

  1. Download the latest CMA JSON file and navigate to Swagger Editor.
  2. Click File on top-right and select Import File to upload the JSON.
  3. Before running a request, ensure you have an authentication method ready:
  4. Management Token: We recommend using a management token for CMA requests. Refer to the Generate Management Token guide for details.
  5. Authtoken: Run the Log in API request under the User Session section to retrieve an authtoken in the response.
  6. Open any API request and click the Try it out button to unlock the parameter fields.
  7. Enter your stack's values or use the default demo stack credentials.
  8. Click Execute.

The Responses section will display the following:

  • The API request in cURL format.
  • The response body (JSON).
  • The HTTP status code.

Note:

  • We recommend using the Management token for executing CMA requests rather than authtoken.
  • For any DELETE request that has a request body in it, you won’t be able to run it in Swagger.