Terms

View as Markdown

Terms

Terms serve as the primary classification elements within a taxonomy, allowing you to establish hierarchical structures and incorporate them into entries.

Note The Terms feature is currently released as part of an Early Access program and may not be available to all users. For more information, you can reach out to our support team.

ancestors

The ancestors method retrieves information about a specific term in the taxonomy.

NameTypeDescription
terms_uid (required)str

UID of the term

import contentstack_management
client = contentstack_management.Client(authtoken='your_authtoken')
result = client.stack('api_key').taxonomy('taxonomy_uid').terms('terms_uid').ancestors().json()

create

The create method lets you create a new term to your taxonomy.

NameTypeDescription
data (required)dict

The request body to be sent in the call.

data ={
       "term": {
           "uid": "term_1",
           "name": "Term 1"
       },
       "parent_uid": null
       }
import contentstack_management
client = contentstack_management.Client(authtoken='your_authtoken')
result = client.stack('api_key').taxonomy('taxonomy_uid').terms().create(data)

delete

The delete method lets you remove an existing term from your taxonomy.

NameTypeDescription
terms_uid (required)str

UID of the term

import contentstack_management
client = contentstack_management.Client(authtoken='your_authtoken')
result = result = client.stack('api_key').taxonomy('taxonomy_uid').terms('terms_uid').delete('taxonomy_uid')

descendants

The descendants method retrieves the information about a specific term in your taxonomy.

NameTypeDescription
terms_uid (required)str

UID of the term

import contentstack_management
client = contentstack_management.Client(authtoken='your_authtoken')
result = client.stack('api_key').taxonomy('taxonomy_uid').terms('terms_uid').descendants().json()

fetch

The fetch method retrieves the information about a specific taxonomy in your stack.

NameTypeDescription
terms_uidstr

UID of the term

import contentstack_management
client = contentstack_management.Client(authtoken='your_authtoken')
result = client.stack('api_key').taxonomy('taxonomy_uid').terms('terms_uid').fetch()

find

The find method retrieves the list of all terms available for a taxonomy.

NameTypeDescription
terms_uidstr

UID of the term

import contentstack_management
client = contentstack_management.Client(authtoken='your_authtoken')
result = client.stack("api_key").taxonomy("taxonomy_uid").terms().find()

move

The move method lets you update the details of a specific term in the taxonomy.

NameTypeDescription
terms_uid (required)str

UID of the term

data (required)dict

The request body to be sent in the call.

data ={
       "term": {
           "uid": "term_1"
       },
       "parent_uid": null
       }
       Under an existing Term:
       {
       "term": {
           "uid": "term_3"
       },
       "parent_uid": "term_1"
       }
import contentstack_management
client = contentstack_management.Client(authtoken='your_authtoken')
result = client.stack('api_key').taxonomy("taxonomy_uid").terms('terms_uid').move(data).json()

The search method retrieves the information about specified terms in the taxonomy.

NameTypeDescription
terms_string (required)str

The string of UIDs of the terms you want to search for.

import contentstack_management
client = contentstack_management.Client(authtoken='your_authtoken')
result = client.stack('api_key').taxonomy('taxonomy_uid').terms('terms_uid').search("terms_string")

update

The update method updates a resource with the given data and terms UID.

NameTypeDescription
terms_uid (required)str

UID of the term.

data (required)dict

The data to be sent in the request body

data ={
       "term": {
           "name": "Term 1"
       }
       }
import contentstack_management
client = contentstack_management.Client(authtoken='your_authtoken')
result = client.stack('api_key').taxonomy("taxonomy_uid").terms('terms_uid').update(data)