Using the API

Data can be passed as a POST request method or as a variable on the URL such as json={"field":"value"}

API Query Format

Copy
https://[HUB IP or DNS]/lwl/api?json={“field1”:”value1”,”field2”:”value2”…}

Example

Copy
https://10.10.10.10/lwl/api?json={"inspector":"applications"}

This will return the Applications Inspector for Yesterday.

You must pass the Inspector type. The Inspector determines the type of table your data comes from. Everything else is optional. As seen above, the following example will return the Applications Inspector for Yesterday.

Copy
/lwl/api?json={"inspector":"applications"}

Next, you want to add a basis. The basis is a column that is included in the 'group by' of the SQL query. A sample basis could be users, machines, application_name. The basis columns would be user_id, user_name, node_id, node_name, application_name. This example would return the User Inspector for Yesterday. You get column for the basis users, which are user_name and user_id. This would be a total for each user, for the time period.

Copy
/lwl/api?json={"inspector":"0","basis":"users"} 

This example would return the Applications Inspector for Yesterday. You get a column for the basis application_name, which is application_name. This would be a total for each application for the time period.

Copy
/lwl/api?json={"inspector":"1","basis":"application_name"}

You can add additional basis by adding them as a comma separated list or as an array. This would return the User Inspector for Yesterday but include the users and the machines basis columns: user_id, user_name, node_id, node_name.

Copy
/lwl/api?json={"inspector":"0","basis":"users,machines"} 

or

Copy
/lwl/api?json={"inspector":"0","basis": [ "users","machines"]}

Refer to the online API documentation for more options, examples, and current updates.