Skip to main content

Get a single entry

Log in to add to favourites

Call the entries.get() method in our delivery client to get a single entry

Call signatures

TypeScript
get(id: string): Promise<Entry>

get(options: EntryGetOptions): Promise<Entry>

Parameters

NameTypeDescription
idstringThe id of the entry
optionsEntryGetOptionsAn object specifying the id, language, fields to return and linkDepth.

Returns

A Promise that will resolve with the Entry

Example

TypeScript
// Using TypeScript, or ES Module await syntax
const entry = await client.entries.get('<entry_id>');

console.log(entry.entryTitle);
JavaScript
// Using Common JS promise callback syntax
client.entries.get('<entry_id>')
  .then(function (entry) {
    console.log(entry.title);
  });

Using options

Get only the title and overview fields of the French entry variation resolving linked content to a depth of 2

TypeScript
// Using TypeScript, or ES Module await syntax
const entry = await client.entries.get({
  id: '<entry_id>',
  language: 'fr-FR',
  linkDepth: 2,
  fields: ['title', 'overview']
});

console.log(entry.title);
console.log(entry.overview);

Get only the title and overview fields of the French entry variation resolving linked content to a depth of 2

JavaScript
// Using Common JS promise callback syntax
client.entries
  .get({
    id: '<entry_id>',
    language: 'fr-FR',
    linkDepth: 2,
    fields: ['title', 'overview']
  })
  .then(function (entry) {
    console.log(entry.title);
    console.log(entry.overview);
  });

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