Skip to main content
Browse Documentation

Content types

Created by Alex Pop on 19 Dec 2019

Get a content type

Gets an existing content type by the content type id or by passing a ContentTypeGetOptions object as an argument.

get(idOrOptions: string | ContentTypeGetOptions): Promise<ContentType>

Returns

A Promise that will resolve with a ContentType object.

Example

client.contentTypes.get('movie')
  .then(result => {      
    console.log('API call result: ', result);              
  })
  .catch(error => {
    console.log('API call fetch error: ', error);      
});

client.contentTypes.get({
    id: 'movie',
    versionStatus: 'published'
  })
  .then(result => {      
    console.log('API call result: ', result);              
  })
  .catch(error => {
    console.log('API call fetch error: ', error);      
});

client.contentTypes.get({
    id: 'movie',
    version: '1.2'
  })
  .then(result => {      
    console.log('API call result: ', result);              
  })
  .catch(error => {
    console.log('API call fetch error: ', error);      
});