Skip to main content

Get a single content type

Log in to add to favourites

Call the contentTypes.get() method in our delivery client to get a single content type

Call signature

TypeScript
get(contentTypeId: string): Promise<ContentType>

Parameters

NameTypeDescription
contentTypeIdstringThe id of the content type

Returns

A Promise that will resolve with the Content Type

Example

TypeScript
// Using TypeScript, or ES Module await syntax
const contentType = await client.contentTypes.get('<content-type-id>');

console.log(contentType.name['en-GB']);
JavaScript
// Using Common JS promise callback syntax
client.contentTypes.get('<content-type-id>')
  .then(function (contentType) {
    console.log(contentType.name['en-GB']);
  });

Still need help?

If you still need help after reading this article, don't hesitate to reach out to the Contensis community on Slack or raise a support ticket to get help from our team.
New support request