Organization Client

The Organization client is used to interact with the LaunchKey Platform SDK at an Organization level. As such it identifies itself with Organization level credentials found in the Keys tab or the Organization's page on Dashboard.

Creating an Organization Client

An Organization client can be created by using the client factory. It uses Organization specific data to identify itself, sign the request data, and decrypt encrypted response data. All of the information can be located on the Keys tab of the Organization's page in Dashboard. The data is as follows:

  • Organization Key
  • Private Key

The Private Key may be represented as either a PEM formatted string or a java.security.interfaces.RSAPrivateKey object.

Example:

long orgKey = 1234567890;
String privateKey = "-----BEGIN RSA PRIVATE KEY-----\n"+
        "MIIBOwIBAAJBALEihtCuDrAp35QpaUZ+ycfsdsCGRQGUz8nbkNwP2XsCZPqamj2A\n"+
        "QF3Tgod8tTCvvEw4X1YUuHposQnDiYkb3bkCAwEAAQJBALECAZpy9PaRQXy7TRpH\n"+
        "BLil0Z1eD4MfA+2BXeaqZ/eEqRyGzPqTYP+Ch6EB8t+xuWMoG3xgA55AxTle++TG\n"+
        "dQECIQDdadMLa2z9e8cPQ42+XU4vtPdh3P2Okewg6ST9wYOhkQIhAMzOCKcDC7Pz\n"+
        "eg3SKvG40i2/VLJfHP72gLFkdIb2+GWpAiBi5bbfve8j1hrW5Yy1gAXBZ2qsKsKS\n"+
        "4PkAxkLAmaRLEQIhAMT7ngLUwRrRoaFNdZSMyUrK7fGp3b+048666gEt5XgRAiBf\n"+
        "UHCrSnIR6lx7FksBbVZdvqNZViJL1kVVLNXa9JgHiw==\n"+
        "-----END RSA PRIVATE KEY-----\n";

OrgClient orgClient = clientFactory.makeOrgClient(orgKey, privateKey);

Directory Service

The directory service allows you to interface with end-users and devices via the LaunchKey Platform API. It can be obtained by passing an Authenticator SDK Key to the whiteLabel method of the Organization Client. The SDK Key can be obtained on the directories page on Dashboard.

Example:

String sdkKey = "265UJIUOXCZPMJ5YMWU4H0XUV3AK89ET";
WhiteLabelService whiteLabelService = orgClient.whiteLabel(sdkKey);

Get Linked Devices

To obtain a list containing each Device linked to a Directory User, you will invoke the getLinkedDevices method of the WhiteLabelService. The getLinkedDevices method takes a single argument which is the Directory User ID.

Example:

String identifier = "my-permanent-unique-user-identifier";
List<Device> devices;
try {
    List<Device> devices = whiteLabelService.getLinkedDevices(identifier);
    for (Device device : devices) {
        System.out.println("Name:    " + device.getName());
        System.out.println("Type:    " + device.getType());
        System.out.println("Status:  " + device.getStatus());
        System.out.println("Created: " + device.getCreated());
        System.out.println("Updated: " + device.getUpdated());
    }
}
catch(BaseException e) {
    //error handling
}

User Contributed

LaunchKey links to user contributed code as a resource to its community. LaunchKey does not in any way guarantee or warrant the quality and security of these code bases. User contributed code is supported by the creators. If you do find a link from the site to user contributed code that is malicious or inappropriate in any way, please report that link to LaunchKey immediately and we will investigate the claim. Submit any issue to LaunchKey support at https://launchkey.com./support. ×