# egoisdk.FieldsApi All URIs are relative to *https://api.egoiapp.com* Method | HTTP request | Description ------------- | ------------- | ------------- [**createExtraField**](FieldsApi.md#createExtraField) | **POST** /lists/{list_id}/fields/extra | Create extra field [**createFieldOption**](FieldsApi.md#createFieldOption) | **POST** /lists/{list_id}/fields/extra/{field_id}/options | Create new field option [**deleteExtraField**](FieldsApi.md#deleteExtraField) | **DELETE** /lists/{list_id}/fields/extra/{field_id} | Remove extra field [**deleteFieldOption**](FieldsApi.md#deleteFieldOption) | **DELETE** /lists/{list_id}/fields/extra/{field_id}/options/{option_id} | Deletes an option [**getAllFieldOptions**](FieldsApi.md#getAllFieldOptions) | **GET** /lists/{list_id}/fields/extra/{field_id}/options | Get all field options [**getAllFields**](FieldsApi.md#getAllFields) | **GET** /lists/{list_id}/fields | Get all fields [**patchBaseField**](FieldsApi.md#patchBaseField) | **PATCH** /lists/{list_id}/fields/base/{field_id} | Update base field [**patchExtraField**](FieldsApi.md#patchExtraField) | **PATCH** /lists/{list_id}/fields/extra/{field_id} | Update extra field [**updateFieldOption**](FieldsApi.md#updateFieldOption) | **PATCH** /lists/{list_id}/fields/extra/{field_id}/options/{option_id} | Update field option ## createExtraField > Field createExtraField(listId, field) Create extra field Creates an extra field ### Example ```javascript import egoisdk from 'egoisdk'; let defaultClient = egoisdk.ApiClient.instance; // Configure API key authorization: Apikey let Apikey = defaultClient.authentications['Apikey']; Apikey.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Apikey.apiKeyPrefix = 'Token'; let apiInstance = new egoisdk.FieldsApi(); let listId = 56; // Number | ID of the List let field = new egoisdk.Field(); // Field | Parameters for the extra field apiInstance.createExtraField(listId, field, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **listId** | **Number**| ID of the List | **field** | [**Field**](Field.md)| Parameters for the extra field | ### Return type [**Field**](Field.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## createFieldOption > FieldOption createFieldOption(listId, fieldId, fieldOptionPost) Create new field option Creates a field option ### Example ```javascript import egoisdk from 'egoisdk'; let defaultClient = egoisdk.ApiClient.instance; // Configure API key authorization: Apikey let Apikey = defaultClient.authentications['Apikey']; Apikey.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Apikey.apiKeyPrefix = 'Token'; let apiInstance = new egoisdk.FieldsApi(); let listId = 56; // Number | ID of the List let fieldId = 56; // Number | ID of the Field let fieldOptionPost = new egoisdk.FieldOptionPost(); // FieldOptionPost | Parameters for the field option apiInstance.createFieldOption(listId, fieldId, fieldOptionPost, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **listId** | **Number**| ID of the List | **fieldId** | **Number**| ID of the Field | **fieldOptionPost** | [**FieldOptionPost**](FieldOptionPost.md)| Parameters for the field option | ### Return type [**FieldOption**](FieldOption.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## deleteExtraField > deleteExtraField(listId, fieldId) Remove extra field Removes an extra field given its ID ### Example ```javascript import egoisdk from 'egoisdk'; let defaultClient = egoisdk.ApiClient.instance; // Configure API key authorization: Apikey let Apikey = defaultClient.authentications['Apikey']; Apikey.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Apikey.apiKeyPrefix = 'Token'; let apiInstance = new egoisdk.FieldsApi(); let listId = 56; // Number | ID of the List let fieldId = 56; // Number | ID of the Field apiInstance.deleteExtraField(listId, fieldId, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully.'); } }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **listId** | **Number**| ID of the List | **fieldId** | **Number**| ID of the Field | ### Return type null (empty response body) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## deleteFieldOption > deleteFieldOption(listId, fieldId, optionId) Deletes an option Deletes an option of a list of values field ### Example ```javascript import egoisdk from 'egoisdk'; let defaultClient = egoisdk.ApiClient.instance; // Configure API key authorization: Apikey let Apikey = defaultClient.authentications['Apikey']; Apikey.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Apikey.apiKeyPrefix = 'Token'; let apiInstance = new egoisdk.FieldsApi(); let listId = 56; // Number | ID of the List let fieldId = 56; // Number | ID of the Field let optionId = 56; // Number | ID of the field option apiInstance.deleteFieldOption(listId, fieldId, optionId, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully.'); } }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **listId** | **Number**| ID of the List | **fieldId** | **Number**| ID of the Field | **optionId** | **Number**| ID of the field option | ### Return type null (empty response body) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## getAllFieldOptions > FieldOptionsCollection getAllFieldOptions(listId, fieldId) Get all field options Returns all options of a given field ### Example ```javascript import egoisdk from 'egoisdk'; let defaultClient = egoisdk.ApiClient.instance; // Configure API key authorization: Apikey let Apikey = defaultClient.authentications['Apikey']; Apikey.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Apikey.apiKeyPrefix = 'Token'; let apiInstance = new egoisdk.FieldsApi(); let listId = 56; // Number | ID of the List let fieldId = 56; // Number | ID of the Field apiInstance.getAllFieldOptions(listId, fieldId, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **listId** | **Number**| ID of the List | **fieldId** | **Number**| ID of the Field | ### Return type [**FieldOptionsCollection**](FieldOptionsCollection.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## getAllFields > [ComplexField] getAllFields(listId, opts) Get all fields Returns all fields ### Example ```javascript import egoisdk from 'egoisdk'; let defaultClient = egoisdk.ApiClient.instance; // Configure API key authorization: Apikey let Apikey = defaultClient.authentications['Apikey']; Apikey.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Apikey.apiKeyPrefix = 'Token'; let apiInstance = new egoisdk.FieldsApi(); let listId = 56; // Number | ID of the List let opts = { 'offset': 56, // Number | Element offset (starting at zero for the first element) 'limit': 10 // Number | Number of items to return }; apiInstance.getAllFields(listId, opts, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **listId** | **Number**| ID of the List | **offset** | **Number**| Element offset (starting at zero for the first element) | [optional] **limit** | **Number**| Number of items to return | [optional] [default to 10] ### Return type [**[ComplexField]**](ComplexField.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## patchBaseField > Field patchBaseField(listId, fieldId, patchRequestBaseField) Update base field Updates a base field ### Example ```javascript import egoisdk from 'egoisdk'; let defaultClient = egoisdk.ApiClient.instance; // Configure API key authorization: Apikey let Apikey = defaultClient.authentications['Apikey']; Apikey.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Apikey.apiKeyPrefix = 'Token'; let apiInstance = new egoisdk.FieldsApi(); let listId = 56; // Number | ID of the List let fieldId = "fieldId_example"; // String | ID of the base field let patchRequestBaseField = new egoisdk.PatchRequestBaseField(); // PatchRequestBaseField | Parameters for the extra field apiInstance.patchBaseField(listId, fieldId, patchRequestBaseField, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **listId** | **Number**| ID of the List | **fieldId** | **String**| ID of the base field | **patchRequestBaseField** | [**PatchRequestBaseField**](PatchRequestBaseField.md)| Parameters for the extra field | ### Return type [**Field**](Field.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## patchExtraField > Field patchExtraField(listId, fieldId, patchRequestField) Update extra field Updates an extra field ### Example ```javascript import egoisdk from 'egoisdk'; let defaultClient = egoisdk.ApiClient.instance; // Configure API key authorization: Apikey let Apikey = defaultClient.authentications['Apikey']; Apikey.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Apikey.apiKeyPrefix = 'Token'; let apiInstance = new egoisdk.FieldsApi(); let listId = 56; // Number | ID of the List let fieldId = 56; // Number | ID of the Field let patchRequestField = new egoisdk.PatchRequestField(); // PatchRequestField | Parameters for the extra field apiInstance.patchExtraField(listId, fieldId, patchRequestField, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **listId** | **Number**| ID of the List | **fieldId** | **Number**| ID of the Field | **patchRequestField** | [**PatchRequestField**](PatchRequestField.md)| Parameters for the extra field | ### Return type [**Field**](Field.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## updateFieldOption > FieldOption updateFieldOption(listId, fieldId, optionId, fieldOptionPost) Update field option Updates a field option ### Example ```javascript import egoisdk from 'egoisdk'; let defaultClient = egoisdk.ApiClient.instance; // Configure API key authorization: Apikey let Apikey = defaultClient.authentications['Apikey']; Apikey.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Apikey.apiKeyPrefix = 'Token'; let apiInstance = new egoisdk.FieldsApi(); let listId = 56; // Number | ID of the List let fieldId = 56; // Number | ID of the Field let optionId = 56; // Number | ID of the field option let fieldOptionPost = new egoisdk.FieldOptionPost(); // FieldOptionPost | Parameters for the field option apiInstance.updateFieldOption(listId, fieldId, optionId, fieldOptionPost, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **listId** | **Number**| ID of the List | **fieldId** | **Number**| ID of the Field | **optionId** | **Number**| ID of the field option | **fieldOptionPost** | [**FieldOptionPost**](FieldOptionPost.md)| Parameters for the field option | ### Return type [**FieldOption**](FieldOption.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json