# Cyclos4102Api.UsersApi

All URIs are relative to *https://demo.cyclos.org/api*

Method | HTTP request | Description
------------- | ------------- | -------------
[**createUser**](UsersApi.md#createUser) | **POST** /users | Registers a new user
[**getDataForMapDirectory**](UsersApi.md#getDataForMapDirectory) | **GET** /users/map/data-for-search | Get configuration data for searching the user directory (map)
[**getGroupsForUserRegistration**](UsersApi.md#getGroupsForUserRegistration) | **GET** /users/groups-for-registration | Returns the groups the authenticated user or guest can register on
[**getUserDataForEdit**](UsersApi.md#getUserDataForEdit) | **GET** /users/{user}/data-for-edit | Get configuration data to edit a user profile
[**getUserDataForNew**](UsersApi.md#getUserDataForNew) | **GET** /users/data-for-new | Get configuration data for registering new users
[**getUserDataForSearch**](UsersApi.md#getUserDataForSearch) | **GET** /users/data-for-search | Get configuration data for searching users
[**searchMapDirectory**](UsersApi.md#searchMapDirectory) | **GET** /users/map | Search the user directory (map)
[**searchUsers**](UsersApi.md#searchUsers) | **GET** /users | Search for users
[**updateUser**](UsersApi.md#updateUser) | **PUT** /users/{user} | Save a user details
[**validateEmailChange**](UsersApi.md#validateEmailChange) | **POST** /users/validate/email-change/{key} | Validates an e-mail via a validation key
[**validateUserRegistration**](UsersApi.md#validateUserRegistration) | **POST** /users/validate/registration/{key} | Validates an user registration via a key sent by e-mail
[**validateUserRegistrationField**](UsersApi.md#validateUserRegistrationField) | **GET** /users/validate/{group}/{field} | Validates the value of a single field for user registration
[**viewUser**](UsersApi.md#viewUser) | **GET** /users/{user} | View a user details


<a name="createUser"></a>
# **createUser**
> UserRegistrationResult createUser(body)

Registers a new user

Can either be a public registration, requiring no authorization, or a user registration by an administrator or broker. The public registration normally requires a CAPTCHA challenge to prevent bots. On user registration the following data is also created:  * Address;  * Mobile phone;  * Landline phone;  * Images.   After the registration those data are managed separately than the user profile data.  

### Example
```javascript
var Cyclos4102Api = require('cyclos_4102_api');

var apiInstance = new Cyclos4102Api.UsersApi();

var body = new Cyclos4102Api.UserNew(); // UserNew | The user to be registered


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createUser(body, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**UserNew**](UserNew.md)| The user to be registered | 

### Return type

[**UserRegistrationResult**](UserRegistrationResult.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="getDataForMapDirectory"></a>
# **getDataForMapDirectory**
> UserDataForMap getDataForMapDirectory(opts)

Get configuration data for searching the user directory (map)

Returns data with the current configuration regarding the user  directory (map) 

### Example
```javascript
var Cyclos4102Api = require('cyclos_4102_api');

var apiInstance = new Cyclos4102Api.UsersApi();

var opts = { 
  'fields': ["fields_example"] // [String] | Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getDataForMapDirectory(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **fields** | [**[String]**](String.md)| Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: &#x60;a,b.b1,c.-c1,c.-c2&#x60; will return the fields &#x60;a&#x60;, &#x60;b&#x60; (containing only the &#x60;b1&#x60; field) and &#x60;c&#x60; (containing all its fields except for &#x60;c1&#x60; or &#x60;c2&#x60;).   | [optional] 

### Return type

[**UserDataForMap**](UserDataForMap.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="getGroupsForUserRegistration"></a>
# **getGroupsForUserRegistration**
> [GroupForRegistration] getGroupsForUserRegistration(opts)

Returns the groups the authenticated user or guest can register on

Returns the list of groups the authenticated user can use to perform a new user registration. If authenticated as guest, will return the groups currently set for public registration. When there is an authenticated administrator, broker or member, will be the configured groups for new users. 

### Example
```javascript
var Cyclos4102Api = require('cyclos_4102_api');

var apiInstance = new Cyclos4102Api.UsersApi();

var opts = { 
  'fields': ["fields_example"], // [String] | Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
  'asMember': true // Boolean | Flag required only when the authenticated user is a member and a broker, in that case we need to distingish between both. If true then the groups returned will be those allowed as member, otherwise will return the goups allowed as broker.   
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getGroupsForUserRegistration(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **fields** | [**[String]**](String.md)| Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: &#x60;a,b.b1,c.-c1,c.-c2&#x60; will return the fields &#x60;a&#x60;, &#x60;b&#x60; (containing only the &#x60;b1&#x60; field) and &#x60;c&#x60; (containing all its fields except for &#x60;c1&#x60; or &#x60;c2&#x60;).   | [optional] 
 **asMember** | **Boolean**| Flag required only when the authenticated user is a member and a broker, in that case we need to distingish between both. If true then the groups returned will be those allowed as member, otherwise will return the goups allowed as broker.    | [optional] 

### Return type

[**[GroupForRegistration]**](GroupForRegistration.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="getUserDataForEdit"></a>
# **getUserDataForEdit**
> UserDataForEdit getUserDataForEdit(user, opts)

Get configuration data to edit a user profile

Returns data to edit a user profile. 

### Example
```javascript
var Cyclos4102Api = require('cyclos_4102_api');
var defaultClient = Cyclos4102Api.ApiClient.instance;

// Configure API key authorization: accessClient
var accessClient = defaultClient.authentications['accessClient'];
accessClient.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//accessClient.apiKeyPrefix = 'Token';

// Configure HTTP basic authorization: basic
var basic = defaultClient.authentications['basic'];
basic.username = 'YOUR USERNAME';
basic.password = 'YOUR PASSWORD';

// Configure API key authorization: session
var session = defaultClient.authentications['session'];
session.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//session.apiKeyPrefix = 'Token';

var apiInstance = new Cyclos4102Api.UsersApi();

var user = "user_example"; // String | Can be one of: * a user identification value, such as id, username, e-mail, phone, etc.   Id is always allowed, others depend on Cyclos configuration. Note that   a valid numeric value is always considered as id. For example, when   using another identification method that can be numeric only, prefix   the value with a single quote (like in Excel spreadsheets), for   example, `'1234567890`;     * `self` for the currently authenticated user. 

var opts = { 
  'fields': ["fields_example"] // [String] | Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getUserDataForEdit(user, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **user** | **String**| Can be one of: * a user identification value, such as id, username, e-mail, phone, etc.   Id is always allowed, others depend on Cyclos configuration. Note that   a valid numeric value is always considered as id. For example, when   using another identification method that can be numeric only, prefix   the value with a single quote (like in Excel spreadsheets), for   example, &#x60;&#39;1234567890&#x60;;     * &#x60;self&#x60; for the currently authenticated user.  | 
 **fields** | [**[String]**](String.md)| Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: &#x60;a,b.b1,c.-c1,c.-c2&#x60; will return the fields &#x60;a&#x60;, &#x60;b&#x60; (containing only the &#x60;b1&#x60; field) and &#x60;c&#x60; (containing all its fields except for &#x60;c1&#x60; or &#x60;c2&#x60;).   | [optional] 

### Return type

[**UserDataForEdit**](UserDataForEdit.md)

### Authorization

[accessClient](../README.md#accessClient), [basic](../README.md#basic), [session](../README.md#session)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="getUserDataForNew"></a>
# **getUserDataForNew**
> UserDataForNew getUserDataForNew(group, opts)

Get configuration data for registering new users

Almost every aspect of a user profile is configurable in Cyclos, such as enabled basic profile fields, custom profile fields, address fields, phone configuration and so on. As such, if a front-end needs to be robust to such a dynamic nature, it should get this information in order to create a correct registration form.  

### Example
```javascript
var Cyclos4102Api = require('cyclos_4102_api');

var apiInstance = new Cyclos4102Api.UsersApi();

var group = "group_example"; // String | The intial group for the new user

var opts = { 
  'fields': ["fields_example"], // [String] | Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
  'asMember': true // Boolean | Flag required only when the authenticated user is a member and a broker, in that case we need to distingish between both. If true then the configuration data for registering new users as member will be returned, otherwise will return the configuration data for registering as broker.           
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getUserDataForNew(group, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **group** | **String**| The intial group for the new user | 
 **fields** | [**[String]**](String.md)| Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: &#x60;a,b.b1,c.-c1,c.-c2&#x60; will return the fields &#x60;a&#x60;, &#x60;b&#x60; (containing only the &#x60;b1&#x60; field) and &#x60;c&#x60; (containing all its fields except for &#x60;c1&#x60; or &#x60;c2&#x60;).   | [optional] 
 **asMember** | **Boolean**| Flag required only when the authenticated user is a member and a broker, in that case we need to distingish between both. If true then the configuration data for registering new users as member will be returned, otherwise will return the configuration data for registering as broker.            | [optional] 

### Return type

[**UserDataForNew**](UserDataForNew.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="getUserDataForSearch"></a>
# **getUserDataForSearch**
> UserDataForSearch getUserDataForSearch(opts)

Get configuration data for searching users

Returns data with the current configuration regarding the user search 

### Example
```javascript
var Cyclos4102Api = require('cyclos_4102_api');

var apiInstance = new Cyclos4102Api.UsersApi();

var opts = { 
  'fields': ["fields_example"] // [String] | Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getUserDataForSearch(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **fields** | [**[String]**](String.md)| Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: &#x60;a,b.b1,c.-c1,c.-c2&#x60; will return the fields &#x60;a&#x60;, &#x60;b&#x60; (containing only the &#x60;b1&#x60; field) and &#x60;c&#x60; (containing all its fields except for &#x60;c1&#x60; or &#x60;c2&#x60;).   | [optional] 

### Return type

[**UserDataForSearch**](UserDataForSearch.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="searchMapDirectory"></a>
# **searchMapDirectory**
> [UserResult] searchMapDirectory(opts)

Search the user directory (map)

Returns a page of users in the map directory that match a given criteria 

### Example
```javascript
var Cyclos4102Api = require('cyclos_4102_api');

var apiInstance = new Cyclos4102Api.UsersApi();

var opts = { 
  'fields': ["fields_example"], // [String] | Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
  'activationPeriod': [new Date("2013-10-20T19:20:30+01:00")], // [Date] | The minimum / maximum user activation date. Only taken into account if searching as administrator or managing broker. Is expressed an array, with the lower bound as first element, and the upper bound as second element. When only one element, will have just the lower bound. To specify only the upper bound, prefix the value with a comma. 
  'addressResult': "addressResult_example", // String | Determines which address is returned on the search, if any. By default no addresses are returned. This option is useful for displaying results as locations on a map. In all cases only located addresses (those that have the geographical coordinates set) are returned. When returning all addresses, data related with multiple addresses is returned multiple times. Possible values are: * all: All addresses are returned. * nearest: The nearest address from the reference location is returned. Only usable if a reference coordinate (`latitude` and `longitude`) * none: Addresses are not returned. * primary: The primary (default) user address is returned 
  'brokers': ["brokers_example"], // [String] | Either id or a principal (login name, e-mail, etc) for brokers 
  'creationPeriod': [new Date("2013-10-20T19:20:30+01:00")], // [Date] | The minimum / maximum user creation date. Only taken into account if searching as administrator or managing broker. Is expressed an array, with the lower bound as first element, and the upper bound as second element. When only one element, will have just the lower bound. To specify only the upper bound, prefix the value with a comma. 
  'excludeContacts': true, // Boolean | When set to `true` will not return any user that is already a contact of the currently authenticated user. 
  'groups': ["groups_example"], // [String] | Either id or internal names of groups / group sets 
  'ignoreProfileFieldsInList': true, // Boolean | When set to `true`, instead of returning users with corresponding profile fields set on list, will return them with `display` and `shortDisplay`.  
  'includeGroup': true, // Boolean | When set to `true` and the logged user has permission to view user groups, will return the `group` property on users.  
  'includeGroupSet': true, // Boolean | When set to `true` and the logged user has permission to view user group sets, will return the `groupSet` property on users.  
  'keywords': "keywords_example", // String | Textual search keywords. Sometimes, like in user search, the fields matched depends on what is configured on the products. 
  'lastLoginPeriod': [new Date("2013-10-20T19:20:30+01:00")], // [Date] | The minimum / maximum user last login date. Only taken into account if searching as administrator or managing broker. Is expressed an array, with the lower bound as first element, and the upper bound as second element. When only one element, will have just the lower bound. To specify only the upper bound, prefix the value with a comma. 
  'latitude': 1.2, // Number | The reference latitude for distance searches 
  'longitude': 1.2, // Number | The reference longitude for distance searches 
  'mainBrokerOnly': true, // Boolean | When set to `true`, will match only users that have the brokers as set in the `brokers` parameter as main broker.  
  'maxDistance': 1.2, // Number | Maximum straight-line distance between the informed location and the resulting address. Is measured either in kilometers or miles, depending on the configuration. Only accepted if both `longitude` and `latitude` parameters are passed with the actual reference position. 
  'orderBy': "orderBy_example", // String | Possible options for ordering the results of an user search. Possible values are: * alphabeticallyAsc: Users are ordered by name (or whatever field is set to format users) in ascending order. * alphabeticallyDesc: Users are ordered by name (or whatever field is set to format users) in descending order. * creationDate: Newly registered users are returned first. * distance: Only useful when providing a location, will return nearer advertisements first. * random: Users will be randomly returned * relevance: This is the default if keywords are used. Best matching users come first. 
  'page': 56, // Number | The page number (zero-based) of the search. The default value is zero. 
  'pageSize': 56, // Number | The maximum number of records that will be returned on the search. The default value is 40. The maximum number of returned results is configured in Cyclos, and even if more than that is requested, it will be limited by that setting. 
  'profileFields': ["profileFields_example"], // [String] | User profile fields, both basic (full name, login name, phone, e-mail, etc) and custom fields, that are used for search. Is a comma-separated array, where each part consists in two parts: the internal name (or custom field id) of the field, and a value, both separated by : (colon). For example, `profileFields=field1:value1,field2:value2`. Sometimes multiple values are accepted. In this case, the multiple values are separated by pipes. For example, `profileFields=field1:valueA|valueB`. The accepted fields depend on the products the authenticated user has. Enumerated fields accept multiple values, while numeric and date fields also accept ranges, which are two values, pipe-separated. For example, `profileFields=rank:bronze|silver,birthDate:2000-01-01|2001-12-31` would match results whose custom field with internal name 'rank' is either bronze or silver, and whose 'birthDate' is between January 1, 2000 and December 31, 2001. To specify a single bound in ranges (like birth dates before December 31, 2001), use a pipe in one of the values, like `profileFields=birthDate:|2001-12-31`. The basic profile fields have one of the following identifiers: * `name` or `fullName`: Full name; * `username`, `loginName` or `login`: Login name; * `email`: E-mail; * `phone`: Phone; * `accountNumber`, `account`: Account number; * `image`: Image (accepts a boolean value, indicating that either it   is required that users either have images or not).  If address is an allowed profile field for search, specific address fields may be searched. The allowed ones are normally returned as the `addressFieldsInSearch` field in the corresponding result from a data-for-search request.  The specific address fields are: * `address`: Searches on any address field (not a specific field); * `address.address`: Searches on the fields that represent the   street address, which are `addressLine1`,    `addressLine2`,   `street`,   `buildingNumber` and   `complement`. Note that normally only a   subset of them should be enabled in the configuration (either line   1 / 2 or street + number + complement);  * `address.zip`: Searches for matching zip (postal) code; * `address.poBox`: Searches for matching postal box; * `address.neighborhood`: Searches by neighborhood; * `address.city`: Searches by city; * `address.region`: Searches by region (or state); * `address.country`: Searches by ISO 3166-1 alpha-2 country code.  A note for dynamic custom fields: If a script is used to generate possible values for search, the list will be returned in the  corresponding data, and it is sent as a pipe-separated list of values (not labels). For example: `profileFields=dynamic:a|b|c`. However, it is also possible to perform a keywords-like (full-text) search using the dynamic value label. In this case a single value, prefixed by single quotes should be used. For example: `profileFields=dynamic:'business`. 
  'roles': ["roles_example"], // [String] | The main role the user has. Possible values for each array element are: * administrator: A user who can manage the system and other users. * broker: A user who can manage other users. * member: A regular user who can manage operators.  * operator: A \"sub-user\" created by a member to manage his data. 
  'statuses': ["statuses_example"], // [String] | The possible statuses for an user Possible values for each array element are: * active: The user is active and can use the system normally. * blocked: The user has been blocked from accessing the system. Other users still see him/her. * disabled: The user has been disabled - he/she cannot access the system and is invisible by other users. * pending: The user registration is pending a confirmation. Probably the user has received an e-mail with a link that must be followed to complete the activation. The user is invisible by other users. * removed: The user was permanently removed. It's profile is kept for historical purposes. 
  'usersToExclude': ["usersToExclude_example"], // [String] | Indicated the users to be excluded from the result 
  'usersToInclude': ["usersToInclude_example"] // [String] | Indicated the users to be included in the result.  Any other user not present in this list will be excluded from the result. 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.searchMapDirectory(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **fields** | [**[String]**](String.md)| Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: &#x60;a,b.b1,c.-c1,c.-c2&#x60; will return the fields &#x60;a&#x60;, &#x60;b&#x60; (containing only the &#x60;b1&#x60; field) and &#x60;c&#x60; (containing all its fields except for &#x60;c1&#x60; or &#x60;c2&#x60;).   | [optional] 
 **activationPeriod** | [**[Date]**](Date.md)| The minimum / maximum user activation date. Only taken into account if searching as administrator or managing broker. Is expressed an array, with the lower bound as first element, and the upper bound as second element. When only one element, will have just the lower bound. To specify only the upper bound, prefix the value with a comma.  | [optional] 
 **addressResult** | **String**| Determines which address is returned on the search, if any. By default no addresses are returned. This option is useful for displaying results as locations on a map. In all cases only located addresses (those that have the geographical coordinates set) are returned. When returning all addresses, data related with multiple addresses is returned multiple times. Possible values are: * all: All addresses are returned. * nearest: The nearest address from the reference location is returned. Only usable if a reference coordinate (&#x60;latitude&#x60; and &#x60;longitude&#x60;) * none: Addresses are not returned. * primary: The primary (default) user address is returned  | [optional] 
 **brokers** | [**[String]**](String.md)| Either id or a principal (login name, e-mail, etc) for brokers  | [optional] 
 **creationPeriod** | [**[Date]**](Date.md)| The minimum / maximum user creation date. Only taken into account if searching as administrator or managing broker. Is expressed an array, with the lower bound as first element, and the upper bound as second element. When only one element, will have just the lower bound. To specify only the upper bound, prefix the value with a comma.  | [optional] 
 **excludeContacts** | **Boolean**| When set to &#x60;true&#x60; will not return any user that is already a contact of the currently authenticated user.  | [optional] 
 **groups** | [**[String]**](String.md)| Either id or internal names of groups / group sets  | [optional] 
 **ignoreProfileFieldsInList** | **Boolean**| When set to &#x60;true&#x60;, instead of returning users with corresponding profile fields set on list, will return them with &#x60;display&#x60; and &#x60;shortDisplay&#x60;.   | [optional] 
 **includeGroup** | **Boolean**| When set to &#x60;true&#x60; and the logged user has permission to view user groups, will return the &#x60;group&#x60; property on users.   | [optional] 
 **includeGroupSet** | **Boolean**| When set to &#x60;true&#x60; and the logged user has permission to view user group sets, will return the &#x60;groupSet&#x60; property on users.   | [optional] 
 **keywords** | **String**| Textual search keywords. Sometimes, like in user search, the fields matched depends on what is configured on the products.  | [optional] 
 **lastLoginPeriod** | [**[Date]**](Date.md)| The minimum / maximum user last login date. Only taken into account if searching as administrator or managing broker. Is expressed an array, with the lower bound as first element, and the upper bound as second element. When only one element, will have just the lower bound. To specify only the upper bound, prefix the value with a comma.  | [optional] 
 **latitude** | **Number**| The reference latitude for distance searches  | [optional] 
 **longitude** | **Number**| The reference longitude for distance searches  | [optional] 
 **mainBrokerOnly** | **Boolean**| When set to &#x60;true&#x60;, will match only users that have the brokers as set in the &#x60;brokers&#x60; parameter as main broker.   | [optional] 
 **maxDistance** | **Number**| Maximum straight-line distance between the informed location and the resulting address. Is measured either in kilometers or miles, depending on the configuration. Only accepted if both &#x60;longitude&#x60; and &#x60;latitude&#x60; parameters are passed with the actual reference position.  | [optional] 
 **orderBy** | **String**| Possible options for ordering the results of an user search. Possible values are: * alphabeticallyAsc: Users are ordered by name (or whatever field is set to format users) in ascending order. * alphabeticallyDesc: Users are ordered by name (or whatever field is set to format users) in descending order. * creationDate: Newly registered users are returned first. * distance: Only useful when providing a location, will return nearer advertisements first. * random: Users will be randomly returned * relevance: This is the default if keywords are used. Best matching users come first.  | [optional] 
 **page** | **Number**| The page number (zero-based) of the search. The default value is zero.  | [optional] 
 **pageSize** | **Number**| The maximum number of records that will be returned on the search. The default value is 40. The maximum number of returned results is configured in Cyclos, and even if more than that is requested, it will be limited by that setting.  | [optional] 
 **profileFields** | [**[String]**](String.md)| User profile fields, both basic (full name, login name, phone, e-mail, etc) and custom fields, that are used for search. Is a comma-separated array, where each part consists in two parts: the internal name (or custom field id) of the field, and a value, both separated by : (colon). For example, &#x60;profileFields&#x3D;field1:value1,field2:value2&#x60;. Sometimes multiple values are accepted. In this case, the multiple values are separated by pipes. For example, &#x60;profileFields&#x3D;field1:valueA|valueB&#x60;. The accepted fields depend on the products the authenticated user has. Enumerated fields accept multiple values, while numeric and date fields also accept ranges, which are two values, pipe-separated. For example, &#x60;profileFields&#x3D;rank:bronze|silver,birthDate:2000-01-01|2001-12-31&#x60; would match results whose custom field with internal name &#39;rank&#39; is either bronze or silver, and whose &#39;birthDate&#39; is between January 1, 2000 and December 31, 2001. To specify a single bound in ranges (like birth dates before December 31, 2001), use a pipe in one of the values, like &#x60;profileFields&#x3D;birthDate:|2001-12-31&#x60;. The basic profile fields have one of the following identifiers: * &#x60;name&#x60; or &#x60;fullName&#x60;: Full name; * &#x60;username&#x60;, &#x60;loginName&#x60; or &#x60;login&#x60;: Login name; * &#x60;email&#x60;: E-mail; * &#x60;phone&#x60;: Phone; * &#x60;accountNumber&#x60;, &#x60;account&#x60;: Account number; * &#x60;image&#x60;: Image (accepts a boolean value, indicating that either it   is required that users either have images or not).  If address is an allowed profile field for search, specific address fields may be searched. The allowed ones are normally returned as the &#x60;addressFieldsInSearch&#x60; field in the corresponding result from a data-for-search request.  The specific address fields are: * &#x60;address&#x60;: Searches on any address field (not a specific field); * &#x60;address.address&#x60;: Searches on the fields that represent the   street address, which are &#x60;addressLine1&#x60;,    &#x60;addressLine2&#x60;,   &#x60;street&#x60;,   &#x60;buildingNumber&#x60; and   &#x60;complement&#x60;. Note that normally only a   subset of them should be enabled in the configuration (either line   1 / 2 or street + number + complement);  * &#x60;address.zip&#x60;: Searches for matching zip (postal) code; * &#x60;address.poBox&#x60;: Searches for matching postal box; * &#x60;address.neighborhood&#x60;: Searches by neighborhood; * &#x60;address.city&#x60;: Searches by city; * &#x60;address.region&#x60;: Searches by region (or state); * &#x60;address.country&#x60;: Searches by ISO 3166-1 alpha-2 country code.  A note for dynamic custom fields: If a script is used to generate possible values for search, the list will be returned in the  corresponding data, and it is sent as a pipe-separated list of values (not labels). For example: &#x60;profileFields&#x3D;dynamic:a|b|c&#x60;. However, it is also possible to perform a keywords-like (full-text) search using the dynamic value label. In this case a single value, prefixed by single quotes should be used. For example: &#x60;profileFields&#x3D;dynamic:&#39;business&#x60;.  | [optional] 
 **roles** | [**[String]**](String.md)| The main role the user has. Possible values for each array element are: * administrator: A user who can manage the system and other users. * broker: A user who can manage other users. * member: A regular user who can manage operators.  * operator: A \&quot;sub-user\&quot; created by a member to manage his data.  | [optional] 
 **statuses** | [**[String]**](String.md)| The possible statuses for an user Possible values for each array element are: * active: The user is active and can use the system normally. * blocked: The user has been blocked from accessing the system. Other users still see him/her. * disabled: The user has been disabled - he/she cannot access the system and is invisible by other users. * pending: The user registration is pending a confirmation. Probably the user has received an e-mail with a link that must be followed to complete the activation. The user is invisible by other users. * removed: The user was permanently removed. It&#39;s profile is kept for historical purposes.  | [optional] 
 **usersToExclude** | [**[String]**](String.md)| Indicated the users to be excluded from the result  | [optional] 
 **usersToInclude** | [**[String]**](String.md)| Indicated the users to be included in the result.  Any other user not present in this list will be excluded from the result.  | [optional] 

### Return type

[**[UserResult]**](UserResult.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="searchUsers"></a>
# **searchUsers**
> [UserResult] searchUsers(opts)

Search for users

Returns a page of users that match a given criteria. The fields returned depend on the products, in the profile fields of other users setting. Only fields (both basic or custom) marked to be returned on user list are returned. If no fields are set to be returned, or if the &#x60;ignoreProfileFieldsInList&#x60; flag is true in the given query then the resulting objects will have the &#x60;display&#x60; and &#x60;shortDisplay&#x60; filled in.  However, those fields are not returned when another profile field is returned, preventing duplicated data to be returned.  

### Example
```javascript
var Cyclos4102Api = require('cyclos_4102_api');

var apiInstance = new Cyclos4102Api.UsersApi();

var opts = { 
  'fields': ["fields_example"], // [String] | Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
  'activationPeriod': [new Date("2013-10-20T19:20:30+01:00")], // [Date] | The minimum / maximum user activation date. Only taken into account if searching as administrator or managing broker. Is expressed an array, with the lower bound as first element, and the upper bound as second element. When only one element, will have just the lower bound. To specify only the upper bound, prefix the value with a comma. 
  'addressResult': "addressResult_example", // String | Determines which address is returned on the search, if any. By default no addresses are returned. This option is useful for displaying results as locations on a map. In all cases only located addresses (those that have the geographical coordinates set) are returned. When returning all addresses, data related with multiple addresses is returned multiple times. Possible values are: * all: All addresses are returned. * nearest: The nearest address from the reference location is returned. Only usable if a reference coordinate (`latitude` and `longitude`) * none: Addresses are not returned. * primary: The primary (default) user address is returned 
  'brokers': ["brokers_example"], // [String] | Either id or a principal (login name, e-mail, etc) for brokers 
  'creationPeriod': [new Date("2013-10-20T19:20:30+01:00")], // [Date] | The minimum / maximum user creation date. Only taken into account if searching as administrator or managing broker. Is expressed an array, with the lower bound as first element, and the upper bound as second element. When only one element, will have just the lower bound. To specify only the upper bound, prefix the value with a comma. 
  'excludeContacts': true, // Boolean | When set to `true` will not return any user that is already a contact of the currently authenticated user. 
  'groups': ["groups_example"], // [String] | Either id or internal names of groups / group sets 
  'ignoreProfileFieldsInList': true, // Boolean | When set to `true`, instead of returning users with corresponding profile fields set on list, will return them with `display` and `shortDisplay`.  
  'includeGroup': true, // Boolean | When set to `true` and the logged user has permission to view user groups, will return the `group` property on users.  
  'includeGroupSet': true, // Boolean | When set to `true` and the logged user has permission to view user group sets, will return the `groupSet` property on users.  
  'keywords': "keywords_example", // String | Textual search keywords. Sometimes, like in user search, the fields matched depends on what is configured on the products. 
  'lastLoginPeriod': [new Date("2013-10-20T19:20:30+01:00")], // [Date] | The minimum / maximum user last login date. Only taken into account if searching as administrator or managing broker. Is expressed an array, with the lower bound as first element, and the upper bound as second element. When only one element, will have just the lower bound. To specify only the upper bound, prefix the value with a comma. 
  'latitude': 1.2, // Number | The reference latitude for distance searches 
  'longitude': 1.2, // Number | The reference longitude for distance searches 
  'mainBrokerOnly': true, // Boolean | When set to `true`, will match only users that have the brokers as set in the `brokers` parameter as main broker.  
  'maxDistance': 1.2, // Number | Maximum straight-line distance between the informed location and the resulting address. Is measured either in kilometers or miles, depending on the configuration. Only accepted if both `longitude` and `latitude` parameters are passed with the actual reference position. 
  'orderBy': "orderBy_example", // String | Possible options for ordering the results of an user search. Possible values are: * alphabeticallyAsc: Users are ordered by name (or whatever field is set to format users) in ascending order. * alphabeticallyDesc: Users are ordered by name (or whatever field is set to format users) in descending order. * creationDate: Newly registered users are returned first. * distance: Only useful when providing a location, will return nearer advertisements first. * random: Users will be randomly returned * relevance: This is the default if keywords are used. Best matching users come first. 
  'page': 56, // Number | The page number (zero-based) of the search. The default value is zero. 
  'pageSize': 56, // Number | The maximum number of records that will be returned on the search. The default value is 40. The maximum number of returned results is configured in Cyclos, and even if more than that is requested, it will be limited by that setting. 
  'profileFields': ["profileFields_example"], // [String] | User profile fields, both basic (full name, login name, phone, e-mail, etc) and custom fields, that are used for search. Is a comma-separated array, where each part consists in two parts: the internal name (or custom field id) of the field, and a value, both separated by : (colon). For example, `profileFields=field1:value1,field2:value2`. Sometimes multiple values are accepted. In this case, the multiple values are separated by pipes. For example, `profileFields=field1:valueA|valueB`. The accepted fields depend on the products the authenticated user has. Enumerated fields accept multiple values, while numeric and date fields also accept ranges, which are two values, pipe-separated. For example, `profileFields=rank:bronze|silver,birthDate:2000-01-01|2001-12-31` would match results whose custom field with internal name 'rank' is either bronze or silver, and whose 'birthDate' is between January 1, 2000 and December 31, 2001. To specify a single bound in ranges (like birth dates before December 31, 2001), use a pipe in one of the values, like `profileFields=birthDate:|2001-12-31`. The basic profile fields have one of the following identifiers: * `name` or `fullName`: Full name; * `username`, `loginName` or `login`: Login name; * `email`: E-mail; * `phone`: Phone; * `accountNumber`, `account`: Account number; * `image`: Image (accepts a boolean value, indicating that either it   is required that users either have images or not).  If address is an allowed profile field for search, specific address fields may be searched. The allowed ones are normally returned as the `addressFieldsInSearch` field in the corresponding result from a data-for-search request.  The specific address fields are: * `address`: Searches on any address field (not a specific field); * `address.address`: Searches on the fields that represent the   street address, which are `addressLine1`,    `addressLine2`,   `street`,   `buildingNumber` and   `complement`. Note that normally only a   subset of them should be enabled in the configuration (either line   1 / 2 or street + number + complement);  * `address.zip`: Searches for matching zip (postal) code; * `address.poBox`: Searches for matching postal box; * `address.neighborhood`: Searches by neighborhood; * `address.city`: Searches by city; * `address.region`: Searches by region (or state); * `address.country`: Searches by ISO 3166-1 alpha-2 country code.  A note for dynamic custom fields: If a script is used to generate possible values for search, the list will be returned in the  corresponding data, and it is sent as a pipe-separated list of values (not labels). For example: `profileFields=dynamic:a|b|c`. However, it is also possible to perform a keywords-like (full-text) search using the dynamic value label. In this case a single value, prefixed by single quotes should be used. For example: `profileFields=dynamic:'business`. 
  'roles': ["roles_example"], // [String] | The main role the user has. Possible values for each array element are: * administrator: A user who can manage the system and other users. * broker: A user who can manage other users. * member: A regular user who can manage operators.  * operator: A \"sub-user\" created by a member to manage his data. 
  'statuses': ["statuses_example"], // [String] | The possible statuses for an user Possible values for each array element are: * active: The user is active and can use the system normally. * blocked: The user has been blocked from accessing the system. Other users still see him/her. * disabled: The user has been disabled - he/she cannot access the system and is invisible by other users. * pending: The user registration is pending a confirmation. Probably the user has received an e-mail with a link that must be followed to complete the activation. The user is invisible by other users. * removed: The user was permanently removed. It's profile is kept for historical purposes. 
  'usersToExclude': ["usersToExclude_example"], // [String] | Indicated the users to be excluded from the result 
  'usersToInclude': ["usersToInclude_example"] // [String] | Indicated the users to be included in the result.  Any other user not present in this list will be excluded from the result. 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.searchUsers(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **fields** | [**[String]**](String.md)| Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: &#x60;a,b.b1,c.-c1,c.-c2&#x60; will return the fields &#x60;a&#x60;, &#x60;b&#x60; (containing only the &#x60;b1&#x60; field) and &#x60;c&#x60; (containing all its fields except for &#x60;c1&#x60; or &#x60;c2&#x60;).   | [optional] 
 **activationPeriod** | [**[Date]**](Date.md)| The minimum / maximum user activation date. Only taken into account if searching as administrator or managing broker. Is expressed an array, with the lower bound as first element, and the upper bound as second element. When only one element, will have just the lower bound. To specify only the upper bound, prefix the value with a comma.  | [optional] 
 **addressResult** | **String**| Determines which address is returned on the search, if any. By default no addresses are returned. This option is useful for displaying results as locations on a map. In all cases only located addresses (those that have the geographical coordinates set) are returned. When returning all addresses, data related with multiple addresses is returned multiple times. Possible values are: * all: All addresses are returned. * nearest: The nearest address from the reference location is returned. Only usable if a reference coordinate (&#x60;latitude&#x60; and &#x60;longitude&#x60;) * none: Addresses are not returned. * primary: The primary (default) user address is returned  | [optional] 
 **brokers** | [**[String]**](String.md)| Either id or a principal (login name, e-mail, etc) for brokers  | [optional] 
 **creationPeriod** | [**[Date]**](Date.md)| The minimum / maximum user creation date. Only taken into account if searching as administrator or managing broker. Is expressed an array, with the lower bound as first element, and the upper bound as second element. When only one element, will have just the lower bound. To specify only the upper bound, prefix the value with a comma.  | [optional] 
 **excludeContacts** | **Boolean**| When set to &#x60;true&#x60; will not return any user that is already a contact of the currently authenticated user.  | [optional] 
 **groups** | [**[String]**](String.md)| Either id or internal names of groups / group sets  | [optional] 
 **ignoreProfileFieldsInList** | **Boolean**| When set to &#x60;true&#x60;, instead of returning users with corresponding profile fields set on list, will return them with &#x60;display&#x60; and &#x60;shortDisplay&#x60;.   | [optional] 
 **includeGroup** | **Boolean**| When set to &#x60;true&#x60; and the logged user has permission to view user groups, will return the &#x60;group&#x60; property on users.   | [optional] 
 **includeGroupSet** | **Boolean**| When set to &#x60;true&#x60; and the logged user has permission to view user group sets, will return the &#x60;groupSet&#x60; property on users.   | [optional] 
 **keywords** | **String**| Textual search keywords. Sometimes, like in user search, the fields matched depends on what is configured on the products.  | [optional] 
 **lastLoginPeriod** | [**[Date]**](Date.md)| The minimum / maximum user last login date. Only taken into account if searching as administrator or managing broker. Is expressed an array, with the lower bound as first element, and the upper bound as second element. When only one element, will have just the lower bound. To specify only the upper bound, prefix the value with a comma.  | [optional] 
 **latitude** | **Number**| The reference latitude for distance searches  | [optional] 
 **longitude** | **Number**| The reference longitude for distance searches  | [optional] 
 **mainBrokerOnly** | **Boolean**| When set to &#x60;true&#x60;, will match only users that have the brokers as set in the &#x60;brokers&#x60; parameter as main broker.   | [optional] 
 **maxDistance** | **Number**| Maximum straight-line distance between the informed location and the resulting address. Is measured either in kilometers or miles, depending on the configuration. Only accepted if both &#x60;longitude&#x60; and &#x60;latitude&#x60; parameters are passed with the actual reference position.  | [optional] 
 **orderBy** | **String**| Possible options for ordering the results of an user search. Possible values are: * alphabeticallyAsc: Users are ordered by name (or whatever field is set to format users) in ascending order. * alphabeticallyDesc: Users are ordered by name (or whatever field is set to format users) in descending order. * creationDate: Newly registered users are returned first. * distance: Only useful when providing a location, will return nearer advertisements first. * random: Users will be randomly returned * relevance: This is the default if keywords are used. Best matching users come first.  | [optional] 
 **page** | **Number**| The page number (zero-based) of the search. The default value is zero.  | [optional] 
 **pageSize** | **Number**| The maximum number of records that will be returned on the search. The default value is 40. The maximum number of returned results is configured in Cyclos, and even if more than that is requested, it will be limited by that setting.  | [optional] 
 **profileFields** | [**[String]**](String.md)| User profile fields, both basic (full name, login name, phone, e-mail, etc) and custom fields, that are used for search. Is a comma-separated array, where each part consists in two parts: the internal name (or custom field id) of the field, and a value, both separated by : (colon). For example, &#x60;profileFields&#x3D;field1:value1,field2:value2&#x60;. Sometimes multiple values are accepted. In this case, the multiple values are separated by pipes. For example, &#x60;profileFields&#x3D;field1:valueA|valueB&#x60;. The accepted fields depend on the products the authenticated user has. Enumerated fields accept multiple values, while numeric and date fields also accept ranges, which are two values, pipe-separated. For example, &#x60;profileFields&#x3D;rank:bronze|silver,birthDate:2000-01-01|2001-12-31&#x60; would match results whose custom field with internal name &#39;rank&#39; is either bronze or silver, and whose &#39;birthDate&#39; is between January 1, 2000 and December 31, 2001. To specify a single bound in ranges (like birth dates before December 31, 2001), use a pipe in one of the values, like &#x60;profileFields&#x3D;birthDate:|2001-12-31&#x60;. The basic profile fields have one of the following identifiers: * &#x60;name&#x60; or &#x60;fullName&#x60;: Full name; * &#x60;username&#x60;, &#x60;loginName&#x60; or &#x60;login&#x60;: Login name; * &#x60;email&#x60;: E-mail; * &#x60;phone&#x60;: Phone; * &#x60;accountNumber&#x60;, &#x60;account&#x60;: Account number; * &#x60;image&#x60;: Image (accepts a boolean value, indicating that either it   is required that users either have images or not).  If address is an allowed profile field for search, specific address fields may be searched. The allowed ones are normally returned as the &#x60;addressFieldsInSearch&#x60; field in the corresponding result from a data-for-search request.  The specific address fields are: * &#x60;address&#x60;: Searches on any address field (not a specific field); * &#x60;address.address&#x60;: Searches on the fields that represent the   street address, which are &#x60;addressLine1&#x60;,    &#x60;addressLine2&#x60;,   &#x60;street&#x60;,   &#x60;buildingNumber&#x60; and   &#x60;complement&#x60;. Note that normally only a   subset of them should be enabled in the configuration (either line   1 / 2 or street + number + complement);  * &#x60;address.zip&#x60;: Searches for matching zip (postal) code; * &#x60;address.poBox&#x60;: Searches for matching postal box; * &#x60;address.neighborhood&#x60;: Searches by neighborhood; * &#x60;address.city&#x60;: Searches by city; * &#x60;address.region&#x60;: Searches by region (or state); * &#x60;address.country&#x60;: Searches by ISO 3166-1 alpha-2 country code.  A note for dynamic custom fields: If a script is used to generate possible values for search, the list will be returned in the  corresponding data, and it is sent as a pipe-separated list of values (not labels). For example: &#x60;profileFields&#x3D;dynamic:a|b|c&#x60;. However, it is also possible to perform a keywords-like (full-text) search using the dynamic value label. In this case a single value, prefixed by single quotes should be used. For example: &#x60;profileFields&#x3D;dynamic:&#39;business&#x60;.  | [optional] 
 **roles** | [**[String]**](String.md)| The main role the user has. Possible values for each array element are: * administrator: A user who can manage the system and other users. * broker: A user who can manage other users. * member: A regular user who can manage operators.  * operator: A \&quot;sub-user\&quot; created by a member to manage his data.  | [optional] 
 **statuses** | [**[String]**](String.md)| The possible statuses for an user Possible values for each array element are: * active: The user is active and can use the system normally. * blocked: The user has been blocked from accessing the system. Other users still see him/her. * disabled: The user has been disabled - he/she cannot access the system and is invisible by other users. * pending: The user registration is pending a confirmation. Probably the user has received an e-mail with a link that must be followed to complete the activation. The user is invisible by other users. * removed: The user was permanently removed. It&#39;s profile is kept for historical purposes.  | [optional] 
 **usersToExclude** | [**[String]**](String.md)| Indicated the users to be excluded from the result  | [optional] 
 **usersToInclude** | [**[String]**](String.md)| Indicated the users to be included in the result.  Any other user not present in this list will be excluded from the result.  | [optional] 

### Return type

[**[UserResult]**](UserResult.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="updateUser"></a>
# **updateUser**
> updateUser(user, body, opts)

Save a user details

Saves the user profile. Only the basic fields (full name, login name, e-mail) and custom fields can be saved with this operation. Addresses, phones and images must be managed through their own paths. 

### Example
```javascript
var Cyclos4102Api = require('cyclos_4102_api');
var defaultClient = Cyclos4102Api.ApiClient.instance;

// Configure API key authorization: accessClient
var accessClient = defaultClient.authentications['accessClient'];
accessClient.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//accessClient.apiKeyPrefix = 'Token';

// Configure HTTP basic authorization: basic
var basic = defaultClient.authentications['basic'];
basic.username = 'YOUR USERNAME';
basic.password = 'YOUR PASSWORD';

// Configure API key authorization: session
var session = defaultClient.authentications['session'];
session.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//session.apiKeyPrefix = 'Token';

var apiInstance = new Cyclos4102Api.UsersApi();

var user = "user_example"; // String | Can be one of: * a user identification value, such as id, username, e-mail, phone, etc.   Id is always allowed, others depend on Cyclos configuration. Note that   a valid numeric value is always considered as id. For example, when   using another identification method that can be numeric only, prefix   the value with a single quote (like in Excel spreadsheets), for   example, `'1234567890`;     * `self` for the currently authenticated user. 

var body = new Cyclos4102Api.UserEdit(); // UserEdit | The user to be saved

var opts = { 
  'confirmationPassword': "confirmationPassword_example" // String | The password used to confirm this action, if needed. The actual password type, if any, depends on the Cyclos configuration for the current channel. 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.updateUser(user, body, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **user** | **String**| Can be one of: * a user identification value, such as id, username, e-mail, phone, etc.   Id is always allowed, others depend on Cyclos configuration. Note that   a valid numeric value is always considered as id. For example, when   using another identification method that can be numeric only, prefix   the value with a single quote (like in Excel spreadsheets), for   example, &#x60;&#39;1234567890&#x60;;     * &#x60;self&#x60; for the currently authenticated user.  | 
 **body** | [**UserEdit**](UserEdit.md)| The user to be saved | 
 **confirmationPassword** | **String**| The password used to confirm this action, if needed. The actual password type, if any, depends on the Cyclos configuration for the current channel.  | [optional] 

### Return type

null (empty response body)

### Authorization

[accessClient](../README.md#accessClient), [basic](../README.md#basic), [session](../README.md#session)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="validateEmailChange"></a>
# **validateEmailChange**
> &#39;String&#39; validateEmailChange(key)

Validates an e-mail via a validation key

When the user e-mail is changed, and the configuration enables the validation, an e-mail is sent to the new user e-mail, with a link to verify it. In this case, only after verifying the new e-mail it is effectively set as the new e-mail. This operation effectively verifies the new e-mail. 

### Example
```javascript
var Cyclos4102Api = require('cyclos_4102_api');

var apiInstance = new Cyclos4102Api.UsersApi();

var key = "key_example"; // String | The validation key sent via e-mail


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.validateEmailChange(key, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **key** | **String**| The validation key sent via e-mail | 

### Return type

**&#39;String&#39;**

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="validateUserRegistration"></a>
# **validateUserRegistration**
> UserRegistrationResult validateUserRegistration(key, opts)

Validates an user registration via a key sent by e-mail

When a user is registered, and the configuration enables the validation, an e-mail is sent to user e-mail, with a link to verify it. In this case, only after verifying the e-mail the user is activated. This operation effectively verifies the e-mail and performs the user activation. However, depending on the settings, the initial user status might be blocked or inactive.   

### Example
```javascript
var Cyclos4102Api = require('cyclos_4102_api');

var apiInstance = new Cyclos4102Api.UsersApi();

var key = "key_example"; // String | The validation key sent via e-mail

var opts = { 
  'fields': ["fields_example"] // [String] | Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.validateUserRegistration(key, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **key** | **String**| The validation key sent via e-mail | 
 **fields** | [**[String]**](String.md)| Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: &#x60;a,b.b1,c.-c1,c.-c2&#x60; will return the fields &#x60;a&#x60;, &#x60;b&#x60; (containing only the &#x60;b1&#x60; field) and &#x60;c&#x60; (containing all its fields except for &#x60;c1&#x60; or &#x60;c2&#x60;).   | [optional] 

### Return type

[**UserRegistrationResult**](UserRegistrationResult.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="validateUserRegistrationField"></a>
# **validateUserRegistrationField**
> &#39;String&#39; validateUserRegistrationField(group, field, value, opts)

Validates the value of a single field for user registration

Validates the value of a field which will be used for registering a user, returning either &#x60;204 No Content&#x60; if the field is valid or &#x60;200&#x60; with the error description if the field is invalid. Notice that the result is the validation error. If a &#x60;422&#x60; status code is returned it means that either the given &#x60;field&#x60; is invalid or the given &#x60;value&#x60; is empty. 

### Example
```javascript
var Cyclos4102Api = require('cyclos_4102_api');

var apiInstance = new Cyclos4102Api.UsersApi();

var group = "group_example"; // String | The internal name or id of the group in which the user is being registered  

var field = "field_example"; // String | One of: `name` (full name), `username` (login name), `email`, `mobilePhone`, `landLinePhone` or the internal name of a custom field.  

var value = "value_example"; // String | The value to be validated

var opts = { 
  'asMember': true // Boolean | Flag required only when the authenticated user is a member and a broker, in that case we need to distingish between both. If true then the groups returned will be those allowed as member, otherwise will return the goups allowed as broker.   
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.validateUserRegistrationField(group, field, value, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **group** | **String**| The internal name or id of the group in which the user is being registered   | 
 **field** | **String**| One of: &#x60;name&#x60; (full name), &#x60;username&#x60; (login name), &#x60;email&#x60;, &#x60;mobilePhone&#x60;, &#x60;landLinePhone&#x60; or the internal name of a custom field.   | 
 **value** | **String**| The value to be validated | 
 **asMember** | **Boolean**| Flag required only when the authenticated user is a member and a broker, in that case we need to distingish between both. If true then the groups returned will be those allowed as member, otherwise will return the goups allowed as broker.    | [optional] 

### Return type

**&#39;String&#39;**

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json, text/plain

<a name="viewUser"></a>
# **viewUser**
> UserView viewUser(user, opts)

View a user details

Returns the profile information of a user. 

### Example
```javascript
var Cyclos4102Api = require('cyclos_4102_api');

var apiInstance = new Cyclos4102Api.UsersApi();

var user = "user_example"; // String | Can be one of: * a user identification value, such as id, username, e-mail, phone, etc.   Id is always allowed, others depend on Cyclos configuration. Note that   a valid numeric value is always considered as id. For example, when   using another identification method that can be numeric only, prefix   the value with a single quote (like in Excel spreadsheets), for   example, `'1234567890`;     * `self` for the currently authenticated user. 

var opts = { 
  'fields': ["fields_example"] // [String] | Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.viewUser(user, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **user** | **String**| Can be one of: * a user identification value, such as id, username, e-mail, phone, etc.   Id is always allowed, others depend on Cyclos configuration. Note that   a valid numeric value is always considered as id. For example, when   using another identification method that can be numeric only, prefix   the value with a single quote (like in Excel spreadsheets), for   example, &#x60;&#39;1234567890&#x60;;     * &#x60;self&#x60; for the currently authenticated user.  | 
 **fields** | [**[String]**](String.md)| Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: &#x60;a,b.b1,c.-c1,c.-c2&#x60; will return the fields &#x60;a&#x60;, &#x60;b&#x60; (containing only the &#x60;b1&#x60; field) and &#x60;c&#x60; (containing all its fields except for &#x60;c1&#x60; or &#x60;c2&#x60;).   | [optional] 

### Return type

[**UserView**](UserView.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

