Get a single content type
Log in to add to favouritesCall the contentTypes.get() method in our delivery client to get a single content type
Call signature
get(contentTypeId: string): Promise<ContentType>
Parameters
Name | Type | Description |
---|---|---|
contentTypeId | string | The id of the content type |
Returns
A Promise that will resolve with the Content Type
Example
// Using TypeScript, or ES Module await syntax
const contentType = await client.contentTypes.get('<content-type-id>');
console.log(contentType.name['en-GB']);
// Using Common JS promise callback syntax
client.contentTypes.get('<content-type-id>')
.then(function (contentType) {
console.log(contentType.name['en-GB']);
});