Skip to main content
JAVASCRIPT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
let node = { "parentId": '7840f70a-b842-42ea-bfac-148a3b772ac8', "displayName": { "en-GB": "Tiger Escaped From Zoo", "fr-FR": "Tigre échappé du zoo" }, "slug": { "en-GB": "tiger-escaped-from-zoo", "fr-FR": "tigre-s-est-echappe-du-zoo" }, "restrictedToLanguages": [ "en-GB", "fr-FR" ], "entryId": '273b8bfa-5dfe-409b-872d-95e6a72f6bc9', "includeInMenu": true }; client.nodes.create(node) .then(result => { console.log('API call result: ', result); }) .catch(error => { console.log('API call fetch error: ', error); });

Minimum request

JAVASCRIPT
1
2
3
4
5
6
7
8
9
10
11
12
13
let node = { "parentId": '7840f70a-b842-42ea-bfac-148a3b772ac8', "displayName": { "en-GB": "Tiger Escaped From Zoo" } }; client.nodes.create(node) .then(result => { console.log('API call result: ', result); }) .catch(error => { console.log('API call fetch error: ', error); });

Validations

JSON
1
2
3
4
5
6
7
8
9
10
11
{ "logId": "00000000-0000-0000-0000-000000000000", "message": "There were validation errors creating the node", "data": [ { "field": "", "message": "The parent id cannot be an empty guid" } ], "type": "Validation" }
JSON
1
2
3
4
5
6
7
8
9
10
11
{ "logId": "00000000-0000-0000-0000-000000000000", "message": "There were validation errors creating the node", "data": [ { "field": "", "message": "A parent must not have more than 2000 children" } ], "type": "Validation" }
JSON
1
2
3
4
5
6
7
8
9
10
11
{ "logId": "00000000-0000-0000-0000-000000000000", "message": "There were validation errors creating the node", "data": [ { "field": "", "message": "The maximum depth for a node is 10 levels deep" } ], "type": "Validation" }
JSON
1
2
3
4
5
6
7
8
9
10
11
{ "logId": "00000000-0000-0000-0000-000000000000", "message": "There were validation errors creating the node", "data": [ { "field": "", "message": "A slug is required for at least one language" } ], "type": "Validation" }
JSON
1
2
3
4
5
6
7
8
9
10
11
{ "logId": "00000000-0000-0000-0000-000000000000", "message": "There were validation errors creating the node", "data": [ { "field": "", "message": "The node slug cannot be longer than 50 characters" } ], "type": "Validation" }
JSON
1
2
3
4
5
6
7
8
9
10
11
{ "logId": "00000000-0000-0000-0000-000000000000", "message": "There were validation errors creating the node", "data": [ { "field": "", "message": "The node slug repeatedSlug exists for the language en-GB in parent f3322e4f-72b5-4064-be88-fcfed6c82635 in the tree 1126b642-409b-4372-bb17-0bdb7f641a5d" } ], "type": "Validation" }

Still need help?

New support request