Package com.contentstack.sdk
Class Contentstack
- java.lang.Object
-
- com.contentstack.sdk.Contentstack
-
public class Contentstack extends Object
Contentstack class that exposes Stack instance
-
-
Method Summary
Modifier and Type Method Description static Stack
stack(String stackApiKey, String accessToken, String environment)
Authenticates the stack api key of your stack.static Stack
stack(String stackApiKey, String accessToken, String environment, Config config)
Authenticates the stack api key of your stack.
-
-
-
Method Detail
-
stack
public static Stack stack(String stackApiKey, String accessToken, String environment) throws Exception
Authenticates the stack api key of your stack. This must be called before your stack uses Contentstack sdk.
You can find your stack api key from web.- Parameters:
stackApiKey
- application api Key of your application on Contentstack.accessToken
- access tokenenvironment
- environment name- Returns:
Stack
instance.- Throws:
Exception
-
Example :
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag");
-
stack
public static Stack stack(String stackApiKey, String accessToken, String environment, Config config) throws Exception
Authenticates the stack api key of your stack. This must be called before your stack uses Contentstack sdk.
You can find your stack api key from web.- Parameters:
stackApiKey
- application api Key of your application on Contentstack.accessToken
- access tokenenvironment
- environment nameconfig
-Config
instance to set environment and other configuration details.- Returns:
Stack
instance.- Throws:
Exception
-
Example :
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag");
-
-