Rest client for KiiCloud
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


KiiRestClient for Java Download

A REST client for Kii Cloud for Android and Java applications.
This library is beta release. API incompatibility changes will occur in beta releases.


Download the latest JAR or grab via Maven:


or Gradle:

compile ''

kii-rest-client4j is published in JCenter repository. so you need to add a repository to your project.




repositories {



Current Features

  • Managing Users
    • Sing-Up
    • Sign-In
    • Authenticating with the SocialNetworkConnector (only Generating URL)
    • Authenticating with the Native Applications
    • Refreshing Token
    • Changing Passwords
    • Resetting Passwords
    • Phone/Email Verification
    • Retrieving/Updating/Deleting Users
    • Pseudo Users
  • Managing Things
    • Registering/Unregistering Thing
    • Retrieving/Updating Thing
    • Enable/Disable Thing
    • Checking if a Thing is Registered
    • Geting an Access Token
    • Adding Owners with Simple Flow
    • Adding Owners with PIN Code Validation Flow
    • Checking the Ownership
    • Getting a list of Owners
    • Removing the Ownership
  • Managing Groups
    • Creating/Updating/Deleting Groups
    • Changing a Group Owner
    • Listing Group
    • Listing Group Members
    • Adding/Removing Group Members
  • Managing Data
    • Granting/Revoking an Permission to a Bucket
    • Creating/Retrieving/Updating/Deleting Objects
    • Querying for Objects
    • Uploading Object Bodies
    • Downloading Object Bodies
    • Moving Object Bodies
    • Publishing Object Bodies
    • Deleting Object Bodies
    • Creating/Deleting Buckets
    • Granting/Revoking an Permission to a Objects
    • Granting/Revoking an Permission to a Scope
  • Managing Analytics
    • Uploading Event Data
    • Fetching Analytics Results (Tabular/Grouped)
    • Creating/Listing/Retrieving/Deleting ConversionRules
    • Creating/Listing/Retrieving/Deleting AggregationRules
  • Managing Push Notification
    • Creating/Deleting Topic
    • Listing Topic names
    • Subscribe/Unsubscribe Topic
    • Checking Subscription status
    • Sending Message
    • Install/Uninstall PushInstallation
    • Retrieving/Listing PushInstallation
  • Admin Features
    • Getting app admin token
    • Getting/Setting App Configuration Parameters
    • Getting/Setting ThingType Configuration
  • Securing Data
    • Setting ACL to Scope
    • Setting ACL to Buckets
    • Setting ACL to Topics
    • Setting ACL to Objects
  • Server Extension
    • Deploying Server Code
    • Executing Server Code
    • Listing the Available Versions
    • Switch the Active Server Code
    • Getting Server Source Code
    • Deleting Server Code
    • Deploying Server Hook Config File
    • Getting Server Hook Config File
    • Deleting Server Hook Config File
    • Querying for Execution Result
    • Getting Execution Result
    • Getting Devlog
    • Tailing Devlog


API design is very simple. There are two kinds of classes.
The first is resource classes that represents the REST API.
The second is model classes that represents the REST request and response.

How to build

  1. edit the src/test/resources/test_config.json if you want to execute all unit tests.
  2. build project using maven.
  3. target/kii-rest-client4j.jar will be created when build is successful.
mvn package

If you want to skip unit tests, try following command.

mvn package -DskipTests

If you want to calculate code coverage, try following command.

mvn cobertura:cobertura
open target/site/cobertura/index.html

How to test

Unit tests sends request to KiiCloud server according src/test/resources/test_config.json settings.
Some test cases need app admin credentials or access token that is issued by SNS, but you must not push the these credentials to the github.
You can write these credentials to src/test/resources/test_admin_credential_config.json instead of test_config.json.
test_admin_credential_config.json is specified by the .gitignore file.
If you don't specify these credentials, some tests will be skipped(ignored).
For more detail, Please refer to the

Example usage

// initialize rest client
KiiRest rest = new KiiRest("APP_ID", "APP_KEY", KiiRest.Site.US);

// register a user
KiiNormalUser user = new KiiNormalUser()
user = rest.api().users().register(user, "pasword");

// create app scope object
KiiObject appObject = new KiiObject()
	.set("user_id", user.getUserID())
	.set("email", user.getEmail());

// create user scope object
KiiObject userObject = new KiiObject()
	.set("age", 30);

//update object
appObject.set("email", "");

For more examples, please refer to the test code.


Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.