# HivelocityApi.ContactApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**deleteContactIdResource**](ContactApi.md#deleteContactIdResource) | **DELETE** /contact/{contactId} | Delete a Contact
[**getContactIdResource**](ContactApi.md#getContactIdResource) | **GET** /contact/{contactId} | Return details of a specific Contact
[**getContactResource**](ContactApi.md#getContactResource) | **GET** /contact/ | Return a list with all Contacts
[**postContactResource**](ContactApi.md#postContactResource) | **POST** /contact/ | Create a new Contact
[**postPasswordReset**](ContactApi.md#postPasswordReset) | **POST** /contact/password | Recieve a request to reset password, and send a link by email with token
[**putContactIdResource**](ContactApi.md#putContactIdResource) | **PUT** /contact/{contactId} | Edit a Contact
[**putPasswordReset**](ContactApi.md#putPasswordReset) | **PUT** /contact/password | Recieve a token and password, verify the user and reset your password
[**putPasswordResource**](ContactApi.md#putPasswordResource) | **PUT** /contact/{contactId}/password | Change password for a Contact


<a name="deleteContactIdResource"></a>
# **deleteContactIdResource**
> deleteContactIdResource(contactId)

Delete a Contact

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

var contactId = 56; // Number | ID of Contact to View / Update


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **contactId** | **Number**| ID of Contact 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="getContactIdResource"></a>
# **getContactIdResource**
> ContactDump getContactIdResource(contactId, opts)

Return details of a specific Contact

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

var contactId = 56; // Number | ID of Contact 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.getContactIdResource(contactId, opts, callback);
```

### Parameters

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

### Return type

[**ContactDump**](ContactDump.md)

### Authorization

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

### HTTP request headers

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

<a name="getContactResource"></a>
# **getContactResource**
> [ContactDump] getContactResource(opts)

Return a list with all Contacts

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

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

### Parameters

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

### Return type

[**[ContactDump]**](ContactDump.md)

### Authorization

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

### HTTP request headers

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

<a name="postContactResource"></a>
# **postContactResource**
> ContactDump postContactResource(payload, opts)

Create a new Contact

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

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

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

### Parameters

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

### Return type

[**ContactDump**](ContactDump.md)

### Authorization

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

### HTTP request headers

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

<a name="postPasswordReset"></a>
# **postPasswordReset**
> postPasswordReset(payload)

Recieve a request to reset password, and send a link by email with token

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

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


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **payload** | [**PasswordRequest**](PasswordRequest.md)|  | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="putContactIdResource"></a>
# **putContactIdResource**
> ContactDump putContactIdResource(contactIdpayload, opts)

Edit a Contact

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

var contactId = 56; // Number | ID of Contact to View / Update

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

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

### Parameters

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

### Return type

[**ContactDump**](ContactDump.md)

### Authorization

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

### HTTP request headers

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

<a name="putPasswordReset"></a>
# **putPasswordReset**
> putPasswordReset(payload)

Recieve a token and password, verify the user and reset your password

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

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


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **payload** | [**PasswordResponse**](PasswordResponse.md)|  | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="putPasswordResource"></a>
# **putPasswordResource**
> putPasswordResource(contactId, payload)

Change password for a Contact

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

var contactId = 56; // Number | \"ID of Contact to change password\"

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


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **contactId** | **Number**| \"ID of Contact to change password\" | 
 **payload** | [**Password**](Password.md)|  | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

