@@ -20,13 +20,13 @@ To use the Contentstack Java SDK to your existing project, perform the steps giv
2020< dependency>
2121 < groupId> com. contentstack. sdk< / groupId>
2222 < artifactId> java< / artifactId>
23- < version> 1.5 . 6 < / version>
23+ < version> 1.5 . 7 < / version>
2424< / dependency>
2525```
2626
27272 . ** Gradle**
2828``` java
29- implementation ' com.contentstack.sdk:java:1.5.6 '
29+ implementation ' com.contentstack.sdk:java:1.5.7 '
3030```
3131
3232### Key Concepts for using Contentstack
@@ -59,7 +59,7 @@ A publishing environment corresponds to one or more deployment servers or a cont
5959
6060To initialize the SDK, specify application API key, access token, and environment name of the stack as shown in the snippet given below:
6161``` java
62- Stack stack = Contentstack . stack( " apiKey " , " accessToken" , " environment_name" );
62+ Stack stack = Contentstack . stack( " APIKey " , " accessToken" , " environment_name" );
6363```
6464To get the API credentials mentioned above, log in to your Contentstack account and then in your top panel navigation, go to Settings > ; Stack to view the API Key and Access Token.
6565
@@ -73,13 +73,13 @@ To retrieve a single entry from a content type use the code snippet given below:
7373ContentType contentType = stack. contentType(" content_type_uid" );
7474Entry blogEntry = contentType. entry(" entry_uid" );
7575blogEntry. fetch(new EntryResultCallBack () {
76- @Override
77- public void onCompletion (ResponseType responseType , Error error ) {
78- if (error == null ) {
79- [ Success block]
80- } else {
81- [ Error block]
82- }}
76+ @Override
77+ public void onCompletion (ResponseType responseType , Error error ) {
78+ if (error == null ) {
79+ // Success block
80+ } else {
81+ // Error block
82+ }}
8383 });
8484 ```
8585##### Get Multiple Entries
@@ -90,13 +90,14 @@ To retrieve multiple entries of a particular content type, use the code snippet
9090// stack is an instance of Stack class
9191Query blogQuery = stack. contentType(" content_type_uid" ). query();
9292blogQuery. find(new QueryResultsCallBack () {
93- @Override
94- publicvoidonCompletion (ResponseType responseType , QueryResult queryResult , Error error ) {
95- if (error == null ){
96- [Success block]
97- }else {
98- [Error block]
99- }}});
93+ @Override
94+ public void onCompletion (ResponseType responseType , QueryResult queryResult , Error error ) {
95+ if (error == null ){
96+ // Success block
97+ }else {
98+ // Error block
99+ }}
100+ });
100101 ```
101102
102103
0 commit comments