# Cyclos411Api.SessionsApi

All URIs are relative to *https://138.197.145.149:8080/cyclos/eCloudAtm/api*

Method | HTTP request | Description
------------- | ------------- | -------------
[**loginUser**](SessionsApi.md#loginUser) | **POST** /sessions | Logins a user, returning data from the new session


<a name="loginUser"></a>
# **loginUser**
> UserAuth loginUser(opts)

Logins a user, returning data from the new session

Created a session for a given user. Must be executed as administrator with permissions. A channel can be specified (defaults to &#x60;main&#x60;) so the user can be logged in by some external actor (like an website) and then redirected to &#x60;&lt;cyclos-root&gt;?sessionToken&#x3D;&lt;session-token&gt;&#x60;. It is also recommended to set in Cyclos the login and logout URLs in the configuration, so, when the user logs out, he will be redirected back to the previous website. 

### Example
```javascript
var Cyclos411Api = require('cyclos_411_api');

var apiInstance = new Cyclos411Api.SessionsApi();

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`).  
  'login': new Cyclos411Api.LoginUser() // LoginUser | Information about the user being logged in
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.loginUser(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] 
 **login** | [**LoginUser**](LoginUser.md)| Information about the user being logged in | [optional] 

### Return type

[**UserAuth**](UserAuth.md)

### Authorization

No authorization required

### HTTP request headers

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

