Skip to main content

Requesting nodes can be achieved by using one of the Get methods.

Get root

Gets the root node of the tree.

Syntax

C#
public Node GetRoot(string language = null, IList<string> entryFields = null, entryLinkDepth = 0, Dictionary<string, int> entryFieldLinkDepths = null)
{
}

Parameters

language

Type: string
The specified language for the node. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10.

By default, no entry data is resolved for linked entries. Please note: Only fields which are specified in the entryFields parameter will be resolved.

entryFieldLinkDepths (version 16+ only)

Type: Dictionary<string, int>
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10. Field paths are dot-delimited (such as "composer.component.entryLinkField") and the longest applicable path is used. If no matching path is found then the linkDepth is used.

By default, no entry data is resolved for linked entries. Please note: You can only resolve fields which are specified in the entryFields parameter.

Examples

C#
using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get the root node for the default language
Node rootNode = client.Nodes.GetRoot();

Get root async

Gets the root node of the tree asynchronously.

Syntax

C#
public async Task<Node> GetRootAsync(string language = null, IList<string> entryFields = null, entryLinkDepth = 0, Dictionary<string, int> entryFieldLinkDepths = null)
{
}

Parameters

language

Type: string
The specified language for the node. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10.

By default, no entry data is resolved for linked entries. Please note: Only fields which are specified in the entryFields parameter will be resolved.

entryFieldLinkDepths (version 16+ only)

Type: Dictionary<string, int>
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10. Field paths are dot-delimited (such as "composer.component.entryLinkField") and the longest applicable path is used. If no matching path is found then the linkDepth is used.

By default, no entry data is resolved for linked entries. Please note: You can only resolve fields which are specified in the entryFields parameter.

Examples

C#
using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get the French root node asynchronously
Node rootNode = await client.Nodes.GetRootAsync("fr-FR");

Get by Guid id

Gets a node by its identifier as a Guid.

Syntax

C#
public Node GetById(Guid id, string language = null, IList<string> entryFields = null, entryLinkDepth = 0, Dictionary<string, int> entryFieldLinkDepths = null)
{
}

Parameters

id

Type: Guid
The id of the node.

language

Type: string
The specified language for the node. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10.

By default, no entry data is resolved for linked entries. Please note: Only fields which are specified in the entryFields parameter will be resolved.

entryFieldLinkDepths (version 16+ only)

Type: Dictionary<string, int>
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10. Field paths are dot-delimited (such as "composer.component.entryLinkField") and the longest applicable path is used. If no matching path is found then the linkDepth is used.

By default, no entry data is resolved for linked entries. Please note: You can only resolve fields which are specified in the entryFields parameter.

Remarks

Returns null if a node with an id matching the specified id does not exist.

Examples

C#
using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get a specific German node by id
Node navNode = client.Nodes.GetById(rootNavNodeId, language: "de");

// We can now create navigation components by looping through the nodes...

Get by Guid id async

Gets a node by its identifier as a Guid asynchronously.

Syntax

C#
public async Task<Node> GetByIdAsync(Guid id, string language = null, IList<string> entryFields = null, entryLinkDepth = 0, Dictionary<string, int> entryFieldLinkDepths = null)
{
}

Parameters

id

Type: Guid
The id of the node.

language

Type: string
The specified language for the node. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10.

By default, no entry data is resolved for linked entries. Please note: Only fields which are specified in the entryFields parameter will be resolved.

entryFieldLinkDepths (version 16+ only)

Type: Dictionary<string, int>
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10. Field paths are dot-delimited (such as "composer.component.entryLinkField") and the longest applicable path is used. If no matching path is found then the linkDepth is used.

By default, no entry data is resolved for linked entries. Please note: You can only resolve fields which are specified in the entryFields parameter.

Remarks

Returns null if a node with an id matching the specified id does not exist.

Examples

C#
using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get a specific German node by id
Node navNode = await client.Nodes.GetByIdAsync(rootNavNodeId, language: "de");

// We can now create navigation components by looping through the nodes...

Get by string id

Gets a node by its identifier as a string.

Syntax

C#
public Node GetById(string id, string language = null, IList<string> entryFields = null, entryLinkDepth = 0, Dictionary<string, int> entryFieldLinkDepths = null)
{
}

Parameters

id

Type: string
The id of the node.

language

Type: string
The specified language for the node. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10.

By default, no entry data is resolved for linked entries. Please note: Only fields which are specified in the entryFields parameter will be resolved.

entryFieldLinkDeptha (version 16+ only)

Type: Dictionary<string, int>
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10. Field paths are dot-delimited (such as "composer.component.entryLinkField") and the longest applicable path is used. If no matching path is found then the linkDepth is used.

By default, no entry data is resolved for linked entries. Please note: You can only resolve fields which are specified in the entryFields parameter.

Remarks

Returns null if a node with an id matching the specified id does not exist.

Examples

C#
using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get a specific German node by id
Node navNode = client.Nodes.GetById("7ee53da5-6405-4fb5-80d4-b2752038134d", language: "de");

// We can now create navigation components by looping through the nodes...

Get by string id async

Gets a node by its identifier as a string asynchronously.

Syntax

C#
public async Task<Node> GetByIdAsync(Guid id, string language = null, IList<string> entryFields = null, entryLinkDepth = 0, Dictionary<string, int> entryFieldLinkDepths = null)
{
}

Parameters

id

Type: string
The id of the node.

language

Type: string
The specified language for the node. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10.

By default, no entry data is resolved for linked entries. Please note: Only fields which are specified in the entryFields parameter will be resolved.

entryFieldLinkDepths (version 16+ only)

Type: Dictionary<string, int>
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10. Field paths are dot-delimited (such as "composer.component.entryLinkField") and the longest applicable path is used. If no matching path is found then the linkDepth is used.

By default, no entry data is resolved for linked entries. Please note: You can only resolve fields which are specified in the entryFields parameter.

Remarks

Returns null if a node with an id matching the specified id does not exist.

Examples

C#
using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get a specific German node by id
Node navNode = await client.Nodes.GetByIdAsync("7ee53da5-6405-4fb5-80d4-b2752038134d", language: "de");

// We can now create navigation components by looping through the nodes...

Get by path

Gets a node by path.

Syntax

C#
public Node GetByPath(string path, IList<string> entryFields = null, entryLinkDepth = 0, bool allowPartialMatch = false, Dictionary<string, int> entryFieldLinkDepths = null)
{
}

Parameters

path

Type: string
The path to the node.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10.

By default, no entry data is resolved for linked entries. Please note: Only fields which are specified in the entryFields parameter will be resolved.

allowPartialMatch

Type: bool
When set to true, returns the nearest ancestor up to, but not including, root on the path if the node at the specified path does not exist.

entryFieldLinkDepths (version 16+ only)

Type: Dictionary<string, int>
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10. Field paths are dot-delimited (such as "composer.component.entryLinkField") and the longest applicable path is used. If no matching path is found then the linkDepth is used.

By default, no entry data is resolved for linked entries. Please note: You can only resolve fields which are specified in the entryFields parameter.

Remarks

Returns null if a node with the specified path does not exist.

Examples

C#
using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get a node by path
Node navNode = client.Nodes.GetByPath("/en-GB/movies/1995/toy-story");

Get by path async

Gets a node by path asynchronously.

Syntax

C#
public async Task<Node> GetByPathAsync(string path, IList<string> entryFields = null, entryLinkDepth = 0, Dictionary<string, int> entryFieldLinkDepths = null)
{
}

Parameters

path

Type: string
The path to the node.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10.

By default, no entry data is resolved for linked entries. Please note: Only fields which are specified in the entryFields parameter will be resolved.

entryFieldLinkDepths (version 16+ only)

Type: Dictionary<string, int>
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10. Field paths are dot-delimited (such as "composer.component.entryLinkField") and the longest applicable path is used. If no matching path is found then the linkDepth is used.

By default, no entry data is resolved for linked entries. Please note: You can only resolve fields which are specified in the entryFields parameter.

Remarks

Returns null if a node with the specified path does not exist.

Examples

C#
using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get a node by path
Node navNode = await client.Nodes.GetByPathAsync("/en-GB/movies/1995/toy-story");

Get by Guid entry id

Gets all nodes that have the specified entry assigned

Syntax

C#
public IReadonlyList<Node> GetByEntryId(Guid entryId, string language = null,
    IList<string> entryFields = null, entryLinkDepth = 0, Dictionary<string, int> entryFieldLinkDepths = null)
{
}

Parameters

entryId

Type: Guid
The entry identifier.

language

Type: string
The specified language for the nodes. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepths (version 16+ only)

Type: int
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10.

By default, no entry data is resolved for linked entries. Please note: Only fields which are specified in the entryFields parameter will be resolved.

entryFieldLinkDepth

Type: Dictionary<string, int>
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10. Field paths are dot-delimited (such as "composer.component.entryLinkField") and the longest applicable path is used. If no matching path is found then the linkDepth is used.

By default, no entry data is resolved for linked entries. Please note: You can only resolve fields which are specified in the entryFields parameter.

Examples

C#
using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get all nodes with the entry assigned
IReadonly<Node> nodes = client.Nodes.GetByEntryId(entryId);

Get by Guid entry id async

Gets all nodes that have the specified entry assigned asynchronously

Syntax

C#
public async Task<IReadonlyList<Node>> GetByEntryIdAsync(Guid entryId, string language = null,
    IList<string> entryFields = null, entryLinkDepth = 0, Dictionary<string, int> entryFieldLinkDepths = null)
{
}

Parameters

entryId

Type: Guid
The entry identifier.

language

Type: string
The specified language for the nodes. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10.

By default, no entry data is resolved for linked entries. Please note: Only fields which are specified in the entryFields parameter will be resolved.

entryFieldLinkDepths (version 16+ only)

Type: Dictionary<string, int>
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10. Field paths are dot-delimited (such as "composer.component.entryLinkField") and the longest applicable path is used. If no matching path is found then the linkDepth is used.

By default, no entry data is resolved for linked entries. Please note: You can only resolve fields which are specified in the entryFields parameter.

Examples

C#
using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get all nodes with the entry assigned
IReadonly<Node> nodes = await client.Nodes.GetByEntryIdAsync(entryId);

Get by string entry id

Gets all nodes that have the specified entry assigned

Syntax

C#
public IReadonlyList<Node> GetByEntryId(string entryId, string language = null,
    IList<string> entryFields = null, entryLinkDepth = 0, Dictionary<string, int> entryFieldLinkDepths = null)
{
}

Parameters

entryId

Type: string
The entry identifier.

language

Type: string
The specified language for the nodes. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10.

By default, no entry data is resolved for linked entries. Please note: Only fields which are specified in the entryFields parameter will be resolved.

entryFieldLinkDepths (version 16+ only)

Type: Dictionary<string, int>
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10. Field paths are dot-delimited (such as "composer.component.entryLinkField") and the longest applicable path is used. If no matching path is found then the linkDepth is used.

By default, no entry data is resolved for linked entries. Please note: You can only resolve fields which are specified in the entryFields parameter.

Examples

C#
using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get all nodes with the entry assigned
IReadonly<Node> nodes = client.Nodes.GetByEntryId("ccd00f54-8c6a-4ea8-88ab-93cda601c181");

Get by string entry id async

Gets all nodes that have the specified entry assigned asynchronously

Syntax

C#
public async Task<IReadonlyList<Node>> GetByEntryIdAsync(string entryId, string language = null,
    IList<string> entryFields = null, entryLinkDepth = 0, Dictionary<string, int> entryFieldLinkDepths = null)
{
}

Parameters

entryId

Type: string
The entry identifier.

language

Type: string
The specified language for the nodes. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10.

By default, no entry data is resolved for linked entries. Please note: Only fields which are specified in the entryFields parameter will be resolved.

entryFieldLinkDepths (version 16+ only)

Type: Dictionary<string, int>
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10. Field paths are dot-delimited (such as "composer.component.entryLinkField") and the longest applicable path is used. If no matching path is found then the linkDepth is used.

By default, no entry data is resolved for linked entries. Please note: You can only resolve fields which are specified in the entryFields parameter.

Examples

C#
using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get all nodes with the entry assigned
IReadonly<Node> nodes = await client.Nodes.GetByEntryIdAsync("ccd00f54-8c6a-4ea8-88ab-93cda601c181");

Get canonical by Guid entry id

Gets the canonical node that has the specified entry assigned

Syntax

C#
public Node GetCanonical(Guid entryId, string language = null,
    IList<string> entryFields = null, entryLinkDepth = 0, Dictionary<string, int> entryFieldLinkDepths = null)
{
}

Parameters

entryId

Type: Guid
The entry identifier.

language

Type: string
The specified language for the nodes. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10.

By default, no entry data is resolved for linked entries. Please note: Only fields which are specified in the entryFields parameter will be resolved.

entryFieldLinkDepths (version 16+ only)

Type: Dictionary<string, int>
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10. Field paths are dot-delimited (such as "composer.component.entryLinkField") and the longest applicable path is used. If no matching path is found then the linkDepth is used.

By default, no entry data is resolved for linked entries. Please note: You can only resolve fields which are specified in the entryFields parameter.

Examples

C#
using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get the canonical node with the entry assigned
Node node = client.Nodes.GetByEntryId(entryId);

Get canonical by Guid entry id async

Gets the canonical node that has the specified entry assigned asynchronously

Syntax

C#
public async Task<Node> GetCanonicalAsync(Guid entryId, string language = null,
    IList<string> entryFields = null, entryLinkDepth = 0, Dictionary<string, int> entryFieldLinkDepths = null)
{
}

Parameters

entryId

Type: Guid
The entry identifier.

language

Type: string
The specified language for the nodes. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10.

By default, no entry data is resolved for linked entries. Please note: Only fields which are specified in the entryFields parameter will be resolved.

entryFieldLinkDepths (version 16+ only)

Type: Dictionary<string, int>
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10. Field paths are dot-delimited (such as "composer.component.entryLinkField") and the longest applicable path is used. If no matching path is found then the linkDepth is used.

By default, no entry data is resolved for linked entries. Please note: You can only resolve fields which are specified in the entryFields parameter.

Examples

C#
using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get the canonical node with the entry assigned
Node node = await client.Nodes.GetCanonicalAsync(entryId);

Get canonical by string entry id

Gets the canonical node that has the specified entry assigned

Syntax

C#
public Node GetCanonical(string entryId, string language = null,
    IList<string> entryFields = null, entryLinkDepth = 0, Dictionary<string, int> entryFieldLinkDepths = null)
{
}

Parameters

entryId

Type: string
The entry identifier.

language

Type: string
The specified language for the nodes. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10.

By default, no entry data is resolved for linked entries. Please note: Only fields which are specified in the entryFields parameter will be resolved.

entryFieldLinkDepths (version 16+ only)

Type: Dictionary<string, int>
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10. Field paths are dot-delimited (such as "composer.component.entryLinkField") and the longest applicable path is used. If no matching path is found then the linkDepth is used.

By default, no entry data is resolved for linked entries. Please note: You can only resolve fields which are specified in the entryFields parameter.

Examples

C#
using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get the canonical node with the entry assigned
Node node = client.Nodes.GetByEntryId("ccd00f54-8c6a-4ea8-88ab-93cda601c181");

Get canonical by string entry id async

Gets all nodes that have the specified entry assigned asynchronously

Syntax

C#
public async Task<Node> GetCanonicalAsync(string entryId, string language = null,
    IList<string> entryFields = null, entryLinkDepth = 0, Dictionary<string, int> entryFieldLinkDepths = null)
{
}

Parameters

entryId

Type: string
The entry identifier.

language

Type: string
The specified language for the nodes. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10.

By default, no entry data is resolved for linked entries. Please note: Only fields which are specified in the entryFields parameter will be resolved.

entryFieldLinkDepths (version 16+ only)

Type: Dictionary<string, int>
The depth at which to resolve the full entry data for a linked entry, specified by field path, with a maximum depth value of 10 - larger values will be handled as being 10. Field paths are dot-delimited (such as "composer.component.entryLinkField") and the longest applicable path is used. If no matching path is found then the linkDepth is used.

By default, no entry data is resolved for linked entries. Please note: You can only resolve fields which are specified in the entryFields parameter.

Examples

C#
using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get the canonical node with the entry assigned
IReadonly<Node> nodes = await client.Nodes.GetCanonicalAsync("ccd00f54-8c6a-4ea8-88ab-93cda601c181");

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