Contentstack

View as Markdown

Contentstack

The Content Management API (CMA) is used to manage the content of your Contentstack account. This includes creating, updating, deleting, and fetching content of your account.

Contentstack

The Content Management API (CMA) is used to manage the content of your Contentstack account. This includes creating, updating, deleting, and fetching content of your account.

NameTypeDescription
host (required)string

API host

Default: api.contentstack.io
headersDict

Additional headers

early_accessList

Array of header strings for early access features.

authtokenstring

Authtoken is a user-specific read-write token used to make authorized CMA requests.

management_tokenstring

Authorization token is a read-write token used to make authorized CMA requests, but it is a user-specific token.

timeoutnumber

Number of milliseconds before the request times out.

Default: 30000ms
region (required)string

DB region of the stack. You can choose from seven regions: AWS NA, AWS EU, AWS AU, Azure NA, Azure EU, GCP NA, and GCP EU.

Client Initialization

import contentstack_management
client = contentstack_management.Client()


Set the `host` to 'api.contentstack.io'

import contentstack_management
client = contentstack_management.Client(host: 'api.contentstack.io' )


Set the `headers` to { 'headerkey': 'value'}

import contentstack_management
client = contentstack_management.Client( headers: { 'headerkey': 'value'} )


Set the Early Access Headers

import contentstack_management
client = contentstack_management.Client(early_access: ['early_access_1', 'early_access_2'])
)


Set the `authtoken`

import contentstack_management
client = contentstack_management.Client( authtoken: 'value' )


Set the `authorization`

import contentstack_management
client = contentstack_management.Client( management_token: Management  token' )


Set the `timeout` to 50000ms

import contentstack_management
client = contentstack_management.Client( timeout: 50000 )

ContentstackClient

The Client serves as the central element of the SDK, providing users with an interface to access and engage with external services. It encapsulates functionality and configuration within a user-friendly API, abstracting away intricate technical aspects. This streamlines the procedure of sending requests and managing responses.


NameTypeDescription
hoststr

Hostname for API endpoint

authtokenstr

A user-specific read-write token for authorization of API requests

headersstr

Headers to be included in the API requests

authorizationstr

A user-specific read-write token for authorization of API requests

regionRegion

DB region for Stack. You can choose from seven regions namely, AWS NA, AWS EU, AWS AU, Azure NA, Azure EU, GCP NA, and GCP EU. The default region is set to NA.

import contentstack_management
client = contentstack_management.Client()

Region

By default, the SDK uses the North American region. Configuration changes are not required for North American region users.

NameTypeDescription
regionRegion

DB region for Stack. You can choose from seven regions namely, AWS NA, AWS EU, AWS AU, Azure NA, Azure EU, GCP NA and GCP EU. The default region is set to NA.

import contentstack_management
client = contentstack_management.Client(region="eu")