chy.stat API client

Java client to work with the public chy.stat API

License

License

Categories

Categories

Java Languages CLI User Interface
GroupId

GroupId

cz.diribet
ArtifactId

ArtifactId

chystat-api-client-java
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

chy.stat API client
Java client to work with the public chy.stat API
Project URL

Project URL

https://github.com/diribet/chystat-api-client-java
Source Code Management

Source Code Management

https://github.com/diribet/chystat-api-client-java

Download chystat-api-client-java

How to add to project

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

Dependencies

compile (7)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.30
com.squareup.okhttp3 : okhttp jar 4.9.0
com.squareup.okhttp3 : logging-interceptor jar 4.9.0
com.google.code.gson : gson jar 2.8.6
com.auth0 : java-jwt jar 3.11.0
org.apache.commons : commons-lang3 jar 3.11
com.google.guava : guava jar 28.1-jre

provided (1)

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

Project Modules

There are no modules declared in this project.

chy.stat API java client

Build Status Maven Central

A Java client that you can use to work with the public chy.stat API.

How to install the client with Maven

To install chy.stat API client with Maven2/3, you can use the library version available in Maven Central by adding the following dependency

<dependencies>
    <dependency>
        <groupId>cz.diribet</groupId>
        <artifactId>chystat-api-client-java</artifactId>
        <version>1.0.0</version>
    </dependency>
</dependencies>

How to use the client

To use the client you have to provide

  • base URL
  • JwtTokenProvider

and optionally an Gson object

Base URL

It's a base URL. All request are then evaluated relative to this URL. For example

"https://some.chystat.site/api/v1"

Gson

We use Gson to serialize a Java object to the request body and deserialize response body to a Java object respectively.

JwtTokenProvider

All requests to the chy.stat API are authenticated and authorized. We use HMAC authentication and JWT (JSON Web Tokens)

You can use the default provider implementation which generates the JWT token for you. See API documentation where is described how to get the required token ID and the token secret.

Code example

String baseUrl = "https://some.chystat.site/api/v1"
String tokenId = "i54m56W5R2aJVw/JYq1wIQ"
String tokenSecret = "CFu5345NWMR2E4eP"
JwtTokenProvider jwtTokenProvider = new DefaultJwtTokenProvider(tokenId, tokenSecret);

IApiClient client = new ChystatApiClient(baseUrl, jwtTokenProvider);
ResponsePayload responsePayload = client.get("/orders/orders/1")

See the current API documentation for more details about the API and authentication.

Contributing

Please feel free to open a GitHub Issue, or a pull Request if you find any bug or if you have some idea for improvement.

License

This project is licensed under the terms of the MIT license.

cz.diribet

Diribet s.r.o.

Versions

Version
1.0.1
1.0.0