# BookingHint.MessageApi

All URIs are relative to *http://localhost:8081*

Method | HTTP request | Description
------------- | ------------- | -------------
[**messagesGET**](MessageApi.md#messagesGET) | **GET** /messages | 
[**messagesGenericMessageidGET**](MessageApi.md#messagesGenericMessageidGET) | **GET** /messages/generic/{messageid} | 
[**messagesGenericMessageidPropertykeyPUT**](MessageApi.md#messagesGenericMessageidPropertykeyPUT) | **PUT** /messages/generic/{messageid}/{propertykey} | 
[**messagesSmsPOST**](MessageApi.md#messagesSmsPOST) | **POST** /messages/sms | 


<a name="messagesGET"></a>
# **messagesGET**
> Messages messagesGET(opts)



Get all messages.  Messages are ordered in ascending chronological order. 

### Example
```javascript
var BookingHint = require('booking_hint');
var defaultClient = BookingHint.ApiClient.default;

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

var apiInstance = new BookingHint.MessageApi();

var opts = { 
  'to': 789, // Number | A timestamp representing the earliest instant to return. 
  'from': 789 // Number | A timestamp representing the latest instant to return. 
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **to** | **Number**| A timestamp representing the earliest instant to return.  | [optional] 
 **from** | **Number**| A timestamp representing the latest instant to return.  | [optional] 

### Return type

[**Messages**](Messages.md)

### Authorization

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

### HTTP request headers

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

<a name="messagesGenericMessageidGET"></a>
# **messagesGenericMessageidGET**
> Message messagesGenericMessageidGET(messageid)



Gets a object representing an individual message. 

### Example
```javascript
var BookingHint = require('booking_hint');
var defaultClient = BookingHint.ApiClient.default;

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

var apiInstance = new BookingHint.MessageApi();

var messageid = "messageid_example"; // String | The id of the message we wish to get. 


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **messageid** | **String**| The id of the message we wish to get.  | 

### Return type

[**Message**](Message.md)

### Authorization

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

### HTTP request headers

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

<a name="messagesGenericMessageidPropertykeyPUT"></a>
# **messagesGenericMessageidPropertykeyPUT**
> messagesGenericMessageidPropertykeyPUT(messageid, propertykey, body)



Set the property of a message to a new value.  If the message property is not editable, then it will fail with 400.  If the new value does not pass validation, then it will also fail with 400. 

### Example
```javascript
var BookingHint = require('booking_hint');
var defaultClient = BookingHint.ApiClient.default;

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

var apiInstance = new BookingHint.MessageApi();

var messageid = "messageid_example"; // String | The id of the message we are working with. 

var propertykey = "propertykey_example"; // String | The key we wish to edit. 

var body = null; // Object | Set the property \"value\" to the new value for this. 


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **messageid** | **String**| The id of the message we are working with.  | 
 **propertykey** | **String**| The key we wish to edit.  | 
 **body** | **Object**| Set the property \&quot;value\&quot; to the new value for this.  | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="messagesSmsPOST"></a>
# **messagesSmsPOST**
> Message messagesSmsPOST(body)



Create a new message definition of type SMS.  All fields are required.  The meta field should contain any supporting information, that, for example, will be displayed to the user to confirm information about the message, in order to make better decisions about queueing and message content.  Properties in the meta field will automatically have \&quot;meta_\&quot; prepended to their key, to avoid collisions. 

### Example
```javascript
var BookingHint = require('booking_hint');
var defaultClient = BookingHint.ApiClient.default;

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

var apiInstance = new BookingHint.MessageApi();

var body = new BookingHint.Body1(); // Body1 | The information required to initialize a SMS message. 


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**Body1**](Body1.md)| The information required to initialize a SMS message.  | 

### Return type

[**Message**](Message.md)

### Authorization

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

### HTTP request headers

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

