You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-1Lines changed: 19 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,7 @@ var client = contentful.createClient({
75
75
// This is the access token for this space. Normally you get both ID and the token in the Contentful web app
76
76
accessToken:'YOUR_ACCESS_TOKEN'
77
77
})
78
+
78
79
// This API call will request a space with the specified ID
79
80
client.getSpace('spaceId')
80
81
.then((space) => {
@@ -83,6 +84,17 @@ client.getSpace('spaceId')
83
84
.then((entries) => {
84
85
console.log(entries.items)
85
86
})
87
+
88
+
// let's get a content type
89
+
space.getContentType('product')
90
+
.then((contentType) => {
91
+
// and now let's update its name
92
+
contentType.name='New Product'
93
+
contentType.update()
94
+
.then((updatedContentType) => {
95
+
console.log('Update was successful')
96
+
})
97
+
})
86
98
})
87
99
```
88
100
@@ -98,7 +110,13 @@ The [Contentful's JS SDK reference](https://contentful.github.io/contentful-mana
98
110
99
111
Most methods also have examples which show you how to use them.
100
112
101
-
You can start by looking at the top level [`contentfulManagement`](./contentfulManagement.html) namespace.
113
+
You can start by looking at the top level `contentfulManagement` namespace.
114
+
115
+
The `ContentfulClientAPI` namespace defines the methods at the Client level which allow you to create and get spaces.
116
+
117
+
The `ContentfulSpaceAPI` namespace defines the methods at the Space level which allow you to create and get entries, assets, content types and other possible entities.
118
+
119
+
The `Entry`, `Asset` and `ContentType` namespaces show you the instance methods you can use on each of these entities, once you retrieve them from the server.
102
120
103
121
From version 1.0.0 onwards, you can access documentation for a specific version by visiting `https://contentful.github.io/contentful-management.js/contentful/<VERSION>`
0 commit comments