# CreateActivationKey

### Description

Creates an activation key on the License Server.

Note that to call this function, you must:

* Enable the Server Property enableCreateActivationKey
* Set the AdminEncryptionKey
* Call [DefineProduct](https://soraco.readme.io/reference/defineproduct)

```csharp
void CreateActivationKey(string webServiceUrl, string email, 
                         int features, int quantity,
                         bool useMultipleActivationsKey, string qlmVersion,
                         string vendor, string userData1,
                         string affiliateID, out string response)
```

### Parameters

| Parameter                 |  Type  | Description                                                                                                                                              |
| ------------------------- | :----: | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| webServiceUrl             | string | URL to the QLM License Server.                                                                                                                           |
| email                     | string | email address to associate with to the license key - can be empty                                                                                        |
| features                  |   int  | OR'ed value of the features to enable                                                                                                                    |
| quantity                  |   int  | the number of licenses to embed in the key                                                                                                               |
| useMultipleActivationsKey |  bool  | if set to true and quantity > 1, one license key will be generated for all required licenses. The number of licenses will be embedded in the license key |
| qlmVersion                | string | version of the QLM Engine                                                                                                                                |
| vendor                    | string | eCommerce vendor to use when generating the key                                                                                                          |
| userData1                 | string | user data to associate with the license key                                                                                                              |
| affiliateID               | string | ID of affiliate                                                                                                                                          |
| response                  | string | XML fragment containing the result of the call.                                                                                                          |

### Response XML format

```xml
<?xml version='1.0' encoding='UTF-8'?>
<QuickLicenseManager>
<keys>A062E-9D0CC-6DC80-0D6A0-E0701-000A0;A062E-9D0CC-6DC80-0D6A0-E0701-000A0</keys>
</QuickLicenseManager>
```

### Example error response

```xml
<?xml version='1.0' encoding='UTF-8'?>
<QuickLicenseManager>
<error>Details about the error</error>
</QuickLicenseManager>
```

## Remarks

Use [ParseResults ](/docs/api-reference/.net-api/iqlmcustomerinfo/methods/parseresults.md)to interpret the results of the call and load the returned data into an [ILicenseInfo ](/docs/api-reference/.net-api/ilicenseinfo.md)object.

```csharp
ILicenseInfo li = new LicenseInfo();
string message = string.Empty;
if (lv.QlmLicenseObject.ParseResults(response, ref li, ref message))
{
  // The operation  was successful	
}
else
{
  // The operation failed
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.soraco.co/docs/api-reference/.net-api/qlmlicense/management-methods/createactivationkey.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
