# HivelocityApi.WebhookApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**deleteWebhookIdResource**](WebhookApi.md#deleteWebhookIdResource) | **DELETE** /webhooks/{webhookId} | Deletes a single webhook
[**getWebhookEventResource**](WebhookApi.md#getWebhookEventResource) | **GET** /webhooks/events | Returns all available Webhook Events
[**getWebhookIdResource**](WebhookApi.md#getWebhookIdResource) | **GET** /webhooks/{webhookId} | Returns detailed information for a Single Webhook
[**getWebhookResource**](WebhookApi.md#getWebhookResource) | **GET** /webhooks/ | Returns your active Webhooks
[**postEventScriptActionTriggerResource**](WebhookApi.md#postEventScriptActionTriggerResource) | **POST** /webhooks/trigger | Queues a webhook for the event script action that was triggered
[**postWebhookResource**](WebhookApi.md#postWebhookResource) | **POST** /webhooks/ | Create a new Webhook for a Webhook Event
[**putWebhookIdResource**](WebhookApi.md#putWebhookIdResource) | **PUT** /webhooks/{webhookId} | Updates a Single Webhook


<a name="deleteWebhookIdResource"></a>
# **deleteWebhookIdResource**
> deleteWebhookIdResource(webhookId)

Deletes a single webhook

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

var webhookId = 56; // Number | ID of Webhook to View / Update


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **webhookId** | **Number**| ID of Webhook to View / Update | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="getWebhookEventResource"></a>
# **getWebhookEventResource**
> [WebhookEvent] getWebhookEventResource(opts)

Returns all available Webhook Events

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

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

### Parameters

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

### Return type

[**[WebhookEvent]**](WebhookEvent.md)

### Authorization

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

### HTTP request headers

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

<a name="getWebhookIdResource"></a>
# **getWebhookIdResource**
> Webhook getWebhookIdResource(webhookId, opts)

Returns detailed information for a Single Webhook

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

var webhookId = 56; // Number | ID of Webhook to View / Update

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **webhookId** | **Number**| ID of Webhook to View / Update | 
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**Webhook**](Webhook.md)

### Authorization

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

### HTTP request headers

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

<a name="getWebhookResource"></a>
# **getWebhookResource**
> [Webhook] getWebhookResource(opts)

Returns your active Webhooks

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

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

### Parameters

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

### Return type

[**[Webhook]**](Webhook.md)

### Authorization

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

### HTTP request headers

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

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

Queues a webhook for the event script action that was triggered

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

var opts = { 
  'webhookName': "webhookName_example" // String | The name of the webhook to trigger.
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **webhookName** | **String**| The name of the webhook to trigger. | [optional] 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="postWebhookResource"></a>
# **postWebhookResource**
> Webhook postWebhookResource(payload, opts)

Create a new Webhook for a Webhook Event

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

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

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

### Parameters

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

### Return type

[**Webhook**](Webhook.md)

### Authorization

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

### HTTP request headers

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

<a name="putWebhookIdResource"></a>
# **putWebhookIdResource**
> Webhook putWebhookIdResource(webhookIdpayload, opts)

Updates a Single Webhook

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

var webhookId = 56; // Number | ID of Webhook to View / Update

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

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **webhookId** | **Number**| ID of Webhook to View / Update | 
 **payload** | [**WebhookUpdate**](WebhookUpdate.md)|  | 
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**Webhook**](Webhook.md)

### Authorization

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

### HTTP request headers

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

