Instacount API Java Client

Java client for the Instacount API based upon the Netflix Feign library.

License

License

Categories

Categories

Java Languages CLI User Interface
GroupId

GroupId

io.instacount
ArtifactId

ArtifactId

instacount-java-client
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

Instacount API Java Client
Java client for the Instacount API based upon the Netflix Feign library.
Project URL

Project URL

https://github.com/instacount/instacount-java-client
Project Organization

Project Organization

Instacount
Source Code Management

Source Code Management

http://github.com/instacount/instacount-java-client

Download instacount-java-client

How to add to project

<!-- https://jarcasting.com/artifacts/io.instacount/instacount-java-client/ -->
<dependency>
    <groupId>io.instacount</groupId>
    <artifactId>instacount-java-client</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/io.instacount/instacount-java-client/
implementation 'io.instacount:instacount-java-client:1.0.2'
// https://jarcasting.com/artifacts/io.instacount/instacount-java-client/
implementation ("io.instacount:instacount-java-client:1.0.2")
'io.instacount:instacount-java-client:jar:1.0.2'
<dependency org="io.instacount" name="instacount-java-client" rev="1.0.2">
  <artifact name="instacount-java-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.instacount', module='instacount-java-client', version='1.0.2')
)
libraryDependencies += "io.instacount" % "instacount-java-client" % "1.0.2"
[io.instacount/instacount-java-client "1.0.2"]

Dependencies

compile (12)

Group / Artifact Type Version
com.netflix.feign : feign-core jar 8.13.1
com.netflix.feign : feign-jackson jar 8.13.1
com.netflix.feign : feign-httpclient jar 8.13.1
com.netflix.feign : feign-okhttp jar 8.13.1
com.netflix.feign : feign-ribbon jar 8.13.1
com.google.guava : guava jar 18.0
com.fasterxml.jackson.core : jackson-core jar 2.6.3
com.fasterxml.jackson.core : jackson-databind jar 2.6.3
com.fasterxml.jackson.datatype : jackson-datatype-guava jar 2.6.3
com.fasterxml.jackson.datatype : jackson-datatype-joda jar 2.6.3
com.sappenin.utils : java-utils jar 1.1.2
com.sappenin.utils.rest : rest-utils2 jar 1.0.2

provided (1)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.16.6

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

instacount-java-client

Circle CI

A Java client for accessing the Instacount API. This client is built using Feign by Netflix.

Maven

We haven't published this client to Maven Central yet, but will shortly. In the meantime, you will need to download the client from here, and include the following dependency information:

<dependency>
     <groupId>io.instacount</groupId>
     <artifactId>instacount-java-client</artifactId>
    <version>1.0.2-SNAPSHOT</version>
</dependency>

Basics

Using the Instacount Java client is easy.

First, create an instance of InstacountClientParams. This will be used to supply your client implementation with the proper credentials (Application Id and Key) to allow it to access your instacount account. It will also be used to supply an actual HTTP implementation.

For ease of use, we recommend extending AbstractInstacountClientParams, like this:

/**
* An extension of {@link AbstractInstacountClientParams} that allows implementors to provide application-specific 
* credentials and other information necessary to bootstrap the InstacountClient. 
*/
public class MyClientParams extends AbstractInstacountClientParams {
	
	@Override
	public String getInstacountApplicationId()
	{
		 ... // Your Instacount Application Id
	}

	@Override
	public String getInstacountReadOnlyApplicationKey()
	{
		 ... // Your Instacount Read-Only Application Key
    }

	@Override
	public String getInstacountReadWriteApplicationKey()
	{
	    ... // Your Instacount Read-Only Application Key
	}    	
}

Next, instantiate your client using the InstacountClient.Builder, like this:

final Instacount client = Instacount.Builder.build(params);

Instacount Client on Google App Engine

The Instacount client uses Square's OKHttp client for actual HTTP calls. However, Square's library (as well as Apache's HTTPClient) is not supported inside of the Google App Engine runtime. Thus, if you're using the Instacount client inside of Google App Engine, then you'll want to leverage our App Engine client that uses Google's URLFetch service as its HTTP implementation.

For more information about how to configure the Instacount client inside of Google App Engine, please see here.

More Examples

For more examples of how to use the Instacount API Java client, see the unit tests in InstacountClientTest.java.

io.instacount

instacount.io

A cloud-based API for counting anything.

Versions

Version
1.0.2