Skip to main content

Returns

Example

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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
let newEntry = { "title": "Back to the future", "tagline": "He's the only kid ever to get into trouble before he was born.", "overview": "Marty McFly, a typical American teenager of the Eighties, is accidentally sent back to 1955 in a plutonium-powered DeLorean \"time machine\" invented by slightly mad scientist. During his often hysterical, always amazing trip back in time, Marty must make certain his teenage parents-to-be meet and fall in love - so he can get back to the future.", "trailer": "https://www.youtube.com/watch?v=qvsgGtivCgs", "releaseDate": "1985-07-02T23:00:00Z", "actors": [ { "sys": { "id": "a1c983d6-4aaf-4456-9f3d-a6eac3139f1c", "language": "en-GB", "dataFormat": "entry" } }, { "sys": { "id": "16f6f2de-e901-4bda-bf3f-092b93ae62a9", "language": "en-GB", "dataFormat": "entry" } }, { "sys": { "id": "09b87c0b-67b2-4028-9358-e29ff16f11da", "language": "en-GB", "dataFormat": "entry" } } ], "sys": { "contentTypeId": "movie", "projectId": "movieDb", "language": "en-GB", "dataFormat": "entry", } }; client.entries.create(newEntry) .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 are validation errors creating the entry", "data": [ { "field": "projectId", "message": "The project does not exist" } ], "type": "Validation" }
JSON
1
2
3
4
5
6
7
8
9
10
11
{ "logId": "00000000-0000-0000-0000-000000000000", "message": "There are validation errors creating the entry", "data": [ { "field": "contentType", "message": "The content type 'movie' does not exist" } ], "type": "Validation" }

Still need help?

New support request