# Newsletter2GoApi(https:ApiNewsletter2goCom).AttributeApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**createAttribute**](AttributeApi.md#createAttribute) | **POST** /attributes | creates a new attribute
[**deleteAttribute**](AttributeApi.md#deleteAttribute) | **DELETE** /lists/{lid}/attributes/{id} | delete the attribute
[**getAttributes**](AttributeApi.md#getAttributes) | **GET** /lists/{lid}/attributes | get all Attributes of selected list
[**updateAttribute**](AttributeApi.md#updateAttribute) | **PATCH** /attributes/{id} | update the attribute


<a name="createAttribute"></a>
# **createAttribute**
> ApiResponsePost createAttribute(attribute)

creates a new attribute

creates a new attribute.

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

var attribute = new Newsletter2GoApi(https:ApiNewsletter2goCom).AttributePost(); // AttributePost | 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.createAttribute(attribute, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **attribute** | [**AttributePost**](AttributePost.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="deleteAttribute"></a>
# **deleteAttribute**
> ApiResponseDelete deleteAttribute(lid, id)

delete the attribute

delete one attribute

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

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

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


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

### Parameters

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

### Return type

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

### Authorization

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

### HTTP request headers

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

<a name="getAttributes"></a>
# **getAttributes**
> AttributeResponse getAttributes(lid, opts)

get all Attributes of selected list

get Attributes

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

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

[**AttributeResponse**](AttributeResponse.md)

### Authorization

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

### HTTP request headers

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

<a name="updateAttribute"></a>
# **updateAttribute**
> PatchResponse updateAttribute(id, attribute)

update the attribute

update one attribute

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

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

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

### Parameters

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

