# Newsletter2GoApi(https:ApiNewsletter2goCom).ListApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**createList**](ListApi.md#createList) | **POST** /lists | creates a new list
[**deleteList**](ListApi.md#deleteList) | **DELETE** /lists/{id} | delete the List
[**getLists**](ListApi.md#getLists) | **GET** /lists | get all lists
[**getRecipients**](ListApi.md#getRecipients) | **GET** /lists/{lid}/recipients | get all Recipients of selected list
[**removeRecipientsFromList**](ListApi.md#removeRecipientsFromList) | **DELETE** /lists/{lid}/recipients | remove all Recipients from selected list
[**updateList**](ListApi.md#updateList) | **PATCH** /lists/{id} | update the List
[**updateRecipients**](ListApi.md#updateRecipients) | **PATCH** /lists/{lid}/recipients | update all Recipients in selected list


<a name="createList"></a>
# **createList**
> ApiResponsePost createList(list)

creates a new list

creates a new List

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

var list = new Newsletter2GoApi(https:ApiNewsletter2goCom).ListPost(); // ListPost | 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.createList(list, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **list** | [**ListPost**](ListPost.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="deleteList"></a>
# **deleteList**
> ApiResponseDelete deleteList(id)

delete the List

delete one List

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

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


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

### Parameters

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

### Return type

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

### Authorization

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

### HTTP request headers

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

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

get all lists

get Lists

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

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **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

[**ListResponse**](ListResponse.md)

### Authorization

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

### HTTP request headers

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

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

get all Recipients of selected list

Get Recipients. If the API shall return custom attributes also, submit them in the _fields-Parameter by name.

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

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

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

### Authorization

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

### HTTP request headers

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

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

remove all Recipients from selected list

remove Recipients from selected list. Pay attention to the filter, if you forget to submit it, all recipients of the current list are getting removed!

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

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

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **lid** | **String**| the id of the list | 
 **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="updateList"></a>
# **updateList**
> PatchResponse updateList(id, list)

update the List

update one List

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

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

var list = new Newsletter2GoApi(https:ApiNewsletter2goCom).ListPost(); // ListPost | 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.updateList(id, list, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| the id of the list | 
 **list** | [**ListPost**](ListPost.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

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

update all Recipients in selected list

Updates all recipients in the given list where the filter applies. If a value of a custom attribute shall by changed just submit it in the json body. Pay attention to the filter, if you forget to submit it, all recipients of the current list are getting updated!

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

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

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **lid** | **String**| the id of the list | 
 **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

