Extensions

View as Markdown

Extensions

Extensions typically refer to additional functionalities, customizations, or integrations that developers can add to a content management system. Contentstack provides a variety of extensions to enhance your functionality such as Dashboard Extensions, Asset Sidebar Extensions, Sidebar Extensions, Experience Extensions.

create

The create method adds a new extension in a particular stack of your Contentstack account.

NameTypeDescription
data (required)Dict

Data required to create a new extension

extension = {
           tags: [
           'tag1',
           'tag2'
           ],
           data_type: 'text',
           title: 'Old Extension',
           src: "Enter either the source code (use 'srcdoc') or the external hosting link of the extension depending on the hosting method you selected.",
           multiple: false,
           config: {},
           type: 'field'
       }
import contentstack_management
client = contentstack_management.Client(authtoken='your_authtoken')
result = client.stack('api_key').extension("extension_uid").update(extension).json()

delete

The Delete method removes an extension permanently from your stack.

NameTypeDescription
extension_uid (required)str

UID of the extension

client = contentstack_management.Client(authtoken='your_authtoken')
result = client.stack('api_key').extension('extension_uid').delete().json()

fetch

The fetch method retrieves information about the specified extension.

NameTypeDescription
extension_uid (required)str

UID of the extension

import contentstack_management
client = contentstack_management.Client(authtoken='your_authtoken')
result = client.stack('api_key').extension('extension_uid').fetch().json()

find

The find method retrieves the data about all extensions in the stack.

import contentstack_management
client = contentstack_management.Client(authtoken='your_authtoken')
result = client.stack("api_key").extension().find().json()

update

The update method allows you to make changes in the existing extensions in the stack.

NameTypeDescription
data (required)Dict

The request body

data = {
       "extension": {
           "tags": [
               "tag1",
               "tag2"
           ],
           "data_type": "text",
           "title": "Old Extension",
           "src": "Enter either the source code (use 'srcdoc') or the external hosting link of the extension depending on the hosting method you selected.",
           "multiple": false,
           "config": "{}",
           "type": "field"
       }
   }
import contentstack_management
client = contentstack_management.Client(authtoken='your_authtoken')
result = client.stack('api_key').extension("extension_uid").update(data).json()

upload

The upload method is used to upload a new extension to your stack.

NameTypeDescription
data (required)Dict

The request body

extension = {
       "file_name": "demo.html",
       "file_path": "/Users/sunil.lakshman/Downloads/demo.html",
       "data_type": 'text',
       "title": 'Old Extension',
       "multiple": False,
       "tags": {},
       "type": 'dashboard'
       }
import contentstack_management
client = contentstack_management.Client(authtoken='your_authtoken')
result = client.stack('api_key').extension().upload(extension).json()