GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - databox/databox-java: Databox API wrapper for Java

BranchesTags
Open more actions menu

Latest commit

 

History

75 Commits
75 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
examples/pushData/src
examples/pushData/src
 
 
src
src
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

Databox

This package is designed to consume the Databox Push API functionality via a Java client.

Installation

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>org.databox</groupId>
  <artifactId>databox</artifactId>
  <version>2.5.1</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

  repositories {
    mavenCentral()     // Needed if the 'databox' jar has been published to maven central.
    mavenLocal()       // Needed if the 'databox' jar has been published to the local maven repo.
  }

  dependencies {
     implementation "org.databox:databox:2.5.1"
  }

Prerequisites

In use the Databox Push API functionality, please refer to Databox Developers Page, specifically the Quick Guide section, where you will learn how to create a Databox Push API token which is required for pushing your data.

Example

import org.databox.ApiClient;
import org.databox.ApiException;
import org.databox.Configuration;
import org.databox.api.DefaultApi;
import org.databox.auth.HttpBasicAuth;
import org.openapitools.client.model.PushData;
import org.openapitools.client.model.PushDataAttribute;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://push.databox.com");
    defaultClient.addDefaultHeader("Accept", "application/vnd.databox.v2+json");

    HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
    basicAuth.setUsername("Your_Databox_API_Token");

    PushData data = new PushData()
            .key("Metric_name") // e.g. sales
            .value(123f)
            .date("Date_in_ISO8601") // e.g. "2024-08-01T00:00:00Z"
            .unit("Unit") // optional - e.g. USD
            .attributes(List.of(new PushDataAttribute().key("Dimension_name").value("Dimension_value"))); // optional - e.g. currency & USD

    DefaultApi apiInstance = new DefaultApi(defaultClient);
    try {
      apiInstance.dataPost(List.of(data));
    } catch (ApiException e) {
      e.printStackTrace();
    }
  }
}

About

Databox API wrapper for Java

bintray.com/databox/databox/databox-sdk/view

Resources

Readme
MIT license
Activity
Custom properties

Stars

3 stars

Watchers

8 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.