This is a Getting Started document on how to programatically use the API. For more detailed information, read through the rest of the API documentation.

Download the Sample Code

The sample code is located at https://github.com/iMeetCentral/api-java. You can download or clone the code from there.

This is just a simple application demonstrating a Java application connecting to the iMeet Central API and issuing a few commands. It is not intended to be a library or a full application, but it is a good place to get started before creating your own project.

Generate a key pair

The first thing to be done is to authenticate the application. Since there is no UI to enter a password, it must be done with keys. The first step is to get a private/public key pair.

In iMeet Central, go to Company Setup > Advanced > API. Select a user from the “Act as” dropdown that has the necessary permissions to everything you need in the API. Click “Click New Client Key” or “Regenerate Client Key” if you have created a key previously. This will cause the browser to download a JSON file containing the private key and the client ID.

Setup Key Pair

Go back to the sample code and open api-java/src/main/resources/client_config.yml. Enter the private key and client ID from the downloaded JSON file into this config file.

Run the Sample Project

If running the first time, make sure you run:

mvn clean compile

Try a few commands to verify that things are working.

mvn exec:java
mvn exec:java -Dexec.args="/v1/workspaceGroups"
mvn exec:java -Dexec.args="/v1/workspaceGroups /v1/users"

More documentation is available in the README.

Examine the code

Now that the sample project is working, it is necessary to examine the tools it provides in order for you to create your own project.

Config Options

Get Access Token

This is the main function of the Java application. It will start off by retrieving an access token. It does so by creatin a JWT bearer token, signing with the private key, and then sending the signed token to the iMeet Central Identity server. If this token is verified an access token will be returned.

iMeetCentral highly recommends using the Nimbus JOSE + JWT library. It is quite robust and makes generating and handling JWTs much easier.

Make calls to the API

Once the main class has retrieved an access token from the iMeet Central Identity server, the access token can be used to make calls against the iMeet Central API.

The Java sample can handle any GET request that the iMeet Central API supports. It will make the request and will print out the JSON response. The full iMeet Central API has many other POST and PUT methods, but those are not currently supported by this Java sample. However, the use of the access token is the same for all requests.

CloseableHttpClient httpClient = HttpClientBuilder.create().build();
HttpGet httpGet = new HttpGet(baseUrl + endpoint);
httpGet.addHeader("Authorization", "Bearer " + accessToken);