# HivelocityApi.TicketApi

All URIs are relative to *https://localhost/api/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
[**getTicketIdResource**](TicketApi.md#getTicketIdResource) | **GET** /tickets/{ticketId} | Returns details of a specific ticket
[**getTicketReplyResource**](TicketApi.md#getTicketReplyResource) | **GET** /tickets/{ticketId}/reply | Returns a reply for a specific ticket
[**getTicketResource**](TicketApi.md#getTicketResource) | **GET** /tickets/ | Returns a list with all Tickets
[**getTicketSearchResource**](TicketApi.md#getTicketSearchResource) | **GET** /tickets/search | Return results of ticket search
[**postTicketReplyResource**](TicketApi.md#postTicketReplyResource) | **POST** /tickets/{ticketId}/reply | Creates reply for a specific Ticket
[**postTicketResource**](TicketApi.md#postTicketResource) | **POST** /tickets/ | Creates a new ticket
[**putTicketIdResource**](TicketApi.md#putTicketIdResource) | **PUT** /tickets/{ticketId} | Updates a specific ticket


<a name="getTicketIdResource"></a>
# **getTicketIdResource**
> Ticket getTicketIdResource(ticketId, , opts)

Returns details of a specific ticket

### Example
```javascript
var HivelocityApi = require('hivelocity_api');
var defaultClient = HivelocityApi.ApiClient.instance;

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

var apiInstance = new HivelocityApi.TicketApi();

var ticketId = 56; // Number | ticket database ID

var opts = { 
  'xFields': "xFields_example" // String | An optional fields mask
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **ticketId** | **Number**| ticket database ID | 
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**Ticket**](Ticket.md)

### Authorization

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

### HTTP request headers

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

<a name="getTicketReplyResource"></a>
# **getTicketReplyResource**
> [TicketPost] getTicketReplyResource(ticketId, , opts)

Returns a reply for a specific ticket

### Example
```javascript
var HivelocityApi = require('hivelocity_api');
var defaultClient = HivelocityApi.ApiClient.instance;

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

var apiInstance = new HivelocityApi.TicketApi();

var ticketId = 56; // Number | ticket database ID

var opts = { 
  'xFields': "xFields_example" // String | An optional fields mask
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **ticketId** | **Number**| ticket database ID | 
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**[TicketPost]**](TicketPost.md)

### Authorization

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

### HTTP request headers

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

<a name="getTicketResource"></a>
# **getTicketResource**
> [Ticket] getTicketResource(opts)

Returns a list with all Tickets

### Example
```javascript
var HivelocityApi = require('hivelocity_api');
var defaultClient = HivelocityApi.ApiClient.instance;

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

var apiInstance = new HivelocityApi.TicketApi();

var opts = { 
  'xFields': "xFields_example" // String | An optional fields mask
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**[Ticket]**](Ticket.md)

### Authorization

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

### HTTP request headers

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

<a name="getTicketSearchResource"></a>
# **getTicketSearchResource**
> TicketSeachResult getTicketSearchResource(opts)

Return results of ticket search

### Example
```javascript
var HivelocityApi = require('hivelocity_api');
var defaultClient = HivelocityApi.ApiClient.instance;

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

var apiInstance = new HivelocityApi.TicketApi();

var opts = { 
  'perPage': 10, // Number | Number of items per page.
  'page': 1, // Number | The page number of search.
  'q': "q_example", // String | Content search.
  'xFields': "xFields_example" // String | An optional fields mask
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **perPage** | **Number**| Number of items per page. | [optional] [default to 10]
 **page** | **Number**| The page number of search. | [optional] [default to 1]
 **q** | **String**| Content search. | [optional] 
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**TicketSeachResult**](TicketSeachResult.md)

### Authorization

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

### HTTP request headers

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

<a name="postTicketReplyResource"></a>
# **postTicketReplyResource**
> TicketPost postTicketReplyResource(ticketId, payload, opts)

Creates reply for a specific Ticket

### Example
```javascript
var HivelocityApi = require('hivelocity_api');
var defaultClient = HivelocityApi.ApiClient.instance;

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

var apiInstance = new HivelocityApi.TicketApi();

var ticketId = 56; // Number | ticket database ID

var payload = new HivelocityApi.TicketCreateReply(); // TicketCreateReply | 

var opts = { 
  'xFields': "xFields_example" // String | An optional fields mask
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **ticketId** | **Number**| ticket database ID | 
 **payload** | [**TicketCreateReply**](TicketCreateReply.md)|  | 
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**TicketPost**](TicketPost.md)

### Authorization

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

### HTTP request headers

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

<a name="postTicketResource"></a>
# **postTicketResource**
> Ticket postTicketResource(payload, opts)

Creates a new ticket

### Example
```javascript
var HivelocityApi = require('hivelocity_api');
var defaultClient = HivelocityApi.ApiClient.instance;

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

var apiInstance = new HivelocityApi.TicketApi();

var payload = new HivelocityApi.TicketCreate(); // TicketCreate | 

var opts = { 
  'xFields': "xFields_example" // String | An optional fields mask
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **payload** | [**TicketCreate**](TicketCreate.md)|  | 
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**Ticket**](Ticket.md)

### Authorization

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

### HTTP request headers

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

<a name="putTicketIdResource"></a>
# **putTicketIdResource**
> Ticket putTicketIdResource(ticketId, payload, opts)

Updates a specific ticket

### Example
```javascript
var HivelocityApi = require('hivelocity_api');
var defaultClient = HivelocityApi.ApiClient.instance;

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

var apiInstance = new HivelocityApi.TicketApi();

var ticketId = 56; // Number | ticket database ID

var payload = new HivelocityApi.TicketPut(); // TicketPut | 

var opts = { 
  'xFields': "xFields_example" // String | An optional fields mask
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **ticketId** | **Number**| ticket database ID | 
 **payload** | [**TicketPut**](TicketPut.md)|  | 
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**Ticket**](Ticket.md)

### Authorization

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

### HTTP request headers

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

