Import the API Server License

CA Technologies sends the license file to you as an electronic file when you purchase 
Layer7 Live API Creator
. If you received the license but you cannot locate the file, or if you are having difficulties using the license, contact CA Technologies support.
Layer7 Live API Creator
 requires a valid license to operate properly and for you to be able to manage and change your APIs, even though 
Layer7 Live API Creator
 can run without a license, with an invalid license, or with an expired license.
Layer7 Live API Creator
 requires that you import a valid license (a standard license) only if you are not already licensed under a Portfolio License Agreement (PLA).
For more information about licensing and PLA, see Licensing.
In this article:
Obtain the License File
CA Technologies sends the license file to you as an electronic file when you purchase 
Layer7 Live API Creator
. If you received the license but you cannot locate the file, or if you are having difficulties using the license, contact CA Technologies support.
Install Licenses
Only system administrators can install licenses. This user requires a password to log in to 
Layer7 Live API Creator
You can install a license using one of the following methods:
Import the License Using API Creator
  1. Log in to API Creator as a system administrator ( 
    The System Administration Login dialog appears.
  2. Click 
    Upload License
    The License page appears.
  3. Click 
    Upload License
    The Import License dialog opens.
  4. Locate and select the license file that you received from CA Technologies, and then click 
The API Server license is imported and displays on the License page.
Install the License When you Start API Server
You can install a license file when starting the Java container (for example, Apache Tomcat, Jetty, or Oracle WebLogic) or the Docker container. As 
Layer7 Live API Creator
 starts up the first time, it reads the license file and installs it as the current license.
Layer7 Live API Creator
 has started the first time, we recommend that you remove this environment variable. Keep the environment variable if you want to load another license file.
Follow these steps:
  1. Set the value for the 
     environment variable or Java system property to point to a license file in your startup command. Enter the complete path to a valid license file.
    For example:
    java -DLAC_DEFAULT_LICENSE_FILE=c:/Users/jdoe/LACLicense.txt etc...
  2. Verify that your license file was installed by completing one of the following:
    • Check the output log after the service is up.
    • Log in to API Creator and click the 
Install the License Using cURL or Similar Tool
Use the following process to install a license using cURL or similar tool.
Obtain an Authentication Token
The following procedure assumes that the 
 user password is SECRET.
  1. Issue the following command (change the parts in 
    curl -d '{"username":"sa","password":"
    "}' -H "Content-type: application/json" \ -X POST >
    The following response is expected:
    "apikey": "
    "expiration": "2017-01-25T02:15:50.088Z",
    "lastLoginTs": "2017-01-24T18:11:34.094Z",
    "lastLoginIP": "",
    "email": "[email protected]"
  2. Copy the 
Install the License File
The following procedure uses an example 
 file, which is located in the current directory.
Install the license file using the following command, which reformats the license file into JSON and perform a POST. Edit the parts in 
. Append the 
 value with "
| \
# Remove all newlines
tr '\n' ' ' | \
# Escape \r, \n and \t
sed -e 's/\\r/\\\\r/g' | sed -e 's/\\n/\\\\n/g' | sed -e 's/\\t/\\\\t/g' | \
# Replace \" with temporary token
sed -e 's/\\"/XYZZY/g' | \
# Escape all double-quotes
sed -e 's/"/\\"/g' | \
# Restore and escape escaped double quotes
sed -e 's/XYZZY/\\\\\\"/g' | \
# Add prefix and suffix to make this a JSON object
sed -e 's/^/{"license_text": "/' | sed -e 's/$/"}/' | \
# Send it as a REST request
curl -d @- -H "Content-type: application/json" \
-H "Authorization: CALiveAPICreator
:1" \
The following response is expected:
"statusCode": 201,
"txsummary": [
"@metadata": {
"href": "http://localhost:8080/APIServer/rest/abl/admin/v2/admin:server_licenses/14",
"resource": "admin:server_licenses",
"verb": "INSERT",
A value of 201 for the 
 indicates that the license was installed successfully. 
Install the License File in a Custom WAR File
You can bundle your license file into a specific location in the 
Layer7 Live API Creator
 WAR file. When 
Layer7 Live API Creator
 starts up, if it does not find a license file, 
Layer7 Live API Creator
 installs this license file.
The following procedure assumes that your WAR file is called 
 and that you have reformatted your license file to JSON and the file is called 
After you have installed the license file in your custom WAR file, when you start API Server, the WAR loads your license file if the admin database does not contain an existing license.
 You have Java JDK installed.
Follow these steps:
  1. Copy the WAR file and the 
     license file to the same directory.
  2. Create the following directory structure: 
  3. Rename your license file from 
     and move it into the 
  4. Replace the 
     license file that is located in 
     file with the 
     license file that is located in the 
     directory by issuing the following command:
    jar uvf CALiveAPICreator.war WEB-INF/classes/database/admin/DefaultLicense.json
  5. (Recommended) Rename the updated WAR, for example, 
The license file is installed in the custom WAR file.