# BuyBorghiMobileServices.MsgApi

All URIs are relative to *http://buyborghi.imolinfo.it/BuyBorghiApi/rest*

Method | HTTP request | Description
------------- | ------------- | -------------
[**msgBroadcastPost**](MsgApi.md#msgBroadcastPost) | **POST** /msg/broadcast | Invio messaggio in broadcast a tutti coloro che hanno preferito la pagina
[**msgBroadcastTitleGet**](MsgApi.md#msgBroadcastTitleGet) | **GET** /msg/broadcast/{title} | Lista dei messaggi di broadcast inviati dall'utente
[**msgIdChatGet**](MsgApi.md#msgIdChatGet) | **GET** /msg/{idChat} | Lista dei messaggi di una conversazione dell'utente
[**msgUnreadGet**](MsgApi.md#msgUnreadGet) | **GET** /msg/unread | Numero di messaggi non letti
[**route34**](MsgApi.md#route34) | **PUT** /msg/ | Marca messaggio come gia' letto da parte dell'utente
[**route35**](MsgApi.md#route35) | **DELETE** /msg/{idChat} | Rimuove una conversazione
[**route36**](MsgApi.md#route36) | **POST** /msg/ | Invio messaggio da parte dell'utente
[**route37**](MsgApi.md#route37) | **GET** /msg/ | Lista delle conversazioni dell'utente


<a name="msgBroadcastPost"></a>
# **msgBroadcastPost**
> MsgResult msgBroadcastPost(body)

Invio messaggio in broadcast a tutti coloro che hanno preferito la pagina

### Example
```javascript
var BuyBorghiMobileServices = require('buy_borghi_mobile_services');

var apiInstance = new BuyBorghiMobileServices.MsgApi();

var body = new BuyBorghiMobileServices.Message(); // Message | TEXT: 'testo da inviare' | FROM: 'nomePagina'


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**Message**](Message.md)| TEXT: 'testo da inviare' | FROM: 'nomePagina' | 

### Return type

[**MsgResult**](MsgResult.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="msgBroadcastTitleGet"></a>
# **msgBroadcastTitleGet**
> MsgResult msgBroadcastTitleGet(title, opts)

Lista dei messaggi di broadcast inviati dall'utente

### Example
```javascript
var BuyBorghiMobileServices = require('buy_borghi_mobile_services');

var apiInstance = new BuyBorghiMobileServices.MsgApi();

var title = "title_example"; // String | Titolo della pagina da cui i messaggi di broadcast sono stati inviati

var opts = { 
  'limit': "limit_example", // String | Limite risultati per pagina (default 10)
  'off': "off_example" // String | Offset
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **title** | **String**| Titolo della pagina da cui i messaggi di broadcast sono stati inviati | 
 **limit** | **String**| Limite risultati per pagina (default 10) | [optional] 
 **off** | **String**| Offset | [optional] 

### Return type

[**MsgResult**](MsgResult.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="msgIdChatGet"></a>
# **msgIdChatGet**
> MessageResp msgIdChatGet(idChat, opts)

Lista dei messaggi di una conversazione dell'utente

### Example
```javascript
var BuyBorghiMobileServices = require('buy_borghi_mobile_services');

var apiInstance = new BuyBorghiMobileServices.MsgApi();

var idChat = "idChat_example"; // String | Ricerca per identificativo della conversazione: 3 lettere + 32 cifre esadecimali (da 0 a f) generato dal client nella POST msg

var opts = { 
  'limit': "limit_example", // String | Limite risultati per pagina (default 10)
  'off': "off_example", // String | Offset
  'timestamp': "timestamp_example" // String | Tutti i messaggi scambiati nella chat dopo un determinato timestamp
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **idChat** | **String**| Ricerca per identificativo della conversazione: 3 lettere + 32 cifre esadecimali (da 0 a f) generato dal client nella POST msg | 
 **limit** | **String**| Limite risultati per pagina (default 10) | [optional] 
 **off** | **String**| Offset | [optional] 
 **timestamp** | **String**| Tutti i messaggi scambiati nella chat dopo un determinato timestamp | [optional] 

### Return type

[**MessageResp**](MessageResp.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="msgUnreadGet"></a>
# **msgUnreadGet**
> MsgResult msgUnreadGet(opts)

Numero di messaggi non letti

### Example
```javascript
var BuyBorghiMobileServices = require('buy_borghi_mobile_services');

var apiInstance = new BuyBorghiMobileServices.MsgApi();

var opts = { 
  'from': "from_example" // String | Numero di messaggi non letti per l'utente loggato o per una delle pagine che l'utente loggato gestisce.FILTER: 'Utente:nomeUtente' o 'nomePagina'
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **from** | **String**| Numero di messaggi non letti per l'utente loggato o per una delle pagine che l'utente loggato gestisce.FILTER: 'Utente:nomeUtente' o 'nomePagina' | [optional] 

### Return type

[**MsgResult**](MsgResult.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="route34"></a>
# **route34**
> MessageResp route34(body)

Marca messaggio come gia' letto da parte dell'utente

### Example
```javascript
var BuyBorghiMobileServices = require('buy_borghi_mobile_services');

var apiInstance = new BuyBorghiMobileServices.MsgApi();

var body = new BuyBorghiMobileServices.ReadMsg(); // ReadMsg | TIMESTAMP: 'numerico che identifica univocamente il messaggio (ricavato dalla GET msg)'  | TEXT: 'testo del messaggio da marcare come letto'


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**ReadMsg**](ReadMsg.md)| TIMESTAMP: 'numerico che identifica univocamente il messaggio (ricavato dalla GET msg)'  | TEXT: 'testo del messaggio da marcare come letto' | 

### Return type

[**MessageResp**](MessageResp.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="route35"></a>
# **route35**
> SearchResult route35(idChat, body)

Rimuove una conversazione

### Example
```javascript
var BuyBorghiMobileServices = require('buy_borghi_mobile_services');

var apiInstance = new BuyBorghiMobileServices.MsgApi();

var idChat = "idChat_example"; // String | Ricerca per identificativo della conversazione: 3 lettere + 32 cifre esadecimali (da 0 a f) generato dal client nella POST msg

var body = new BuyBorghiMobileServices.RemoveMsg(); // RemoveMsg | 


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **idChat** | **String**| Ricerca per identificativo della conversazione: 3 lettere + 32 cifre esadecimali (da 0 a f) generato dal client nella POST msg | 
 **body** | [**RemoveMsg**](RemoveMsg.md)|  | 

### Return type

[**SearchResult**](SearchResult.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="route36"></a>
# **route36**
> SearchResult route36(body)

Invio messaggio da parte dell'utente

### Example
```javascript
var BuyBorghiMobileServices = require('buy_borghi_mobile_services');

var apiInstance = new BuyBorghiMobileServices.MsgApi();

var body = new BuyBorghiMobileServices.Message(); // Message | TEXT: 'testo da inviare' | FROM: 'nomeUtente' o 'nomePagina' | TO: 'Utente:nomeUtente' o 'nomePagina' | IDCHAT: '3 lettere + 32 cifre esadecimali (da 0 a f) generato dal client'


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**Message**](Message.md)| TEXT: 'testo da inviare' | FROM: 'nomeUtente' o 'nomePagina' | TO: 'Utente:nomeUtente' o 'nomePagina' | IDCHAT: '3 lettere + 32 cifre esadecimali (da 0 a f) generato dal client' | 

### Return type

[**SearchResult**](SearchResult.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="route37"></a>
# **route37**
> MessageResp route37(opts)

Lista delle conversazioni dell'utente

### Example
```javascript
var BuyBorghiMobileServices = require('buy_borghi_mobile_services');

var apiInstance = new BuyBorghiMobileServices.MsgApi();

var opts = { 
  'limit': "limit_example", // String | Limite risultati per pagina (default 10)
  'off': "off_example", // String | Offset
  'filter': "filter_example" // String | Elenco conversazioni per l'utente loggato o per una delle pagine che l'utente loggato gestisce.Non considerato se idChat valorizzato. | FILTER: 'Utente:nomeUtente' o 'nomePagina'
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **limit** | **String**| Limite risultati per pagina (default 10) | [optional] 
 **off** | **String**| Offset | [optional] 
 **filter** | **String**| Elenco conversazioni per l'utente loggato o per una delle pagine che l'utente loggato gestisce.Non considerato se idChat valorizzato. | FILTER: 'Utente:nomeUtente' o 'nomePagina' | [optional] 

### Return type

[**MessageResp**](MessageResp.md)

### Authorization

No authorization required

### HTTP request headers

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

