CloudPlugs REST Library  1.0.0
for Java
CloudPlugs Java Client Library

CloudPlugs REST Client for Java is a library to perform HTTP requests to CloudPlugs servers. The official repository is

The CloudPlugs IoT Platform

CloudPlugs is a cloud based IoT platform to enable the fast prototyping, connection, deployment and management of smart "Things" (sensors, smartphones, home appliances, etc.). Different objects can interact with each other by publishing and/or reading data on shared channels through simple communication protocols. You can learn more at , and you can sign-up on to start connecting your Things.

Library Guide


Just put the library source files in your Java project and you are done.
You need the the packages (and subpackages of) com.cloudplugs and org.json.


Import the main Clouplugs REST Client classes:


Create a new instance of the class:

RestClient restClient = new RestClient();

Now you could configure the client instance with the right authentication credentials for obtaining a new instance:

// create new default options
Opts opts = new Opts();
// set the authentication credentials, if needed
opts.setAuth(myAuthId, myAuthPassword, isMaster);
// get the new RestManager
RestManager restManager = restClient.getManager(opts);

Finally you are ready to perform REST requests to the server!
However it's not necessary the to setup all the options before calling restClient.getManager(opts), you could obtain the before setting any option. See for further details about the available options to configure.

Executing HTTP requests

After you get a configured instance of, you can execute HTTP requests to the CloudPlugs server by invoking any of the request methods. For easy understanding, such methods of have names prefixed with exec. All the requests are asynchronous and are performed according to the CloudPlugs REST API documentation. Example:

// read all device properties and information:
// set the property "myPropertyName" to the integer 123:
restManager.execSetDeviceProp("myPropertyName", 123, restCallback);

where restCallback is an instance of will receive the response.