# PassAppSwaggerApi.UserApi

All URIs are relative to *http://localhost:3010/api/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**addUserRelation**](UserApi.md#addUserRelation) | **PUT** /users/relation | 
[**changePassword**](UserApi.md#changePassword) | **PUT** /users/change/password | 
[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /users/{id} | 
[**getUser**](UserApi.md#getUser) | **GET** /users/{id} | 
[**getUserCompaniesByLocation**](UserApi.md#getUserCompaniesByLocation) | **POST** /users/company/location | 
[**getUserProfile**](UserApi.md#getUserProfile) | **GET** /users/profile/details | 
[**getUsers**](UserApi.md#getUsers) | **GET** /users | 
[**removeUserRelation**](UserApi.md#removeUserRelation) | **PUT** /users/remove/relation | 
[**updateUser**](UserApi.md#updateUser) | **PUT** /users/profile | 
[**uploadImage**](UserApi.md#uploadImage) | **PUT** /users/image/upload | 
[**userAddress**](UserApi.md#userAddress) | **PUT** /users/address | 

<a name="addUserRelation"></a>
# **addUserRelation**
> User addUserRelation(body)



update relations

### Example
```javascript
import PassAppSwaggerApi from 'pass_app_swagger_api';
let defaultClient = PassAppSwaggerApi.ApiClient.instance;

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

let apiInstance = new PassAppSwaggerApi.UserApi();
let body = new PassAppSwaggerApi.Relation(); // Relation | relation datas

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**Relation**](Relation.md)| relation datas | 

### Return type

[**User**](User.md)

### Authorization

[api_key](../README.md#api_key)

### HTTP request headers

 - **Content-Type**: application/json, application/xml
 - **Accept**: application/json, application/xml

<a name="changePassword"></a>
# **changePassword**
> CommonSuccess changePassword(body)



change user password

### Example
```javascript
import PassAppSwaggerApi from 'pass_app_swagger_api';

let apiInstance = new PassAppSwaggerApi.UserApi();
let body = new PassAppSwaggerApi.User(); // User | _id ,new_password and password only

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**User**](User.md)| _id ,new_password and password only | 

### Return type

[**CommonSuccess**](CommonSuccess.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: application/json, application/xml
 - **Accept**: application/json, application/xml

<a name="deleteUser"></a>
# **deleteUser**
> User deleteUser(id)



delete user

### Example
```javascript
import PassAppSwaggerApi from 'pass_app_swagger_api';

let apiInstance = new PassAppSwaggerApi.UserApi();
let id = "id_example"; // String | user id

apiInstance.deleteUser(id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| user id | 

### Return type

[**User**](User.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="getUser"></a>
# **getUser**
> User getUser(id)



get selected user

### Example
```javascript
import PassAppSwaggerApi from 'pass_app_swagger_api';

let apiInstance = new PassAppSwaggerApi.UserApi();
let id = "id_example"; // String | user id

apiInstance.getUser(id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| user id | 

### Return type

[**User**](User.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="getUserCompaniesByLocation"></a>
# **getUserCompaniesByLocation**
> [Company] getUserCompaniesByLocation(body)



get company according to given location

### Example
```javascript
import PassAppSwaggerApi from 'pass_app_swagger_api';
let defaultClient = PassAppSwaggerApi.ApiClient.instance;

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

let apiInstance = new PassAppSwaggerApi.UserApi();
let body = new PassAppSwaggerApi.LocationModel(); // LocationModel | latitude and longitude

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**LocationModel**](LocationModel.md)| latitude and longitude | 

### Return type

[**[Company]**](Company.md)

### Authorization

[api_key](../README.md#api_key)

### HTTP request headers

 - **Content-Type**: application/json, application/xml
 - **Accept**: application/json, application/xml

<a name="getUserProfile"></a>
# **getUserProfile**
> User getUserProfile()



get user

### Example
```javascript
import PassAppSwaggerApi from 'pass_app_swagger_api';
let defaultClient = PassAppSwaggerApi.ApiClient.instance;

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

let apiInstance = new PassAppSwaggerApi.UserApi();
apiInstance.getUserProfile((error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters
This endpoint does not need any parameter.

### Return type

[**User**](User.md)

### Authorization

[api_key](../README.md#api_key)

### HTTP request headers

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

<a name="getUsers"></a>
# **getUsers**
> [User] getUsers()



get all users

### Example
```javascript
import PassAppSwaggerApi from 'pass_app_swagger_api';

let apiInstance = new PassAppSwaggerApi.UserApi();
apiInstance.getUsers((error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters
This endpoint does not need any parameter.

### Return type

[**[User]**](User.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="removeUserRelation"></a>
# **removeUserRelation**
> User removeUserRelation(body)



update relations

### Example
```javascript
import PassAppSwaggerApi from 'pass_app_swagger_api';
let defaultClient = PassAppSwaggerApi.ApiClient.instance;

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

let apiInstance = new PassAppSwaggerApi.UserApi();
let body = new PassAppSwaggerApi.Relation(); // Relation | relation data

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**Relation**](Relation.md)| relation data | 

### Return type

[**User**](User.md)

### Authorization

[api_key](../README.md#api_key)

### HTTP request headers

 - **Content-Type**: application/json, application/xml
 - **Accept**: application/json, application/xml

<a name="updateUser"></a>
# **updateUser**
> User updateUser(body)



update user

### Example
```javascript
import PassAppSwaggerApi from 'pass_app_swagger_api';
let defaultClient = PassAppSwaggerApi.ApiClient.instance;

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

let apiInstance = new PassAppSwaggerApi.UserApi();
let body = new PassAppSwaggerApi.User(); // User | user details

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**User**](User.md)| user details | 

### Return type

[**User**](User.md)

### Authorization

[api_key](../README.md#api_key)

### HTTP request headers

 - **Content-Type**: application/json, application/xml
 - **Accept**: application/json, application/xml

<a name="uploadImage"></a>
# **uploadImage**
> ImageResult uploadImage(image)



upload image

### Example
```javascript
import PassAppSwaggerApi from 'pass_app_swagger_api';
let defaultClient = PassAppSwaggerApi.ApiClient.instance;

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

let apiInstance = new PassAppSwaggerApi.UserApi();
let image = "image_example"; // File | 

apiInstance.uploadImage(image, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **image** | **File**|  | 

### Return type

[**ImageResult**](ImageResult.md)

### Authorization

[api_key](../README.md#api_key)

### HTTP request headers

 - **Content-Type**: multipart/form-data
 - **Accept**: application/json, application/xml

<a name="userAddress"></a>
# **userAddress**
> User userAddress(body)



update relations

### Example
```javascript
import PassAppSwaggerApi from 'pass_app_swagger_api';
let defaultClient = PassAppSwaggerApi.ApiClient.instance;

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

let apiInstance = new PassAppSwaggerApi.UserApi();
let body = new PassAppSwaggerApi.Address(); // Address | address data

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**Address**](Address.md)| address data | 

### Return type

[**User**](User.md)

### Authorization

[api_key](../README.md#api_key)

### HTTP request headers

 - **Content-Type**: application/json, application/xml
 - **Accept**: application/json, application/xml

