# Nr1CatalogApp.CategoryNodesApi

All URIs are relative to *http://api.ncr.com/catalog/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
[**categoryNodesFindAncestors**](CategoryNodesApi.md#categoryNodesFindAncestors) | **GET** /category-nodes/{nodeId}/ancestors | Retrieve ancestry information by the specified category node
[**categoryNodesFindByParent**](CategoryNodesApi.md#categoryNodesFindByParent) | **GET** /category-nodes | Retrieve active category node documents by the specified search criteria.
[**categoryNodesFindSuggestions**](CategoryNodesApi.md#categoryNodesFindSuggestions) | **GET** /category-nodes/suggestions | Retrieve Category suggestions by the specified search criteria.
[**categoryNodesGet**](CategoryNodesApi.md#categoryNodesGet) | **GET** /category-nodes/{nodeId} | Retrieve a category node document by the resource identifier.
[**categoryNodesGetNodeSnapshot**](CategoryNodesApi.md#categoryNodesGetNodeSnapshot) | **GET** /category-nodes/{nodeId}/snapshot | Get the snapshot for the specified parent node based on the provided client snapshot version.
[**categoryNodesGetSnapshot**](CategoryNodesApi.md#categoryNodesGetSnapshot) | **GET** /category-nodes/snapshot | Get the snapshot based on the provided client snapshot version.
[**categoryNodesSaveMultiple**](CategoryNodesApi.md#categoryNodesSaveMultiple) | **PUT** /category-nodes | Creates/Updates multiple category node documents.


<a name="categoryNodesFindAncestors"></a>
# **categoryNodesFindAncestors**
> FindNodesListResponse categoryNodesFindAncestors(nodeId, opts)

Retrieve ancestry information by the specified category node

This API retrieves ancestry information for the specified <b>nodeId</b>.<br/><p><h3>Input parameter:- </h3> <code>nodeId:</code> Node identifier for which the ancestry must be returned.<br/><br/><h3>Returns:</h3> A snapshot that matches the request parameters (e.g. all category nodes modified since the submitted client version).</p>

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.CategoryNodesApi();

var nodeId = "nodeId_example"; // String | A unique code which is used to identify a node in hierarchy.

var opts = { 
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **nodeId** | **String**| A unique code which is used to identify a node in hierarchy. | 
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

[**FindNodesListResponse**](FindNodesListResponse.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

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

Retrieve active category node documents by the specified search criteria.

This API retrieves ACTIVE category-node documents by <b>parentId</b> passed as a query parameter. <br/><p><h3>Input parameter:- </h3> <code>request:</code> Object containing the parent identifier to search by.<br/><br/><h3>Returns:</h3> A page of node objects matching the given search criteria (may be empty).

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.CategoryNodesApi();

var opts = { 
  'pageNumber': 0, // Number | The requested page number (starting from zero)
  'pageSize': 200, // Number | The page size
  'parentId': "parentId_example", // String | Parent code of the node to search by. If empty, root nodes are returned.
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **pageNumber** | **Number**| The requested page number (starting from zero) | [optional] [default to 0]
 **pageSize** | **Number**| The page size | [optional] [default to 200]
 **parentId** | **String**| Parent code of the node to search by. If empty, root nodes are returned. | [optional] 
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

[**FindNodesResponse**](FindNodesResponse.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

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

Retrieve Category suggestions by the specified search criteria.

<p>This API retrieves suggestions that fit the provided search criteria. In this case patterns are not mapped directly to specific fields, but rather apply to the several fields that may match the pattern. <br/>The search criteria is passed as a query parameter with the API request. If nodeCodePattern or titlePattern parameters are used, they will be applied as <b>a logical disjunction (OR) operation.</b> If tag or includeAncestors parameters are used, they will be applied <b>a logical conjunction (AND) operation.</b></p><p><h3>Input parameter:- </h3> <code>request:</code> A set of suggestions search criteria.<br/><h3>Returns:</h3>A page of catalog Category objects that match the specified search criteria. </p>

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.CategoryNodesApi();

var opts = { 
  'pageNumber': 0, // Number | The requested page number (starting from zero)
  'pageSize': 200, // Number | The page size
  'nodeCodePattern': "nodeCodePattern_example", // String | Node Code pattern to use for suggestions (standard wildcard matching rules apply).
  'titlePattern': "titlePattern_example", // String | Title pattern to use for suggestions (standard wildcard matching rules apply).
  'tag': "tag_example", // String | Tag to use for suggestions.
  'includeAncestors': false, // Boolean | Indicates whether to include ancestors for suggestions or not. If true, includes all ancestors for each node.
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **pageNumber** | **Number**| The requested page number (starting from zero) | [optional] [default to 0]
 **pageSize** | **Number**| The page size | [optional] [default to 200]
 **nodeCodePattern** | **String**| Node Code pattern to use for suggestions (standard wildcard matching rules apply). | [optional] 
 **titlePattern** | **String**| Title pattern to use for suggestions (standard wildcard matching rules apply). | [optional] 
 **tag** | **String**| Tag to use for suggestions. | [optional] 
 **includeAncestors** | **Boolean**| Indicates whether to include ancestors for suggestions or not. If true, includes all ancestors for each node. | [optional] [default to false]
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

[**FindCategorySuggestionsResponse**](FindCategorySuggestionsResponse.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="categoryNodesGet"></a>
# **categoryNodesGet**
> NodeViewData categoryNodesGet(nodeId, opts)

Retrieve a category node document by the resource identifier.

<p>This API retrieves a complete category-node document for the requested <b>nodeId</b>.<br/></p><p><h3>Input parameter:- </h3> <code>nodeId:</code> Identifier of the node to retrieve.<br/><br/><h3>Returns:</h3> All fields of a category node, including read-only system generated/assigned fields.</p>

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.CategoryNodesApi();

var nodeId = "nodeId_example"; // String | A unique code which is used to identify a node in hierarchy.

var opts = { 
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **nodeId** | **String**| A unique code which is used to identify a node in hierarchy. | 
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

[**NodeViewData**](NodeViewData.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="categoryNodesGetNodeSnapshot"></a>
# **categoryNodesGetNodeSnapshot**
> GetNodesSnapshotResponse categoryNodesGetNodeSnapshot(nodeId, opts)

Get the snapshot for the specified parent node based on the provided client snapshot version.

<p>This API retrieves a snapshot for a particular parent/root node, for example, getting a full snapshot just the \"primary\" (or \"merchandise\") hierarchy, which is identified as a \"primary\" node id. Results are filterable by <i>STATUS</i> using the query parameter <code>status=<i>desiredResourceStatus</i></code>.<br/></p><p><h3>Input parameter:- </h3> <code>request:</code> Snapshot request containing snapshotVersion.<br/><h3>Returns:</h3> Object with all of the fields of a category node, including read-only system generated/assigned fields.<br/><br/></p><p><b>If the the result payload exceeds maximum size (generally around 10K records), the document synchronization cannot be accomplished using APIs. The client should wait a few moments for the file to be available at the provided URI in the details.</b></p>

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.CategoryNodesApi();

var nodeId = "nodeId_example"; // String | Snapshot response will be limited to the hierarchy that starts with the specified node. This allows to get updates only for a specific hierarchy, for example only for \"primary\" hierarchy (which maps to \"merchandise\" for retail).

var opts = { 
  'nepEnterpriseUnit': "nepEnterpriseUnit_example", // String | Enterprise unit id.
  'nepSnapshotVersion': 789, // Number | Version of the client state. This attribute will be used by the back-end to identify the snapshot that should be generated per client. In a simple case, the version is a timestamp (epoch time in millis) and the generated snapshot will contain all documents modified since the provided timestamp.
  'status': "status_example", // String | Flag to filter just one status type.
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **nodeId** | **String**| Snapshot response will be limited to the hierarchy that starts with the specified node. This allows to get updates only for a specific hierarchy, for example only for \"primary\" hierarchy (which maps to \"merchandise\" for retail). | 
 **nepEnterpriseUnit** | **String**| Enterprise unit id. | [optional] 
 **nepSnapshotVersion** | **Number**| Version of the client state. This attribute will be used by the back-end to identify the snapshot that should be generated per client. In a simple case, the version is a timestamp (epoch time in millis) and the generated snapshot will contain all documents modified since the provided timestamp. | [optional] 
 **status** | **String**| Flag to filter just one status type. | [optional] 
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

[**GetNodesSnapshotResponse**](GetNodesSnapshotResponse.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

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

Get the snapshot based on the provided client snapshot version.

<p>A synchronization API that is used to synchronize the category node resource state with the remote client such as POS, Store Server or mobile device. Results are filterable by <i>STATUS</i> using the query parameter <code>status=<i>desiredResourceStatus</i></code>.<br/></p><p><h3>Input parameter:- </h3> request snapshot request containing snapshotVersion.<br/><br/><h3>Returns:</h3> Object with all of the fields of a category node, including read-only system generated/assigned fields.<br/><br/></p><p><b>If the the result payload exceeds maximum size (generally around 10K records), the document synchronization cannot be accomplished using APIs. The client should wait a few moments for the file to be available at the provided URI in the details.</b></p>

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.CategoryNodesApi();

var opts = { 
  'nepEnterpriseUnit': "nepEnterpriseUnit_example", // String | Enterprise unit id.
  'nepSnapshotVersion': 789, // Number | Version of the client state. This attribute will be used by the back-end to identify the snapshot that should be generated per client. In a simple case, the version is a timestamp (epoch time in millis) and the generated snapshot will contain all documents modified since the provided timestamp.
  'status': "status_example", // String | Flag to filter just one status type.
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **nepEnterpriseUnit** | **String**| Enterprise unit id. | [optional] 
 **nepSnapshotVersion** | **Number**| Version of the client state. This attribute will be used by the back-end to identify the snapshot that should be generated per client. In a simple case, the version is a timestamp (epoch time in millis) and the generated snapshot will contain all documents modified since the provided timestamp. | [optional] 
 **status** | **String**| Flag to filter just one status type. | [optional] 
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

[**GetNodesSnapshotResponse**](GetNodesSnapshotResponse.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

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

Creates/Updates multiple category node documents.

<p>This API creates/updates one or more category-node documents, for example the whole branch in the hierarchy or even the whole tree. If the item already exists, the document will be updated only if the version number in the request is greater than the version number of the existing document.</p><p><h3>Input parameter:- </h3> <code>request:</code> Object containing the nodes to save.</p>

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.CategoryNodesApi();

var opts = { 
  'body': new Nr1CatalogApp.SaveMultipleNodesRequest(), // SaveMultipleNodesRequest | 
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**SaveMultipleNodesRequest**](SaveMultipleNodesRequest.md)|  | [optional] 
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

