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
Contentstack is a headless CMS with an API-first approach. It is a CMS that developers can use to build powerful cross-platform applications in their favorite languages. All you have to do is build your application frontend, and Contentstack will take care of the rest. [Read More](https://www.contentstack.com/). This SDK uses the [Content Management API](https://www.contentstack.com/docs/developers/apis/content-management-api/) (CMA). The CMA is used to manage the content of your Contentstack account. This includes creating, updating, deleting, and fetching content of your account.
3
+
## Contentstack Management Java SDK
4
4
5
-
**Note:**_By using CMA, you can execute GET requests for fetching content. However, we strongly recommend that you always use the [Content Delivery API](https://www.contentstack.com/docs/developers/apis/content-delivery-api/) to deliver content to your web or mobile properties_.
5
+
Contentstack is a headless CMS with an API-first approach. It is a CMS that developers can use to build powerful cross-platform applications in their favorite languages. All you have to do is build your application frontend, and Contentstack will take care of the rest. [Read More](https://www.contentstack.com/).
6
6
7
-
<detailsopen>
8
-
<summary>Table of contents</summary>
7
+
This SDK uses the [Content Management API](https://www.contentstack.com/docs/developers/apis/content-management-api/) (CMA). The CMA is used to manage the content of your Contentstack account. This includes creating, updating, deleting, and fetching content of your account. To use the CMA, you will need to authenticate your users with a [Management Token](https://www.contentstack.com/docs/developers/create-tokens/about-management-tokens) or an [Authtoken](https://www.contentstack.com/docs/developers/apis/content-management-api/#how-to-get-authtoken). Read more about it in [Authentication](https://www.contentstack.com/docs/developers/apis/content-management-api/#authentication).
9
8
10
-
-[Prerequisite](#prerequisite)
11
-
-[Installation](#installation)
12
-
-[Initialization](#initialization)
13
-
-[Authentication](#authentication)
14
-
-[Users](#users)
15
-
-[Organizations](#organizations)
16
-
-[Stacks](#stacks)
17
-
-[Content Types](#content-types)
18
-
-[Global Fields](#global-fields)
19
-
-[Entries](#entries)
20
-
-[Assets](#assets)
21
-
-[Bulk Operation](#bulk-operations)
9
+
Note: By using CMA, you can execute GET requests for fetching content. However, we strongly recommend that you always use the [Content Delivery API](https://www.contentstack.com/docs/developers/apis/content-delivery-api/) to deliver content to your web or mobile properties.
22
10
23
-
</details>
11
+
### Prerequisite
24
12
25
-
- Others
26
-
[Create JSON Body](##RequestBody)
13
+
You need Node.js version 10 or above installed on your machine to use the Contentstack Java CMS SDK.
27
14
28
-
## Prerequisite
29
-
30
-
To use the Contentstack management sdk for Java, you must have:
31
-
32
-
- The suitable [Java Development Environment](http://www.oracle.com/technetwork/java/javase/downloads/).
33
-
- The [Contentstack](https://www.contentstack.com) account.
34
-
- Login your account
35
-
- Get the [Contentstack](https://www.contentstack.com) credentials (API keys and Management Token) set in your stack token section.
36
-
- Should be Java 1.8 or above installed.
37
-
38
-
## Setup
39
-
40
-
To use Contentstack management sdk in our Maven project, we'll need to add the following dependency to our pom.xml:
15
+
### Installation
41
16
17
+
Install it via maven:
42
18
43
19
```java
44
20
<dependency>
@@ -48,200 +24,121 @@ To use Contentstack management sdk in our Maven project, we'll need to add the f
To use the CMA, you will need to authenticate your users with a [Management Token](https://www.contentstack.com/docs/developers/create-tokens/about-management-tokens) or an [Authtoken](https://www.contentstack.com/docs/developers/apis/content-management-api/#how-to-get-authtoken). Read more about it in [Authentication](https://www.contentstack.com/docs/developers/apis/content-management-api/#authentication)
41
+
### Authentication
70
42
71
-
-_Using authtoken_
43
+
To use this SDK, you need to authenticate your users by using the Authtoken, credentials, or Management Token (stack-level token).
72
44
73
-
---
45
+
### Authtoken
74
46
75
47
An [Authtoken](https://www.contentstack.com/docs/developers/create-tokens/types-of-tokens/#authentication-tokens-authtokens-) is a read-write token used to make authorized CMA requests, and it is a **user-specific** token.
[Management Tokens](https://www.contentstack.com/docs/developers/create-tokens/about-management-tokens/) are **stack-level** tokens, with no users attached to them.
[Users](https://www.contentstack.com/docs/developers/apis/content-management-api/#users) All accounts registered with Contentstack are known as Users. A stack can have many users with varying permissions and roles.
73
+
#### Initializing Your SDK
102
74
103
-
Access the user like below snippet:
75
+
To use the JavaScript CMA SDK, you need to first initialize it. To do this, use the following code:
[Organization](https://www.contentstack.com/docs/owners-and-admins/about-organizations) is the top-level entity in the hierarchy of Contentstack, consisting of stacks and [stack](https://www.contentstack.com/docs/developers/set-up-stack/about-stack/) resources, and users. Organization allows easy management of projects as well as users within the Organization.
A [Stack](https://www.contentstack.com/docs/developers/set-up-stack/about-stack) is a space that stores the content of a project (a web or mobile property). Within a stack, you can create content structures, content entries, users, etc. related to the project.
85
+
Use the following lines of code to fetch your stack detail using this SDK:
[Content type](https://www.contentstack.com/docs/developers/apis/content-management-api/#content-types) defines the structure or schema of a page or a section of your web or mobile property. To create content for your application, you are required to first create a content type, and then create entries using the content type.
94
+
To create an entry in a specific content type of a stack, use the following lines of code:
A [Global field](https://www.contentstack.com/docs/developers/apis/content-management-api/#global-fields) is a reusable field (or group of fields) that you can define once and reuse in any content type within your stack. This eliminates the need (and thereby time and efforts) to create the same set of fields repeatedly in multiple content types.
An [entry](https://www.contentstack.com/docs/developers/apis/content-management-api/#entries) is the actual piece of content created using one of the defined content types.
[Assets](https://www.contentstack.com/docs/developers/apis/content-management-api/#assets) refer to all the media files (images, videos, PDFs, audio files, and so on) uploaded in your Contentstack repository for future use.
114
+
The following lines of code can be used to upload assets to your stack:
You can perform [bulk operations](https://www.contentstack.com/docs/developers/apis/content-management-api/#bulk-operations) such as Publish, Unpublish, and Delete on multiple entries or assets, or Change the Workflow Details of multiple entries or assets at the same time.
197
-
198
-
## Others
199
-
200
-
### Create RequestBody
117
+
Stack stack = contentstack.stack("API_KEY");
118
+
Asset asset = stack.asset();
201
119
202
-
- JSON Body could be created by using Map passing in the JSONObject or directly create JSONObject.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
141
+
142
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
143
+
144
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0 commit comments