- Source:
Delivery tokens provide read-only access to the associated environments. Read more about DeliveryToken.
Methods
(static) update() → {Promise.<DeliveryToken.DeliveryToken>}
- Source:
The Update DeliveryToken call lets you update the name and description of an existing DeliveryToken.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.stack({ api_key: 'api_key'}).deliveryToken('delivery_token_uid').fetch()
.then((deliveryToken) => {
deliveryToken.title = 'My New Content Type'
deliveryToken.description = 'Content Type description'
return deliveryToken.update()
})
.then((deliveryToken) => console.log(deliveryToken))
Returns:
Promise for DeliveryToken instance
- Type
- Promise.<DeliveryToken.DeliveryToken>
(static) delete() → {Object}
- Source:
The Delete DeliveryToken call is used to delete an existing DeliveryToken permanently from your Stack.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.stack({ api_key: 'api_key'}).deliveryToken('delivery_token_uid').delete()
.then((response) => console.log(response.notice))
Returns:
Response Object.
- Type
- Object
(static) fetch() → {Promise.<DeliveryToken.DeliveryToken>}
- Source:
The fetch DeliveryToken call fetches DeliveryToken details.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.stack({ api_key: 'api_key'}).deliveryToken('delivery_token_uid').fetch()
.then((deliveryToken) => console.log(deliveryToken))
Returns:
Promise for DeliveryToken instance
- Type
- Promise.<DeliveryToken.DeliveryToken>
(static) create() → {Promise.<DeliveryToken.DeliveryToken>}
- Source:
The Create a DeliveryToken call creates a new deliveryToken in a particular stack of your Contentstack account.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
const token = {
name: 'Test',
description: 'This is a demo token.',
scope: [{
module: 'environment',
environments: ['development'],
acl: {
read: true
}
}]
}
client.stack().deliveryToken().create({ token })
.then((deliveryToken) => console.log(deliveryToken))
Returns:
Promise for DeliveryToken instance
- Type
- Promise.<DeliveryToken.DeliveryToken>
(static) query() → {ContentstackCollection}
- Source:
The ‘Get all deliveryToken’ request returns comprehensive information about all deliveryToken created in a stack.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.stack().deliveryToken().query({ query: { name: 'token_name' } })).find()
.then((contentstackCollection) => console.log(contentstackCollection))
Returns:
Instance of ContentstackCollection.
- Type
- ContentstackCollection