Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Our Licensing APIs are designed to interact with the Members Account licensing system allowing you to get, activate, and transfer Iguana licenses programmatically, providing you have access and licenses available to do so.

License Activation:

The following steps provide an example license activation workflow calling the Iguana license APIs using curl commands:

  1. Get the Iguana ID of your target Iguana instance

There are two methods which can be used to obtain the Iguana ID:

 Option A: Use the iguana --id command line flag (requires IguanaX v10.1.101)

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.

Windows:

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

Linux:

./iguana --id

*optionally add the --working_dir flag

 Option B: Use the IguanaX API to get license details, including the Iguana ID

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

  1. Authenticate 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.

Parameters:

  • username: Your IguanaX instance username string

  • password: Your IguanaX instance password string

Response Header:

Content-Length: 128
Set-Cookie: IguanaSession-jYQGeQWk97ylKuP8AmEiad=z7WR4Xwzk51hXMP2e3WeZa; path=/; HttpOnly; SameSite=Strict

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:

Should look similar to: IguanaSession-jYQGeQWk97ylKuP8AmEiad=z7WR4Xwzk51hXMP2e3WeZa

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/;$//'`

  1. Get License details POST /license/get

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

Response:

{
    "data": {
        "iguana_id": "THSWPRHMUXTT7MRR",
        "license": {
            "component_limit": 500,
            "expiry": "0",
            "license_status": "License ok",
            "message_rate_limit": 0,
            "search_limit": 365
        },
        "license_message": "To modify or extend your license, contact the iNTERFACEWARE Sales Office."
    },
    "success": true
}

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

IguanaID=`curl -k --header "Cookie: $IguanaCookie" -X POST "http://127.0.0.1:7654/license/get" | jq -r '.data.iguana_id'`
  1. Call the Members Account Licensing APIs to register your Iguana ID to generate a license code

 2 a) Get an authentication token

Members Account Licensing API base URL: https://my.interfaceware.com

Get an Authentication Token POST /api

This API method returns a JSON object containing a session token which will be used with the subsequent license API calls.

Parameters:

  • username: Your Members Account username string

  • password: Your Members Account password string

  • method: The API method session.login string

Response:

{
    "data": {
        "Token": "277DBB66C802BE3287207FFE120595EC",
        "Info": {
            "Permissions": {
                "LicenseTransfer": true,
                "TemporaryLicense": true,
                "LicenseRead": true,
                "FinancialRead": false,
                "LicenseWrite": true
            },
            "CompanyName": "Richard Wang - Client "
        }
    },
    "status": "ok"
}

Example curl command calling the API and parsing the Token from the response:

IguanaToken=`curl -k -X POST "https://my.interfaceware.com/api?username=<InterfacewareUser>&password=<InterfacewarePassword>&method=session.login" | jq -r '.data.Token'`
 2 b) Get a list of entitlements (license types) and choose the license type to activate

Members Account Licensing API base URL: https://my.interfaceware.com

Get a List of Entitlements GET /api

This API method returns a JSON object containing a list of license types and select the ID for the type you want to activate.

Parameters:

  • product: The product you want licenses for - IguanaX string

  • token: Your authentication token string (from the first call)

  • method: The API method license.listentitlements string

Response:

{
    "data": [
        {
            "entitlements_total": "3",
            "name": "IguanaX Dev",
            "num_components": "50",
            "id": "1",
            "entitlements_used": "1",
            "license_expiry": "0",
            "log_search": "365"
        },
        {
            "entitlements_total": "3",
            "name": "IguanaX Test",
            "num_components": "50",
            "id": "2",
            "entitlements_used": "1",
            "license_expiry": "0",
            "log_search": "365"
        },
        {
            "entitlements_total": "3",
            "name": "Iguana X Prod",
            "num_components": "50",
            "id": "3",
            "entitlements_used": "1",
            "license_expiry": "0",
            "log_search": "365"
        },
    ],
    "status": "ok"
}

Example curl command calling the API and parsing the selected license entitlement id from the response:

LicenseName="IguanaX Test" #change to name of license type to activate
EntitlementID=`curl -k -X POST "https://my.interfaceware.com/api?method=license.listentitlements&product=IguanaX&token=<IguanaToken>" | jq -r --arg name "$LicenseName" '.data[] | select(.name==$name) | .id'`
 2 c) Register your Iguana ID to activate a license code

Members Account Licensing API base URL: https://my.interfaceware.com

Register your Iguana ID to Activate a License Code POST /api

This API method returns a JSON object containing the license description and activated license code.

Parameters:

  • product: The product you want licenses for - IguanaX string

  • token: Your authentication token string (from the first call)

  • method: The API method license.activate string

  • description: A description to pair with the license (test, prod, etc.) string

  • entitlementid: The ID of the license you want to activate string

  • instanceid: The Iguana ID of the instance that you want to apply the license to string

Response:

{
    "data": {
        "description": "Test",
        "code": "4492A1B5CDA25D79DFCC5DC3GHS4448B9D8A3CCC98",
        "license_expiry": "2025-08-13",
        "name": "IguanaX Test",
        "instanceid": "THSWPRHMUXTT7MRR",
        "log_search": 365,
        "num_components": 50
    },
    "status": "ok"

Example curl command calling the API and parsing the license code from the response:

IguanaLicenseCode=`curl -k -X POST "https://my.interfaceware.com/api?method=license.activate&product=IguanaX&token=<IguanaToken>&description=IguanaLicense&entitlementid=<EntitlementID>&instanceid=<IguanaID>" | jq -r '.data.code'`
  1. Apply the license code to the target Iguana instance

There are two possible methods to apply the generated license code to the new Iguana instance:

 Option A: On the command line, write the license code to the IguanaLicense File

Windows

echo $IguanaLicenseCode > C:\ProgramData\IguanaX\IguanaLicense;

Linux:

echo $IguanaLicenseCode > /home/iguanauser/.IguanaX/IguanaLicense;
 Option B: Use the IguanaX API to apply the license code to the target Iguana instance

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

  1. Authenticate 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.

Parameters:

  • username: Your IguanaX instance username string

  • password: Your IguanaX instance password string

Response Header:

Content-Length: 128
Set-Cookie: IguanaSession-jYQGeQWk97ylKuP8AmEiad=z7WR4Xwzk51hXMP2e3WeZa; path=/; HttpOnly; SameSite=Strict

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:

Should look similar to: IguanaSession-jYQGeQWk97ylKuP8AmEiad=z7WR4Xwzk51hXMP2e3WeZa

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/;$//'`

  1. Apply the license codePOST /license/set

This API method applies the registered license code to the Iguana instance and returns a JSON object containing the request success or failure. To authenticate, the obtained Cookie is provided in the header of the request.

Parameters:

  • license: the license code to be applied string

Response:

{
    "data": {},
    "success": true
}

Example curl command calling the /license/set API to apply the license code and activate the Iguana instance:

IguanaID=`curl -k --header "Cookie: $IguanaCookie" -X POST "http://127.0.0.1:7654/license/set?license=<LicenseCode>"

License Transfer:

The license transfer procedure contains similar steps as to the activation procedure.

  1. Get the Iguana IDs of the old and new Iguana instances

  See License Activation Step 1 for how to obtain the Iguana ID.

Refer to License Activation step 1 to review the options for how to obtain the Iguana ID.

  • The old Iguana ID refers to the Iguana instance you want to transfer a license from.

  • The new Iguana ID refers to the Iguana instance you wan to transfer the license to.

  1. Call the Members Account Licensing APIs to transfer a license from the old Iguana to the new Iguana instance

 2 a) Get an authentication token

Refer to License Activation step 2 a) to review how to get the Members Account authentication Token to use in subsequent requests.

 2 b) Get the entitlement ID (license types) of your old Iguana instance

Refer to License Activation step 2 b) to review how to get the license entitlements and capture the entitlement ID of the target license type.

 2 c) Get the activation ID of the old Iguana instance

Members Account Licensing API base URL: https://my.interfaceware.com

Get List of Activated Iguana Licenses POST /api

This API method returns a JSON object containing all of the licenses activated under a particular entitlement ID (license type).

Parameters:

  • product: The product you want licenses for - IguanaX string

  • token: Your authentication token string

  • method: The API method license.listActivations string

  • entitlementid: The ID of the license type you want to activate string

Response:

{
    "data": [
        {
            "log_search": "60",
            "num_components": "50",
            "description": "Test",
            "code": "SGJKLGDSLMHKEM93493DSFDS9349019A63B5A04A44290E42BBE452D508",
            "license_type": "IguanaX Test",
            "country": "",
            "license_expiry": "2025-03-06 21:26:00",
            "date_modified": "2024-03-06 21:26:00",
            "state": "",
            "site": "",
            "city": "",
            "date_issued": "2024-03-06 00:00:00",
            "last_modified_by": "Admin",
            "tracking_id": "",
            "activation_id": "34",
            "instance_id": "AJ5K8QPHHPNNSLLC"
        },
        {
            "log_search": "60",
            "num_components": "50",
            "description": "Old Iguana Instance",
            "code": "3D83F6E6753820DCC509A6F75849B488SFSKJG3086B2D7AAEBF5D0E67D",
            "license_type": "IguanaX Test",
            "country": "",
            "license_expiry": "2025-08-13 16:04:10",
            "date_modified": "2024-08-13 16:04:10",
            "state": "",
            "site": "",
            "city": "",
            "date_issued": "2024-08-13 16:04:10",
            "last_modified_by": "Admin",
            "tracking_id": "",
            "activation_id": "210",
            "instance_id": "RPQC9TYWFHPGEDGT"
        }
    ],
    "status": "ok"
}

Example curl command calling the API and parsing the response activation id of the old Iguana instance you want to transfer the license from:

OldIguanaActivationID=`curl -k -X POST "https://my.interfaceware.com/api?method=license.listActivations&product=IguanaX&token=<IguanaToken>&entitlementid=<EntitlementID>" | jq -r --arg instanceId "$OldIguanaID" '.data[] | select(.instance_id == $instanceId) | .activation_id'`
 2 d) Transfer the activation ID to the new Iguana Instance and capture the license code

Members Account Licensing API base URL: https://my.interfaceware.com

Transfer a License POST /api

This API method returns a JSON object containing the license information about the Iguana you've transferred the license to. This in

Parameters:

  • product: The product you want licenses for - IguanaX string

  • token: Your authentication token string

  • method: The API method license.UpdateActivationInfo string

  • description: A description to pair with the license (test, prod, etc.) string

  • activationid: The Activation ID of the Iguana you're transferring the license from string

  • instance_id: The Iguana ID of the instance that you want to transfer the license to string

Response:

{
    "data": {
        "log_search": "60",
        "num_components": "50",
        "description": "New IguanaX",
        "code": "E33F6E672A5239A200F300SDSF23FF6E673C596E1322DC83379C3F63DC0446",
        "license_type": "IguanaX Test",
        "country": "",
        "license_expiry": "2025-08-13 16:04:10",
        "date_modified": "2024-08-13 18:57:29",
        "state": "",
        "site": "",
        "city": "",
        "date_issued": "2024-08-13 16:04:10",
        "last_modified_by": "Admin",
        "tracking_id": "",
        "activation_id": "210",
        "instance_id": "THSWPRHMUXTT7MRR"
    },
    "status": "ok"
}

Example curl command calling the API and parsing the license code from the response:

NewLicenseCode=`curl -k -X POST "https://my.interfaceware.com/api?method=license.UpdateActivationInfo&product=IguanaX&token=<IguanaToken>&description=<NewIguanaX>&activationid=<activationID>&instance_id=<newIguanaID>" | jq -r '.data.code'`
  1. Apply the license code to the new Iguana Instance

  See License Activation Step 3 for how to apply a license code

Refer to License Activation step 3 to review the options for how to apply the license code to the new Iguana instance.

  • No labels