# AddUserEx2

### Description

Adds a new user.

```csharp
 bool AddUserEx2(string webServiceUrl, 
                 IQlmCustomerInfo customerInfo, 
                 bool updateIfExists, 
                 out
                 string response);
```

### Parameters

| Parameter      |                                 Type                                 | Description                                                                            |
| -------------- | :------------------------------------------------------------------: | -------------------------------------------------------------------------------------- |
| webServiceUrl  |                                string                                | URL to the QLM License Server                                                          |
| customerInfo   | [IQlmCustomerInfo](/docs/api-reference/.net-api/iqlmcustomerinfo.md) | customer to add                                                                        |
| updateIfExists |                                 bool                                 | update the customer information if the customer already exists                         |
| response       |                                string                                | XML fragment containing the result of the call. The Xml fragment schema is as follows: |

### Return

| Type | Description                                                                                                                                                                                                                                                          |
| ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| bool | Returns true if the user was added. If the user was not added because of an error or because the user already exists and updateIfExists is false, the response contains details about the error. You can use QlmLicense.ParseResults to get details about the error. |

### Response XML format

```xml
<?xml version='1.0' encoding='UTF-8'?>
<QuickLicenseManager>
<result>Customer ABC was added successfully.".</result>
</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
QlmCustomerInfo ci = new QlmCustomerInfo();

ci.FullName = "John Smith";
ci.Email = "John.Smith@js.com";
ci.Phone = "514-344-4483";
ci.Fax = "514-344-4484";
ci.Mobile = "514-344-4484";
ci.Company = "Soraco";
ci.Address1 = "123 Soraco Road";
ci.Address2 = "Suite 123";
ci.City = "Montreal";
ci.State = "Quebec";
ci.Zip = "H5X 3X6";
ci.Country = "Canada";
ci.IncludeInMailList = true;
ci.ExternalID = "01234";
ci.UserData1 = "MyUserData";
ci.Notes = "My Notes";
ci.LoginName = "jsmith";


string response;

lv.QlmLicenseObject.AddUserEx2(string.Empty, ci, true, out response);
ILicenseInfo li = new LicenseInfo();
string message = string.Empty;
if (lv.QlmLicenseObject.ParseResults(response, ref li, ref message))
{
  // success
}
else
{
  // error
}
```


---

# 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/application-methods/adduserex2.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.
