Contentstack
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.
| Name | Type | Description |
|---|---|---|
| host (required) | string | API host |
| headers | Dict | Additional headers |
| early_access | List | Array of header strings for early access features. |
| authtoken | string | Authtoken is a user-specific read-write token used to make authorized CMA requests. |
| management_token | string | Authorization token is a read-write token used to make authorized CMA requests, but it is a user-specific token. |
| timeout | number | Number of milliseconds before the request times out. |
| 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.
| Name | Type | Description |
|---|---|---|
| host | str | Hostname for API endpoint |
| authtoken | str | A user-specific read-write token for authorization of API requests |
| headers | str | Headers to be included in the API requests |
| authorization | str | A user-specific read-write token for authorization of API requests |
| region | Region | 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.
| Name | Type | Description |
|---|---|---|
| region | Region | 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")