annict-kt

Annict API の Kotlin用ライブラリです

基本情報

カテゴリ
開発者向けライブラリ
URL
github.com

開発メンバー

Takagi (@Takagi)

annict-kt

Annict API wrapper for Kotlin Library.

Kotlin
annict-kt
license
issues
pull requests

https://annict.jp/userland/projects/61

Documents

https://iam-takagi.github.io/annict-kt/kdoc/annict-kt/index.html

Installation

Download

repositories {
    maven ( url = "https://dl.bintray.com/riptakagi/maven/")
}

dependencies {
    implementation 'jp.annict:annict-kt:2.4.2'
}

or

repositories {
    jcenter()
}

dependencies {
    implementation 'jp.annict:annict-kt:2.4.2'
}

Example

Authorization

// Get Token (アクセストークンを取得する)
val response = AnnictAuth().token("client_id", "client_secret", "authorization_code"(default), "urn:ietf:wg:oauth:2.0:oob"(default), "code")
val access_token = response.access_token
// Get Info (認証ユーザの情報を取得する)
val response = AnnictAuth().info("access_token")
// Revoke Token (トークンを失効させる)
val result = AnnictAuth().revoke("client_id", "client_secret", "access_token")

Client

// Create Client (クライアント作成)
val client = AnnictClient("access_token")

Service

// 作品情報取得
val response = client.getWorks(filter_title = "氷菓")
val works = response.works
// キャスト情報取得
val response = client.getCasts(filter_work_id = 1808, per_page = 5, page = 5)
val casts = response.casts