Accessing the Liongard API

To access Liongard's API, please reference our Developer Guide.

Use Cases

Fetching the list of Environments

# NOTE: You need to replace "myinstance" with the URL name you use to access Liongard

ENCODEDAUTH="`echo -n 'accessKeyId:accessKeySecret' | base64`"
curl -L -X GET --header "X-ROAR-API-KEY: $ENCODEDAUTH" https://myinstance.app.liongard.com/api/v1/environments/

Getting a list of all Inspector names

# NOTE: You need to replace "myinstance" with the URL name you use to access Liongard

ENCODEDAUTH="`echo -n 'accessKeyId:accessKeySecret' | base64`"
curl -L -X GET --header "X-ROAR-API-KEY: $ENCODEDAUTH" https://myinstance.app.liongard.com/api/v1/inspectors/

Getting all your Active Directory systems ordered by most recently created

# NOTE: You need to replace "myinstance" with the URL name you use to access Liongard
ENCODEDAUTH="`echo -n 'accessKeyId:accessKeySecret' | base64`"
curl -L -G --header "X-ROAR-API-KEY: $ENCODEDAUTH" https://myinstance.app.liongard.com/api/v1/systems/ --data-urlencode 'conditions[]={"path":"Inspector/Name","op":"equals","value":"active-directory-inspector"}' --data-urlencode 'orderBy[]={"path":"CreatedOn","order":"desc"}'

Fetching all users in Active Directory systems from the latest inspection

📘

System ID Required

This example uses a System ID which can be pulled from the /systems endpoint. Please see the previous example on fetching Active Directory systems in order to obtain System ID(s)

The /systems/:systemId/view endpoint will automatically pull the last successfully completed data print for a given system.

🚧

Understanding the .../view endpoint return format

The ../view endpoint will return a JSON object in the form of:
{ "raw": {...}, "system": {...}, "view": {...}, "views: {...} }
where the "raw" field contains the actual data print. The "system" field is merely a copy of the system entry you would get from the standard /system endpoint. The "view" field details the structure of the view as it was created for the inspector. The "views" field contains the data which has been extracted and transformed to be applied to the view structure.

# NOTE: You need to replace "myinstance" with the URL name you use to access Liongard
# NOTE: You need to replace "systemID" with a numeric ID pulled from the previous example

ENCODEDAUTH="`echo -n 'accessKeyId:accessKeySecret' | base64`"
curl -L -X POST --header "X-ROAR-API-KEY: $ENCODEDAUTH" https://myinstance.app.liongard.com/api/v1/systems/systemID/view

Rewinding an Active Directory system over time

# NOTE: You need to replace "myinstance" with the URL name you use to access Liongard

ENCODEDAUTH="`echo -n 'accessKeyId:accessKeySecret' | base64`"
curl -L -G --header "X-ROAR-API-KEY: $ENCODEDAUTH" https://myinstance.app.liongard.com/api/v1/timeline --data-urlencode 'conditions[]=[{"path":"Launchpoint/Name","op":"equals","value":"AD-Acme-R13"},{"path":"Status","op":"equals","value":"Completed"}]' --data-urlencode 'orderBy[]={"path":"CreatedOn","order":"desc"}'

# NOTE: Each Timeline entry returned will have two fields: "SystemID" and "SystemDetailID", we will use these to then rewind the dataprint over time below
curl -L -X POST --header "X-ROAR-API-KEY: $ENCODEDAUTH" https://myinstance.app.liongard.com/api/v1/systems/SYSTEMID/SYSTEMDETAILID/view