# HivelocityApi.TokenApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**deleteTokenIdResource**](TokenApi.md#deleteTokenIdResource) | **DELETE** /token/{token} | Deletes the Public API Token
[**getTokenIdResource**](TokenApi.md#getTokenIdResource) | **GET** /token/{token} | Returns Public API Token
[**getTokenResource**](TokenApi.md#getTokenResource) | **GET** /token/ | Returns a list of Public API Tokens for the current user
[**postTokenResource**](TokenApi.md#postTokenResource) | **POST** /token/ | Create a new Public API Token for the current user
[**putTokenIdResource**](TokenApi.md#putTokenIdResource) | **PUT** /token/{token} | Updates the Public API Token


<a name="deleteTokenIdResource"></a>
# **deleteTokenIdResource**
> deleteTokenIdResource(token)

Deletes the Public API 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.TokenApi();

var token = "token_example"; // String | Public API Token


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **token** | **String**| Public API Token | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="getTokenIdResource"></a>
# **getTokenIdResource**
> PublicApiTokenDump getTokenIdResource(token, opts)

Returns Public API 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.TokenApi();

var token = "token_example"; // String | Public API Token

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **token** | **String**| Public API Token | 
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**PublicApiTokenDump**](PublicApiTokenDump.md)

### Authorization

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

### HTTP request headers

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

<a name="getTokenResource"></a>
# **getTokenResource**
> [PublicApiTokenDump] getTokenResource(opts)

Returns a list of Public API Tokens for the current user

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

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

### Parameters

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

### Return type

[**[PublicApiTokenDump]**](PublicApiTokenDump.md)

### Authorization

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

### HTTP request headers

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

<a name="postTokenResource"></a>
# **postTokenResource**
> PublicApiTokenDump postTokenResource(payload, opts)

Create a new Public API Token for the current user

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

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

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

### Parameters

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

### Return type

[**PublicApiTokenDump**](PublicApiTokenDump.md)

### Authorization

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

### HTTP request headers

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

<a name="putTokenIdResource"></a>
# **putTokenIdResource**
> PublicApiTokenDump putTokenIdResource(tokenpayload, opts)

Updates the Public API 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.TokenApi();

var token = "token_example"; // String | Public API Token

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

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **token** | **String**| Public API Token | 
 **payload** | [**PublicApiTokenLoad**](PublicApiTokenLoad.md)|  | 
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**PublicApiTokenDump**](PublicApiTokenDump.md)

### Authorization

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

### HTTP request headers

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

