Skip to content

Kryszak/gwatlin

Repository files navigation

Build Status Codacy Badge Codacy Badge License: MIT Maven Central

Gwatlin

Guild Wars 2 API client written in Kotlin

About

This repository contains code for Guild Wars 2 API client based on documentation.

Client operates on API version v2.

JDK versions compatibility

JDK Gwatlin
21 1.9.2 and above
17 1.9.1 and below

Important

It seems that not all api features are documented on wiki page, so feel free to create issues for missing features. Issue should contain example json response for given endpoint.

Example usage

Artifact is available on Maven Central repository.

Documentation

For full code documentation visit documentation page

Code

// Client without API KEY
val wvwClient = GWWvwClient()
val wvwRank = wvwClient.getRanks(listOf(1))
println(wvwRank)
// WvwRank(id=1, minRank=1, title=Invader)

// Client with API KEY
val tokenInfoClient = GWTokenClient("API KEY here")
val tokenInfo = tokenInfoClient.getTokenInfo()
println(tokenInfo)
// Token(id=ABCDE02B-8888-FEBA-1234-DE98765C7DEF, name=My API Key, permissions=[account, characters, tradingpost, unlocks, build], type=null, expiresAt=null, issuedAt=null, urls=null)

Release

To release new version, increment project.version property in build file. Next, run release script to create new tag and push it to GitHub or create and push new tag manually. New package version will be deployed to Maven repository by GitHub Actions.