Programmatically get an Iguana ID

The IguanaX IguanaID can be found within your Iguana License Settings page. However, you can also programmatically get the Iguana ID using one of two methods:

Method 1: Use the iguana --id command line flag (requires IguanaX v10.1.102)

The Iguana ID can be obtained using the command line --id flag. If you need to target a unique working directory, you can optionally use --id --working_dir <working_directory> to point to a specific Iguana working directory and return the Iguana ID.

Use the following command:

iguana --id --working_dir "C:\ProgramData\IguanaX"

Use the following command:

./iguana --id

*optionally add the --working_dir flag to target specific Iguana

Method 2: Use the IguanaX API to get license details, including the Iguana ID

Method: GET /session/login

To call the IguanaX APIs you must first login and get a session cookie from the response header to authenticate your subsequent requests.

Use your Iguana instance IP address and port: https://127.0.0.1:7654

Parameters:

  • username: Your IguanaX instance username string

  • password: Your IguanaX instance password string

Example curl command calling the /session/login API and parsing to retrieve Iguana session cookie the response header Set-Cookie to authenticate the next API call:

IguanaCookie=`curl -i -k -X GET "http://127.0.0.1:7654/session/login?username=<user>&password=<pass>" | grep -i 'Set-Cookie: ' | awk '{print $2}' | sed 's/;$//'`

Should look similar to: IguanaSession-jYQGeQWk97ylKuP8AmEiad=z7WR4Xwzk51hXMP2e3WeZa

Response Header:

Method: POST /license/get

This API method returns a JSON object containing the Iguana ID along with other license information. To authenticate, the obtained Cookie (from step 1) is provided in the header of the request.

Use your Iguana instance IP address and port: https://127.0.0.1:7654

Example curl command calling the /license/get API and parsing to retrieve the Iguana ID:

Response:

Â