public static void main(final String[]args) {

        // First test if the creds are set via environment args
        String userId = System.getenv().get("BANDWIDTH_USER_ID");
        String apiToken = System.getenv().get("BANDWIDTH_API_TOKEN");
        String apiSecret = System.getenv().get("BANDWIDTH_API_SECRET");

        try {
            final Account account = Account.get();

            System.out.println("Environment Vars:");
            System.out.println(account.getAccountInfo());
        }
        catch(final Exception e) {
            e.printStackTrace();
        }

        // Then test if they are set via system props

        userId = System.getProperty("com.bandwidth.userId");
        apiToken = System.getProperty("com.bandwidth.apiToken");
        apiSecret = System.getProperty("com.bandwidth.apiSecret");

        try {
            final Account account = Account.get();

            System.out.println("System Props:");
            System.out.println(account.getAccountInfo());
        }
        catch(final Exception e) {
            e.printStackTrace();
        }

        // Finally just set them directly
        userId = "your_User_Id_here";
        apiToken = "your_API_Token_here";
        apiSecret = "your_API_Secret_here";

        try {
            BandwidthClient.getInstance().setCredentials(userId, apiToken, apiSecret);

            final Account account = Account.get();

            System.out.println("SDK api:");
            System.out.println(account.getAccountInfo());
        }
        catch(final Exception e) {
            e.printStackTrace();
        }
    }
public static void main ( final String [ ] args ) { String userId = System . getenv ( ) . get ( "BANDWIDTH_USER_ID" ) ; String apiToken = System . getenv ( ) . get ( "BANDWIDTH_API_TOKEN" ) ; String apiSecret = System . getenv ( ) . get ( "BANDWIDTH_API_SECRET" ) ; try { final Account account = Account . get ( ) ; System . out . println ( "Environment Vars:" ) ; System . out . println ( account . getAccountInfo ( ) ) ; } catch ( final Exception e ) { e . printStackTrace ( ) ; } userId = System . getProperty ( "com.bandwidth.userId" ) ; apiToken = System . getProperty ( "com.bandwidth.apiToken" ) ; apiSecret = System . getProperty ( "com.bandwidth.apiSecret" ) ; try { final Account account = Account . get ( ) ; System . out . println ( "System Props:" ) ; System . out . println ( account . getAccountInfo ( ) ) ; } catch ( final Exception e ) { e . printStackTrace ( ) ; } userId = "your_User_Id_here" ; apiToken = "your_API_Token_here" ; apiSecret = "your_API_Secret_here" ; try { BandwidthClient . getInstance ( ) . setCredentials ( userId , apiToken , apiSecret ) ; final Account account = Account . get ( ) ; System . out . println ( "SDK api:" ) ; System . out . println ( account . getAccountInfo ( ) ) ; } catch ( final Exception e ) { e . printStackTrace ( ) ; } }
@param args the args.