chy.stat API client

Java client to work with the public chy.stat API

Лицензия

Лицензия

Категории

Категории

Java Языки программирования CLI Взаимодействие с пользователем
Группа

Группа

cz.diribet
Идентификатор

Идентификатор

chystat-api-client-java
Последняя версия

Последняя версия

1.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

chy.stat API client
Java client to work with the public chy.stat API
Ссылка на сайт

Ссылка на сайт

https://github.com/diribet/chystat-api-client-java
Система контроля версий

Система контроля версий

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

Скачать chystat-api-client-java

Как подключить последнюю версию

<!-- 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"]

Зависимости

compile (7)

Идентификатор библиотеки Тип Версия
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)

Идентификатор библиотеки Тип Версия
org.projectlombok : lombok jar 1.18.12

Модули Проекта

Данный проект не имеет модулей.

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.

Версии библиотеки

Версия
1.0.1
1.0.0