# Cyclos4102Api.ImagesApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**deleteImage**](ImagesApi.md#deleteImage) | **DELETE** /images/{id} | Removes an image by id
[**getAdImagesListData**](ImagesApi.md#getAdImagesListData) | **GET** /marketplace/{ad}/images/list-data | Returns the images of an advertisement, plus additional permissions and data  
[**getImageContent**](ImagesApi.md#getImageContent) | **GET** /images/{kind}/{file} | Returns an image content
[**getImageContentById**](ImagesApi.md#getImageContentById) | **GET** /images/{id}/content | Returns an image content by id
[**getUserImagesListData**](ImagesApi.md#getUserImagesListData) | **GET** /{user}/images/list-data | Returns either &#x60;profile&#x60; or &#x60;custom&#x60; images for a given user, plus additional permissions and data  
[**listAdImages**](ImagesApi.md#listAdImages) | **GET** /marketplace/{ad}/images | Lists the images of an advertisement 
[**listTempImages**](ImagesApi.md#listTempImages) | **GET** /images/temp | Lists temporary images related to the currently authenticated user or guest 
[**listUserImages**](ImagesApi.md#listUserImages) | **GET** /{user}/images | Lists either &#x60;profile&#x60; or &#x60;custom&#x60; images for a given user  
[**reorderAdImages**](ImagesApi.md#reorderAdImages) | **PUT** /marketplace/{ad}/images/order | Changes the order of the images of an advertisement  
[**reorderProfileImages**](ImagesApi.md#reorderProfileImages) | **PUT** /{user}/images/order | Changes the order of a user&#39;s profile images  
[**uploadAdImage**](ImagesApi.md#uploadAdImage) | **POST** /marketplace/{ad}/images | Adds a new image for the given advertisement. 
[**uploadContactInfoImage**](ImagesApi.md#uploadContactInfoImage) | **POST** /contactInfos/{id}/image | Uploads a new image for the given additional contact information. 
[**uploadTempImage**](ImagesApi.md#uploadTempImage) | **POST** /images/temp | Adds a new temporary image for the currently authenticated user or guest. 
[**uploadUserImage**](ImagesApi.md#uploadUserImage) | **POST** /{user}/images | Adds a new image for the given user. The image kind is either  &#x60;profile&#x60; or &#x60;custom&#x60;. 
[**viewImage**](ImagesApi.md#viewImage) | **GET** /images/{id} | Returns an image details by id


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

Removes an image by id

Removes the image with the given internal id. Any image kind can be removed using this operation, but the authenticated user needs the appropriate permission to do so.  

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

var apiInstance = new Cyclos4102Api.ImagesApi();

var id = "id_example"; // String | The object identification


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| The object identification | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

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

<a name="getAdImagesListData"></a>
# **getAdImagesListData**
> ImagesListData getAdImagesListData(ad, opts)

Returns the images of an advertisement, plus additional permissions and data  

Returns the images of an advertisement. Additional data, such as the maximum images and whether the images can be managed by the authenticated user are also returned. 

### 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.ImagesApi();

var ad = "ad_example"; // String | Can be either the advertisement internal identifier or, in case of webshop advertisements, can be the product number (if the owner is the logged user) or a string in the form `productNumber@user`, with the user identifier as well.      

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.getAdImagesListData(ad, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **ad** | **String**| Can be either the advertisement internal identifier or, in case of webshop advertisements, can be the product number (if the owner is the logged user) or a string in the form &#x60;productNumber@user&#x60;, with the user identifier as well.       | 
 **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

[**ImagesListData**](ImagesListData.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="getImageContent"></a>
# **getImageContent**
> File getImageContent(kind, file, opts)

Returns an image content

Returns the content of an image, given the image kind and key. When neither &#x60;width&#x60; nor &#x60;height&#x60; are specified, returns the original content. The original ratio is always maintained. When only of one of  the dimensions is specified, it is used as maximum, and the other is calculated. When both are informed, the maximum size with the original ratio that fits both dimensions is used.  

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

var apiInstance = new Cyclos4102Api.ImagesApi();

var kind = "kind_example"; // String | Determines the kind of an image Possible values are: * ad: Advertisement images are associated with an advertisement, be it simple or for web shop. * adCategory: An image of an advertisement (simple or webshop) * contactInfo: An image of an additional contact information * customFieldValue: An image used as custom field value * profile: User profile images are those associated with the user profile. The first profile image is used to depict the user on search results. * systemCustom: System custom images are additional images an administrator that can be used on rich text contents. * temp: A temporary image which can upload for later associating with an entity being registered (for example, user or advertisement). * userCustom: User custom images are additional images that can be used on rich text contents. * voucherType: An image of a voucher type 

var file = "file_example"; // String | The file name. This is not the original uploaded file name, but a generated one. 

var opts = { 
  'width': 56, // Number | The requested image width
  'height': 56 // Number | The requested file height
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **kind** | **String**| Determines the kind of an image Possible values are: * ad: Advertisement images are associated with an advertisement, be it simple or for web shop. * adCategory: An image of an advertisement (simple or webshop) * contactInfo: An image of an additional contact information * customFieldValue: An image used as custom field value * profile: User profile images are those associated with the user profile. The first profile image is used to depict the user on search results. * systemCustom: System custom images are additional images an administrator that can be used on rich text contents. * temp: A temporary image which can upload for later associating with an entity being registered (for example, user or advertisement). * userCustom: User custom images are additional images that can be used on rich text contents. * voucherType: An image of a voucher type  | 
 **file** | **String**| The file name. This is not the original uploaded file name, but a generated one.  | 
 **width** | **Number**| The requested image width | [optional] 
 **height** | **Number**| The requested file height | [optional] 

### Return type

**File**

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json, image/jpeg, image/gif, image/png

<a name="getImageContentById"></a>
# **getImageContentById**
> File getImageContentById(id, opts)

Returns an image content by id

Returns the content of an image, given the image kind and key. When neither &#x60;width&#x60; nor &#x60;height&#x60; are specified, returns the original content. The original ratio is always maintained. When only of one of  the dimensions is specified, it is used as maximum, and the other is calculated. When both are informed, the maximum size with the original ratio that fits both dimensions is used.  

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

var apiInstance = new Cyclos4102Api.ImagesApi();

var id = "id_example"; // String | The object identification

var opts = { 
  'width': 56, // Number | The requested image width
  'height': 56 // Number | The requested file height
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| The object identification | 
 **width** | **Number**| The requested image width | [optional] 
 **height** | **Number**| The requested file height | [optional] 

### Return type

**File**

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json, image/jpeg, image/gif, image/png

<a name="getUserImagesListData"></a>
# **getUserImagesListData**
> ImagesListData getUserImagesListData(user, opts)

Returns either &#x60;profile&#x60; or &#x60;custom&#x60; images for a given user, plus additional permissions and data  

Returns either &#x60;profile&#x60; or &#x60;custom&#x60; images for the given user. For &#x60;profile&#x60;, the user must be visible by the authenticated user. For &#x60;custom&#x60;, the authenticated user must either be the owner or a manager (administrator or broker). Custom images are used in rich text content, not images for custom fields. Additional data, such as the maximum images and whether the images can be managed by the authenticated user are also returned. 

### 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.ImagesApi();

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`).  
  'kind': "kind_example" // String | The kind of images to be returned.   The default value is `profile` Possible values are: * custom: User custom images are additional images that can be used on rich text contents. * profile: User profile images are those associated with the user profile. The first profile image is used to depict the user on search results. 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getUserImagesListData(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] 
 **kind** | **String**| The kind of images to be returned.   The default value is &#x60;profile&#x60; Possible values are: * custom: User custom images are additional images that can be used on rich text contents. * profile: User profile images are those associated with the user profile. The first profile image is used to depict the user on search results.  | [optional] 

### Return type

[**ImagesListData**](ImagesListData.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="listAdImages"></a>
# **listAdImages**
> [Image] listAdImages(ad, opts)

Lists the images of an advertisement 

Returns the images of an advertisement. 

### 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.ImagesApi();

var ad = "ad_example"; // String | Can be either the advertisement internal identifier or, in case of webshop advertisements, can be the product number (if the owner is the logged user) or a string in the form `productNumber@user`, with the user identifier as well.      

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.listAdImages(ad, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **ad** | **String**| Can be either the advertisement internal identifier or, in case of webshop advertisements, can be the product number (if the owner is the logged user) or a string in the form &#x60;productNumber@user&#x60;, with the user identifier as well.       | 
 **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

[**[Image]**](Image.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="listTempImages"></a>
# **listTempImages**
> [Image] listTempImages(opts)

Lists temporary images related to the currently authenticated user or guest 

Returns all uploaded temporary images by the current user, or guest key. If the current request is as guest and no guest key is given, the IP address is used to match images. Using a key is recommended, because clients that move between WiFi and mobile connection or if the client is in a network with multiple outbound IP addresses, images won&#39;t be correctly matched without a key.  

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

var apiInstance = new Cyclos4102Api.ImagesApi();

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`).  
  'guestKey': "guestKey_example" // String | This parameter is only taken into account if the current request is running as guest. It is the key passed by the client when uploading images. If no key is given, images are matched by remote address.  
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.listTempImages(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] 
 **guestKey** | **String**| This parameter is only taken into account if the current request is running as guest. It is the key passed by the client when uploading images. If no key is given, images are matched by remote address.   | [optional] 

### Return type

[**[Image]**](Image.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="listUserImages"></a>
# **listUserImages**
> [Image] listUserImages(user, opts)

Lists either &#x60;profile&#x60; or &#x60;custom&#x60; images for a given user  

Returns either &#x60;profile&#x60; or &#x60;custom&#x60; images for the given user. For &#x60;profile&#x60;, the user  must be visible by the authenticated user. Custom images are used in rich text content, not images for custom fields. For &#x60;custom&#x60;, the authenticated user must either be the owner or a manager (administrator or broker). 

### 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.ImagesApi();

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`).  
  'kind': "kind_example" // String | The kind of images to be returned.   The default value is `profile` Possible values are: * custom: User custom images are additional images that can be used on rich text contents. * profile: User profile images are those associated with the user profile. The first profile image is used to depict the user on search results. 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.listUserImages(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] 
 **kind** | **String**| The kind of images to be returned.   The default value is &#x60;profile&#x60; Possible values are: * custom: User custom images are additional images that can be used on rich text contents. * profile: User profile images are those associated with the user profile. The first profile image is used to depict the user on search results.  | [optional] 

### Return type

[**[Image]**](Image.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="reorderAdImages"></a>
# **reorderAdImages**
> reorderAdImages(ad, ids)

Changes the order of the images of an advertisement  

The new order is defined by the list of ids, so that images appear in the same order as the ids. 

### 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.ImagesApi();

var ad = "ad_example"; // String | Can be either the advertisement internal identifier or, in case of webshop advertisements, can be the product number (if the owner is the logged user) or a string in the form `productNumber@user`, with the user identifier as well.      

var ids = ["ids_example"]; // [String] | The array of ids (comma-separated) reflecting the desired order


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.reorderAdImages(ad, ids, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **ad** | **String**| Can be either the advertisement internal identifier or, in case of webshop advertisements, can be the product number (if the owner is the logged user) or a string in the form &#x60;productNumber@user&#x60;, with the user identifier as well.       | 
 **ids** | [**[String]**](String.md)| The array of ids (comma-separated) reflecting the desired order | 

### 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="reorderProfileImages"></a>
# **reorderProfileImages**
> reorderProfileImages(user, ids)

Changes the order of a user&#39;s profile images  

The new order is defined by the list of ids, so that images appear in the same order as the ids. 

### 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.ImagesApi();

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 ids = ["ids_example"]; // [String] | The array of ids (comma-separated) reflecting the desired order


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.reorderProfileImages(user, ids, 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.  | 
 **ids** | [**[String]**](String.md)| The array of ids (comma-separated) reflecting the desired order | 

### 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="uploadAdImage"></a>
# **uploadAdImage**
> &#39;String&#39; uploadAdImage(ad, image, opts)

Adds a new image for the given advertisement. 

Uploads a new image for the given advertisement. 

### 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.ImagesApi();

var ad = "ad_example"; // String | Can be either the advertisement internal identifier or, in case of webshop advertisements, can be the product number (if the owner is the logged user) or a string in the form `productNumber@user`, with the user identifier as well.      

var image = "/path/to/file.txt"; // File | The image being uploaded

var opts = { 
  'name': "name_example" // String | The name for the new image. If not informed will fall back to the original file name in the form data 
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **ad** | **String**| Can be either the advertisement internal identifier or, in case of webshop advertisements, can be the product number (if the owner is the logged user) or a string in the form &#x60;productNumber@user&#x60;, with the user identifier as well.       | 
 **image** | **File**| The image being uploaded | 
 **name** | **String**| The name for the new image. If not informed will fall back to the original file name in the form data  | [optional] 

### Return type

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

### Authorization

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

### HTTP request headers

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

<a name="uploadContactInfoImage"></a>
# **uploadContactInfoImage**
> &#39;String&#39; uploadContactInfoImage(id, image, opts)

Uploads a new image for the given additional contact information. 

Saves the given image for the additional contact information. If the given additional contact information already has an image, the old one is removed, and the current image is saved in its place. 

### 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.ImagesApi();

var id = "id_example"; // String | The object identification

var image = "/path/to/file.txt"; // File | The image being uploaded

var opts = { 
  'name': "name_example" // String | The name for the new image. If not informed will fall back to the original file name in the form data 
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| The object identification | 
 **image** | **File**| The image being uploaded | 
 **name** | **String**| The name for the new image. If not informed will fall back to the original file name in the form data  | [optional] 

### Return type

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

### Authorization

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

### HTTP request headers

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

<a name="uploadTempImage"></a>
# **uploadTempImage**
> &#39;String&#39; uploadTempImage(image, opts)

Adds a new temporary image for the currently authenticated user or guest. 

Uploads a new temporary image. A temporary image can later be used as: - A profile image of a newly registered user; - The value of a custom field of type image; - An advertisement image. Temporary images won&#39;t be immediately associated to the next registered model, but its &#x60;id&#x60;, which is returned by this operation, must be explicitly passed in, either as the &#x60;images&#x60; field (for profile or advertisement images) or in the &#x60;customValues&#x60; field of the model that has custom values (multiple ids can be passed-in as pipe-separated). Images as guest can only be uploaded if on the destination group products the image profile field is allowed at registrations. Users may upload images if they can register new users or create advertisements. 

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

var apiInstance = new Cyclos4102Api.ImagesApi();

var image = "/path/to/file.txt"; // File | The image being uploaded

var opts = { 
  'name': "name_example", // String | The name for the new image. If not informed will fall back to the original file name in the form data 
  'guestKey': "guestKey_example" // String | This parameter is only taken into account if the current request is running as guest. It should be a reasonably unique key (for example, an UUID, device identifier or a reasonably large random string) which uniquely identifies the uploaded image as belonging to this \"session\". If no key is given, images uploaded as guest are matched by IP address. Using a key is recommended, because clients that move between WiFi and mobile connection or if the client is in a network with multiple outbound IP addresses, images won't be correctly matched without a key.   
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **image** | **File**| The image being uploaded | 
 **name** | **String**| The name for the new image. If not informed will fall back to the original file name in the form data  | [optional] 
 **guestKey** | **String**| This parameter is only taken into account if the current request is running as guest. It should be a reasonably unique key (for example, an UUID, device identifier or a reasonably large random string) which uniquely identifies the uploaded image as belonging to this \&quot;session\&quot;. If no key is given, images uploaded as guest are matched by IP address. Using a key is recommended, because clients that move between WiFi and mobile connection or if the client is in a network with multiple outbound IP addresses, images won&#39;t be correctly matched without a key.    | [optional] 

### Return type

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

### Authorization

No authorization required

### HTTP request headers

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

<a name="uploadUserImage"></a>
# **uploadUserImage**
> &#39;String&#39; uploadUserImage(user, image, opts)

Adds a new image for the given user. The image kind is either  &#x60;profile&#x60; or &#x60;custom&#x60;. 

Uploads a new image, either &#x60;profile&#x60; (by default) or &#x60;custom&#x60;, for the given user. Custom images are used in rich text content, not images for custom fields. For uploading images for custom field values, see the documentation for the operation at &#x60;POST /images/temp&#x60;. 

### 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.ImagesApi();

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 image = "/path/to/file.txt"; // File | The image being uploaded

var opts = { 
  'kind': "kind_example", // String | The kind of images to be returned.   The default value is `profile` Possible values are: * custom: User custom images are additional images that can be used on rich text contents. * profile: User profile images are those associated with the user profile. The first profile image is used to depict the user on search results. 
  'name': "name_example" // String | The name for the new image. If not informed will fall back to the original file name in the form data 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.uploadUserImage(user, image, 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.  | 
 **image** | **File**| The image being uploaded | 
 **kind** | **String**| The kind of images to be returned.   The default value is &#x60;profile&#x60; Possible values are: * custom: User custom images are additional images that can be used on rich text contents. * profile: User profile images are those associated with the user profile. The first profile image is used to depict the user on search results.  | [optional] 
 **name** | **String**| The name for the new image. If not informed will fall back to the original file name in the form data  | [optional] 

### Return type

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

### Authorization

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

### HTTP request headers

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

<a name="viewImage"></a>
# **viewImage**
> ImageView viewImage(id, opts)

Returns an image details by id

Returns metadata about an image given its id

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

var apiInstance = new Cyclos4102Api.ImagesApi();

var id = "id_example"; // String | The object identification

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.viewImage(id, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| The object identification | 
 **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

[**ImageView**](ImageView.md)

### Authorization

No authorization required

### HTTP request headers

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

