Class Contentstack


  • public class Contentstack
    extends Object
    Contentstack class that exposes Stack instance
    • 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 token
        environment - 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 token
        environment - environment name
        config - 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");