####################################################### Importing Activation Keys to ActPro ####################################################### On occasion, you might want to create activation keys outside of Activation Pro and then import those keys automatically. You might do this, for example, if you wanted your order processing system to create an activation key for your customer's purchase, then populate ActPro with this activation key. The Activation Pro kit contains an example program to accomplish this. This program is called **import_key.c** and it can be used as an example to write your own code, or it can be used as-is as a command-line utility. Usage of import_key is as follows: .. code-block:: text % import_key activation-key product-id [-c count] [-t n|r] [-e key-exp-date] [-l lic-exp-date] [-w whitelist] [-o other-params] [-n notes] [-z contact-id] The **product-id** and **activation-key** are both required. To determine the product-id, view the product definitions in the Activation Pro GUI, and hover over the Product name in the list. The product-id will be displayed. The activation-key can be any printable string of less than 60 characters. To determine the person's contact-id, view the customer list in the Activation Pro GUI, and hover over the contact name in the list. The contact-id will be displayed. All parameters correspond to the parameter in the **Create Activation Key** GUI. The **-t** parameter specifies whether this key is a “normal” (n – the default), or ReActivate key (r). To build **import_key**, you must have the MySQL connector kit installed (instructions for this are in :ref:`config-gen-isv-hostid`). To compile and link import_key (where **sql** is the directory where the mysql connector kit is installed): .. code-block:: text cc -c import_key.c -I sql/include cc -o import_key import_key.o sql/lib/libmysqlclient.a -lm .. note:: As an alternative to this method, you can use Web Services to import activation keys into the ActPro database. See :ref:`the next section `.