# Newsletter2GoApi(https:ApiNewsletter2goCom).GroupApi

All URIs are relative to *https://api.newsletter2go.com*

Method | HTTP request | Description
------------- | ------------- | -------------
[**addRecipientToGroup**](GroupApi.md#addRecipientToGroup) | **POST** /lists/{lid}/groups/{gid}/recipients/{id} | add single recipient to group
[**addRecipientsToGroup**](GroupApi.md#addRecipientsToGroup) | **POST** /lists/{lid}/groups/{gid}/recipients | add all Recipients to the given group
[**createGroup**](GroupApi.md#createGroup) | **POST** /groups | creates a new group
[**deleteGroup**](GroupApi.md#deleteGroup) | **DELETE** /groups/{id} | delete the Group
[**getGroups**](GroupApi.md#getGroups) | **GET** /lists/{lid}/groups | get all Group of selected list
[**getRecipientsByGroup**](GroupApi.md#getRecipientsByGroup) | **GET** /lists/{lid}/groups/{gid}/recipients | get all Recipients of selected group
[**removeRecipientFromGroup**](GroupApi.md#removeRecipientFromGroup) | **DELETE** /lists/{lid}/groups/{gid}/recipients/{id} | remove single recipient from group
[**removeRecipientsFromGroup**](GroupApi.md#removeRecipientsFromGroup) | **DELETE** /lists/{lid}/groups/{gid}/recipients | remove all Recipients from given group
[**updateGroup**](GroupApi.md#updateGroup) | **PATCH** /groups/{id} | update the Group


<a name="addRecipientToGroup"></a>
# **addRecipientToGroup**
> PatchResponse addRecipientToGroup(lid, gid, id)

add single recipient to group

add Recipient to Group

### Example
```javascript
var Newsletter2GoApi(https:ApiNewsletter2goCom) = require('newsletter2-go-api-(https://api/newsletter2go/com)');
var defaultClient = Newsletter2GoApi(https:ApiNewsletter2goCom).ApiClient.default;

// Configure OAuth2 access token for authorization: OAuth
var OAuth = defaultClient.authentications['OAuth'];
OAuth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new Newsletter2GoApi(https:ApiNewsletter2goCom).GroupApi();

var lid = "lid_example"; // String | the id of the list

var gid = "gid_example"; // String | the id of the group

var id = "id_example"; // String | the id of the recipient


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **lid** | **String**| the id of the list | 
 **gid** | **String**| the id of the group | 
 **id** | **String**| the id of the recipient | 

### Return type

[**PatchResponse**](PatchResponse.md)

### Authorization

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

### HTTP request headers

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

<a name="addRecipientsToGroup"></a>
# **addRecipientsToGroup**
> PatchResponse addRecipientsToGroup(lid, gid, opts)

add all Recipients to the given group

add all Recipients to the given group. Pay attention to the filter, if you forget to submit it, all recipients of the current list are getting added to the group!

### Example
```javascript
var Newsletter2GoApi(https:ApiNewsletter2goCom) = require('newsletter2-go-api-(https://api/newsletter2go/com)');
var defaultClient = Newsletter2GoApi(https:ApiNewsletter2goCom).ApiClient.default;

// Configure OAuth2 access token for authorization: OAuth
var OAuth = defaultClient.authentications['OAuth'];
OAuth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new Newsletter2GoApi(https:ApiNewsletter2goCom).GroupApi();

var lid = "lid_example"; // String | the id of the list

var gid = "gid_example"; // String | the id of the group

var opts = { 
  'filter': "filter_example", // String | a FIQL-Filter
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **lid** | **String**| the id of the list | 
 **gid** | **String**| the id of the group | 
 **filter** | **String**| a FIQL-Filter | [optional] 

### Return type

[**PatchResponse**](PatchResponse.md)

### Authorization

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

### HTTP request headers

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

<a name="createGroup"></a>
# **createGroup**
> ApiResponsePost createGroup(group)

creates a new group

creates a new group.

### Example
```javascript
var Newsletter2GoApi(https:ApiNewsletter2goCom) = require('newsletter2-go-api-(https://api/newsletter2go/com)');
var defaultClient = Newsletter2GoApi(https:ApiNewsletter2goCom).ApiClient.default;

// Configure OAuth2 access token for authorization: OAuth
var OAuth = defaultClient.authentications['OAuth'];
OAuth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new Newsletter2GoApi(https:ApiNewsletter2goCom).GroupApi();

var group = new Newsletter2GoApi(https:ApiNewsletter2goCom).GroupPost(); // GroupPost | the data to save


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **group** | [**GroupPost**](GroupPost.md)| the data to save | 

### Return type

[**ApiResponsePost**](ApiResponsePost.md)

### Authorization

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

### HTTP request headers

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

<a name="deleteGroup"></a>
# **deleteGroup**
> ApiResponseDelete deleteGroup(id)

delete the Group

delete one Group

### Example
```javascript
var Newsletter2GoApi(https:ApiNewsletter2goCom) = require('newsletter2-go-api-(https://api/newsletter2go/com)');
var defaultClient = Newsletter2GoApi(https:ApiNewsletter2goCom).ApiClient.default;

// Configure OAuth2 access token for authorization: OAuth
var OAuth = defaultClient.authentications['OAuth'];
OAuth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new Newsletter2GoApi(https:ApiNewsletter2goCom).GroupApi();

var id = "id_example"; // String | the id of the Group


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| the id of the Group | 

### Return type

[**ApiResponseDelete**](ApiResponseDelete.md)

### Authorization

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

### HTTP request headers

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

<a name="getGroups"></a>
# **getGroups**
> GroupResponse getGroups(lid, opts)

get all Group of selected list

get Groups

### Example
```javascript
var Newsletter2GoApi(https:ApiNewsletter2goCom) = require('newsletter2-go-api-(https://api/newsletter2go/com)');
var defaultClient = Newsletter2GoApi(https:ApiNewsletter2goCom).ApiClient.default;

// Configure OAuth2 access token for authorization: OAuth
var OAuth = defaultClient.authentications['OAuth'];
OAuth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new Newsletter2GoApi(https:ApiNewsletter2goCom).GroupApi();

var lid = "lid_example"; // String | the id of the list

var opts = { 
  'filter': "filter_example", // String | a FIQL-Filter
  'limit': 50, // Integer | a limit for list-responses
  'offset': 0, // Integer | an offset for list-responses
  'expand': true, // Boolean | true if attributes should be returned or not
  'fields': ["fields_example"] // [String] | list of case-sensetive fields which should be returned.    Only needed if _expand is false or special attributes are needed
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **lid** | **String**| the id of the list | 
 **filter** | **String**| a FIQL-Filter | [optional] 
 **limit** | **Integer**| a limit for list-responses | [optional] [default to 50]
 **offset** | **Integer**| an offset for list-responses | [optional] [default to 0]
 **expand** | **Boolean**| true if attributes should be returned or not | [optional] 
 **fields** | [**[String]**](String.md)| list of case-sensetive fields which should be returned.    Only needed if _expand is false or special attributes are needed | [optional] 

### Return type

[**GroupResponse**](GroupResponse.md)

### Authorization

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

### HTTP request headers

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

<a name="getRecipientsByGroup"></a>
# **getRecipientsByGroup**
> RecipientResponse getRecipientsByGroup(lid, gid, opts)

get all Recipients of selected group

get Recipients

### Example
```javascript
var Newsletter2GoApi(https:ApiNewsletter2goCom) = require('newsletter2-go-api-(https://api/newsletter2go/com)');
var defaultClient = Newsletter2GoApi(https:ApiNewsletter2goCom).ApiClient.default;

// Configure OAuth2 access token for authorization: OAuth
var OAuth = defaultClient.authentications['OAuth'];
OAuth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new Newsletter2GoApi(https:ApiNewsletter2goCom).GroupApi();

var lid = "lid_example"; // String | the id of the list

var gid = "gid_example"; // String | the id of the group

var opts = { 
  'filter': "filter_example", // String | a FIQL-Filter
  'limit': 50, // Integer | a limit for list-responses
  'offset': 0, // Integer | an offset for list-responses
  'expand': true, // Boolean | true if attributes should be returned or not
  'fields': ["fields_example"] // [String] | list of case-sensetive fields which should be returned.    Only needed if _expand is false or special attributes are needed
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **lid** | **String**| the id of the list | 
 **gid** | **String**| the id of the group | 
 **filter** | **String**| a FIQL-Filter | [optional] 
 **limit** | **Integer**| a limit for list-responses | [optional] [default to 50]
 **offset** | **Integer**| an offset for list-responses | [optional] [default to 0]
 **expand** | **Boolean**| true if attributes should be returned or not | [optional] 
 **fields** | [**[String]**](String.md)| list of case-sensetive fields which should be returned.    Only needed if _expand is false or special attributes are needed | [optional] 

### Return type

[**RecipientResponse**](RecipientResponse.md)

### Authorization

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

### HTTP request headers

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

<a name="removeRecipientFromGroup"></a>
# **removeRecipientFromGroup**
> PatchResponse removeRecipientFromGroup(lid, gid, id)

remove single recipient from group

remove Recipient to Group

### Example
```javascript
var Newsletter2GoApi(https:ApiNewsletter2goCom) = require('newsletter2-go-api-(https://api/newsletter2go/com)');
var defaultClient = Newsletter2GoApi(https:ApiNewsletter2goCom).ApiClient.default;

// Configure OAuth2 access token for authorization: OAuth
var OAuth = defaultClient.authentications['OAuth'];
OAuth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new Newsletter2GoApi(https:ApiNewsletter2goCom).GroupApi();

var lid = "lid_example"; // String | the id of the list

var gid = "gid_example"; // String | the id of the group

var id = "id_example"; // String | the id of the recipient


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **lid** | **String**| the id of the list | 
 **gid** | **String**| the id of the group | 
 **id** | **String**| the id of the recipient | 

### Return type

[**PatchResponse**](PatchResponse.md)

### Authorization

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

### HTTP request headers

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

<a name="removeRecipientsFromGroup"></a>
# **removeRecipientsFromGroup**
> PatchResponse removeRecipientsFromGroup(lid, gid, opts)

remove all Recipients from given group

remove all Recipients from given group. Pay attention to the filter, if you forget to submit it, all recipients are getting removed from the group!

### Example
```javascript
var Newsletter2GoApi(https:ApiNewsletter2goCom) = require('newsletter2-go-api-(https://api/newsletter2go/com)');
var defaultClient = Newsletter2GoApi(https:ApiNewsletter2goCom).ApiClient.default;

// Configure OAuth2 access token for authorization: OAuth
var OAuth = defaultClient.authentications['OAuth'];
OAuth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new Newsletter2GoApi(https:ApiNewsletter2goCom).GroupApi();

var lid = "lid_example"; // String | the id of the list

var gid = "gid_example"; // String | the id of the group

var opts = { 
  'filter': "filter_example", // String | a FIQL-Filter
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **lid** | **String**| the id of the list | 
 **gid** | **String**| the id of the group | 
 **filter** | **String**| a FIQL-Filter | [optional] 

### Return type

[**PatchResponse**](PatchResponse.md)

### Authorization

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

### HTTP request headers

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

<a name="updateGroup"></a>
# **updateGroup**
> PatchResponse updateGroup(id, group)

update the Group

update one Group

### Example
```javascript
var Newsletter2GoApi(https:ApiNewsletter2goCom) = require('newsletter2-go-api-(https://api/newsletter2go/com)');
var defaultClient = Newsletter2GoApi(https:ApiNewsletter2goCom).ApiClient.default;

// Configure OAuth2 access token for authorization: OAuth
var OAuth = defaultClient.authentications['OAuth'];
OAuth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new Newsletter2GoApi(https:ApiNewsletter2goCom).GroupApi();

var id = "id_example"; // String | the id of the Group

var group = new Newsletter2GoApi(https:ApiNewsletter2goCom).GroupPatch(); // GroupPatch | the data to update


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| the id of the Group | 
 **group** | [**GroupPatch**](GroupPatch.md)| the data to update | 

### Return type

[**PatchResponse**](PatchResponse.md)

### Authorization

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

### HTTP request headers

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

