# Nr1CatalogApp.GroupsApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**groupsFindByCriteria**](GroupsApi.md#groupsFindByCriteria) | **GET** /groups | Retrieve an active group document by the specified search criteria.
[**groupsGet**](GroupsApi.md#groupsGet) | **GET** /groups/{groupCode} | Retrieve a group document based on the provided resource identifier.
[**groupsGetSnapshot**](GroupsApi.md#groupsGetSnapshot) | **GET** /groups/snapshot | Get the snapshot based on the provided client snapshot version.
[**groupsSaveMultiple**](GroupsApi.md#groupsSaveMultiple) | **PUT** /groups | Creates/updates multiple groups for catalog.


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

Retrieve an active group document by the specified search criteria.

<p>This API will fetch group documents matching the specified search criteria. The search criteria is passed as a query parameter with the API request. </br>Fields named \\*Pattern support wild-card characters.<br/></p><p><h3>Input parameter:- </h3> <code>request:</code> A set of criteria to search by.<br/><h3>Returns:</h3> A page of group objects that match the specified search criteria.</p>

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

var apiInstance = new Nr1CatalogApp.GroupsApi();

var opts = { 
  'pageNumber': 0, // Number | The requested page number (starting from zero)
  'pageSize': 200, // Number | The page size
  'titlePattern': "titlePattern_example", // String | Title pattern to filter the search results. May be null, in that case all groups are returned.Fields named '*Pattern' support wild-card characters.<br/>Examples:<ul><li>titlePattern=group1 (exact match),</li> <li>titlePattern=so* (starts with so),</li> <li>titlePattern=*so* (contains so),</li> <li>titlePattern=* (any value)</li></ul>
  '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.groupsFindByCriteria(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]
 **titlePattern** | **String**| Title pattern to filter the search results. May be null, in that case all groups are returned.Fields named '*Pattern' support wild-card characters.<br/>Examples:<ul><li>titlePattern=group1 (exact match),</li> <li>titlePattern=so* (starts with so),</li> <li>titlePattern=*so* (contains so),</li> <li>titlePattern=* (any value)</li></ul> | [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

[**FindGroupsResponse**](FindGroupsResponse.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="groupsGet"></a>
# **groupsGet**
> GroupViewData groupsGet(groupCode, opts)

Retrieve a group document based on the provided resource identifier.

<p>This API retrieves all fields of a catalog group document associated with the specified <b>groupCode</b>.</p><p><h3>Input parameter:- </h3> <code>groupId:</code> Identifier of the group.<br/><h3>Returns:</h3> A complete set of attributes of a single catalog group document, including read-only and system defined fields.</p>

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

var apiInstance = new Nr1CatalogApp.GroupsApi();

var groupCode = "groupCode_example"; // String | Group code that uniquely identifies the group per tenant.

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **groupCode** | **String**| Group code that uniquely identifies the group per tenant. | 
 **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

[**GroupViewData**](GroupViewData.md)

### Authorization

No authorization required

### HTTP request headers

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

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

Get the snapshot based on the provided client snapshot version.

<p>Group document synchronization API that is used to synchronize the 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>.</p><p><h3>Input parameter:- </h3> <code>request:</code> Snapshot request containing snapshotVersion<br/><h3>Returns:</h3> A snapshot that matches the request parameters.(e.g. all groups modified since the submitted client version)<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.GroupsApi();

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.groupsGetSnapshot(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

[**GetGroupsSnapshotResponse**](GetGroupsSnapshotResponse.md)

### Authorization

No authorization required

### HTTP request headers

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

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

Creates/updates multiple groups for catalog.

<p>This API creates/updates one or more groups for catalog. If the group 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 groups to save.</p>

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

var apiInstance = new Nr1CatalogApp.GroupsApi();

var opts = { 
  'body': new Nr1CatalogApp.SaveMultipleGroupsRequest(), // SaveMultipleGroupsRequest | 
  '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.groupsSaveMultiple(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**SaveMultipleGroupsRequest**](SaveMultipleGroupsRequest.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

