@@ -24,27 +24,27 @@ You need Java 8 or above installed on your machine to use the Contentstack Manag
2424
2525### Installation
2626
27- Install it via maven:
27+ ** Install it via maven:**
2828
2929``` java
3030< dependency>
31- < groupId> com. contentstack. sdk< / groupId>
32- < artifactId> cms< / artifactId>
33- < version> {version}< / version>
31+ < groupId> com. contentstack. sdk< / groupId>
32+ < artifactId> cms< / artifactId>
33+ < version> {version}< / version>
3434< / dependency>
3535```
3636
37- Install it via gradle:
37+ ** Install it via gradle:**
3838
3939``` java
40- implementation' com.contentstack.sdk:cms:{version}'
40+ implementation' com.contentstack.sdk:cms:{version}'
4141```
4242
4343To import the SDK, use the following command:
4444
4545``` java
46- package com.contentstack.cms ;
47- Contentstack contentstack= new Contentstack .Builder (). build();
46+ package com.contentstack.cms ;
47+ Contentstack contentstack = new Contentstack .Builder (). build();
4848```
4949
5050### Authentication
@@ -58,16 +58,16 @@ An [Authtoken](https://www.contentstack.com/docs/developers/create-tokens/types-
5858is a read-write token used to make authorized CMA requests, and it is a ** user-specific** token.
5959
6060``` java
61- Contentstack contentstack= new Contentstack .Builder (). setAuthtoken(" AUTHTOKEN" ). build();
61+ Contentstack contentstack = new Contentstack .Builder (). setAuthtoken(" AUTHTOKEN" ). build();
6262```
6363
6464### Login
6565
6666To Login to Contentstack by using credentials, you can use the following lines of code:
6767
6868``` java
69- Contentstack contentstack= new Contentstack .Builder (). build();
70- contentstack. login(" EMAIL" ," PASSWORD" );
69+ Contentstack contentstack = new Contentstack .Builder (). build();
70+ contentstack. login(" EMAIL" ," PASSWORD" );
7171```
7272
7373### Management Token
@@ -76,8 +76,8 @@ To Login to Contentstack by using credentials, you can use the following lines o
7676* stack-level** tokens, with no users attached to them.
7777
7878``` java
79- Contentstack contentstack= new Contentstack .Builder (). setAuthtoken(" AUTHTOKEN" ). build();
80- Stack stack= contentstack. stack(" API_KEY" ," MANAGEMENT_TOKEN" );
79+ Contentstack contentstack = new Contentstack .Builder (). setAuthtoken(" AUTHTOKEN" ). build();
80+ Stack stack= contentstack. stack(" API_KEY" ," MANAGEMENT_TOKEN" );
8181```
8282
8383### Contentstack Management Java SDK: 5-minute Quickstart
@@ -87,52 +87,52 @@ To Login to Contentstack by using credentials, you can use the following lines o
8787To use the Java CMA SDK, you need to first initialize it. To do this, use the following code:
8888
8989``` java
90- Contentstack contentstack= new Contentstack .Builder (). setAuthtoken(" AUTHTOKEN" ). build();
90+ Contentstack contentstack = new Contentstack .Builder (). setAuthtoken(" AUTHTOKEN" ). build();
9191```
9292
9393#### Fetch Stack Detail
9494
9595Use the following lines of code to fetch your stack detail using this SDK:
9696
9797``` java
98- Stack stack= contentstack. stack(" API_KEY" );
99- Response<ResponseBody > response= stack. fetch(). execute();
98+ Stack stack = contentstack. stack(" API_KEY" );
99+ Response<ResponseBody > response = stack. fetch(). execute();
100100```
101101
102102#### Create Entry
103103
104104To create an entry in a specific content type of a stack, use the following lines of code:
105105
106106``` java
107- Contentstack contentstack= new Contentstack .Builder (). setAuthtoken(" AUTHTOKEN" ). build();
108- Stack stack= contentstack. stack(" API_KEY" );
109- JSONObject body= ....
110- Response<ResponseBody > response= entry. create(body). execute();
111- if (response. isSuccessful()){
112- System . out. println(response. body());
113- }
107+ Contentstack contentstack = new Contentstack .Builder (). setAuthtoken(" AUTHTOKEN" ). build();
108+ Stack stack= contentstack. stack(" API_KEY" );
109+ JSONObject body = ....
110+ Response<ResponseBody > response= entry. create(body). execute();
111+ if (response. isSuccessful()){
112+ System . out. println(response. body());
113+ }
114114```
115115
116116#### Create Asset
117117
118118The following lines of code can be used to upload assets to your stack:
119119
120120``` java
121- Contentstack contentstack= new Contentstack .Builder (). setAuthtoken(" AUTHTOKEN" ). build();
122- Stack stack= contentstack. stack(" API_KEY" );
123- Asset asset= stack. asset();
124- Response<ResponseBody > response= asset. uploadAsset(" filePath" ," description" ). execute();
125- if (response. isSuccessful()){
126- System . out. println(response. body());
127- }else {
128- System . out. println(response. errorBody());
129- }
121+ Contentstack contentstack = new Contentstack .Builder (). setAuthtoken(" AUTHTOKEN" ). build();
122+ Stack stack= contentstack. stack(" API_KEY" );
123+ Asset asset= stack. asset();
124+ Response<ResponseBody > response= asset. uploadAsset(" filePath" ," description" ). execute();
125+ if (response. isSuccessful()){
126+ System . out. println(response. body());
127+ }else {
128+ System . out. println(response. errorBody());
129+ }
130130```
131131
132132### Helpful Links
133133
134134- [ Contentstack Website] ( https://www.contentstack.com/ )
135- - [ Official Documentation] ( https://contentstack.com/docs )
135+ - [ API Reference Documentation] ( https://www. contentstack.com/docs/developers/sdks/content-management-sdk/java )
136136- [ Content Management API Docs] ( https://www.contentstack.com/docs/developers/apis/content-management-api )
137137
138138### The MIT License (MIT)
0 commit comments