Get a single entry
Log in to add to favouritesRequesting 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
ContensisClient.entries.get('<entry_id>').then(function (entry) {
console.log(entry.title);
});
Example - using entry get options
// 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);
});