Skip to main content

Get a single entry

Log in to add to favourites

Requesting an individual entry can be achieved by using the get method on the client's entries property.

get(id: string): Promise<Entry>
get(options: EntryGetOptions): Promise<Entry>

Parameters

Name Type Description
id string The id of the entry
options EntryGetOptions An object specifying the id, language, fields to return and linkDepth.

Returns

A Promise that will resolve with the Entry

Example - using entry id

JavaScript
ContensisClient.entries.get('<entry_id>').then(function (entry) {
  console.log(entry.title);
});

Example - using entry get options

JavaScript
// Get only the title and overview fields of the French variation with a link depth of 2
ContensisClient.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