Java - Domo API SDK
Clone or download
Latest commit 71a31ad Jul 12, 2018

README.md

Java - Domo API SDK

Download License CircleCI Coverage Status

About

  • The Domo API SDK is the simplest way to automate your Domo instance
  • The SDK streamlines the API programming experience, allowing you to significantly reduce your written code
  • This package is published to bintray jcenter

Features:

Setup

The SDK can be added to your project in three ways:

It is currently hosted via bintray and JCenter (It will be in Maven central eventually):

repositories {
    maven {
        url  "http://dl.bintray.com/domoinc/domo-java-sdk"
    }
}

Maven:

<dependency>
  <groupId>com.domo</groupId>
  <artifactId>domo-java-sdk-all</artifactId>
  <version>0.4.0</version>
</dependency>

Gradle:

compile 'com.domo:domo-java-sdk-all:0.4.0'

Classic Jar Import:

  • Clone this repository
  • Using a Bash Terminal, navigate to the cloned repository folder
  • Create the Jar files via the Bash command ./gradlew publishToMavenLocal
  • The Jars will be located in domo-java-sdk-all/build/libs/
  • Copy the Jars to your project folder, and add them to your build path

Usage

  • See the Client Test File for full usage and examples.
  • Create an API Client on the Domo Developer Portal
  • Use your API Client id/secret to instantiate a DomoClient()
  • Multiple API Clients can be used by instantiating multiple Domo Clients
  • Authentication with the Domo API is handled automatically by the SDK
  • If you encounter a 'Not Allowed' error, this is a permissions issue. Please speak with your Domo Administrator.
public class Example {

    public void domoSDKUsage() {

        //Build an SDK configuration
        Config config = Config.with()
                .clientId("MY_CLIENT_ID")
                .clientSecret("MY_CLIENT_SECRET")
                .apiHost("api.domo.com")
                .useHttps(true)
                .scope(USER, DATA)
                .httpLoggingLevel(HttpLoggingInterceptor.Level.BODY)
                .build();

        //Create an instance of the SDK Client
        DomoClient domo = DomoClient.create(config);

        //Manage DataSets
        DataSetClient datasets = domo.dataSetClient();
        datasets.create();

        //Manage Streams
        StreamClient streams = domo.streamClient();
        streams.create();

        //Manage Users
        UserClient users = domo.userClient();
        users.create();

        //Manage User Groups
        GroupClient groups = domo.groupClient();
        groups.create();
    }
}
Snapshots

You can use snapshot versions through JitPack:

  • Go to JitPack project page
  • Select Commits section and click Get it on commit you want to use (top one - the most recent)
  • Follow displayed instruction: add repository and change dependency (NOTE: due to JitPack convention artifact group will be different)

java lib generator