# egoisdk.ContactsApi All URIs are relative to *https://api.egoiapp.com* Method | HTTP request | Description ------------- | ------------- | ------------- [**actionActivateContacts**](ContactsApi.md#actionActivateContacts) | **POST** /lists/{list_id}/contacts/actions/activate | Activate contacts [**actionAttachTag**](ContactsApi.md#actionAttachTag) | **POST** /lists/{list_id}/contacts/actions/attach-tag | Attach tag to contact [**actionDeactivateContacts**](ContactsApi.md#actionDeactivateContacts) | **POST** /lists/{list_id}/contacts/actions/deactivate | Deactivate contacts [**actionDetachTag**](ContactsApi.md#actionDetachTag) | **POST** /lists/{list_id}/contacts/actions/detach-tag | Detach tag to contact [**actionExportContacts**](ContactsApi.md#actionExportContacts) | **POST** /lists/{list_id}/contacts/actions/export | Exports a list of contacts [**actionForgetContacts**](ContactsApi.md#actionForgetContacts) | **POST** /lists/{list_id}/contacts/actions/forget | Forget contacts [**actionImportBulk**](ContactsApi.md#actionImportBulk) | **POST** /lists/{list_id}/contacts/actions/import-bulk | Import collection of contacts [**actionStartAutomation**](ContactsApi.md#actionStartAutomation) | **POST** /lists/{list_id}/contacts/actions/start-automation | Start automation [**actionUnsubscribeContact**](ContactsApi.md#actionUnsubscribeContact) | **POST** /lists/{list_id}/contacts/actions/unsubscribe | Unsubscribes contacts [**actionUpdateContacts**](ContactsApi.md#actionUpdateContacts) | **POST** /lists/{list_id}/contacts/actions/update | Updates contacts [**createContact**](ContactsApi.md#createContact) | **POST** /lists/{list_id}/contacts | Create new contact [**getAllContactActivities**](ContactsApi.md#getAllContactActivities) | **GET** /lists/{list_id}/contacts/{contact_id}/activities | Get all contact activities [**getAllContacts**](ContactsApi.md#getAllContacts) | **GET** /lists/{list_id}/contacts | Get all contacts [**getAllContactsBySegment**](ContactsApi.md#getAllContactsBySegment) | **GET** /lists/{list_id}/contacts/segment/{segment_id} | Get all contacts by Segment Id [**getContact**](ContactsApi.md#getContact) | **GET** /lists/{list_id}/contacts/{contact_id} | Get contact [**patchContact**](ContactsApi.md#patchContact) | **PATCH** /lists/{list_id}/contacts/{contact_id} | Update a specific contact [**searchContacts**](ContactsApi.md#searchContacts) | **GET** /contacts/search | Search contact [**updateContactByField**](ContactsApi.md#updateContactByField) | **POST** /lists/{list_id}/contacts/by-field | Updates a contact by field ## actionActivateContacts > AcceptedResponse actionActivateContacts(listId, activateContactsRequest) Activate contacts Activates a collection of contacts (does not apply to removed contacts) ### 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.ContactsApi(); let listId = 56; // Number | ID of the List let activateContactsRequest = new egoisdk.ActivateContactsRequest(); // ActivateContactsRequest | Parameters for the request apiInstance.actionActivateContacts(listId, activateContactsRequest, (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 | **activateContactsRequest** | [**ActivateContactsRequest**](ActivateContactsRequest.md)| Parameters for the request | ### Return type [**AcceptedResponse**](AcceptedResponse.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## actionAttachTag > AcceptedResponse actionAttachTag(listId, attachTagRequest) Attach tag to contact Attaches a tag to the provided contacts. ### 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.ContactsApi(); let listId = 56; // Number | ID of the List let attachTagRequest = new egoisdk.AttachTagRequest(); // AttachTagRequest | Parameters for the Tag apiInstance.actionAttachTag(listId, attachTagRequest, (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 | **attachTagRequest** | [**AttachTagRequest**](AttachTagRequest.md)| Parameters for the Tag | ### Return type [**AcceptedResponse**](AcceptedResponse.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## actionDeactivateContacts > AcceptedResponse actionDeactivateContacts(listId, deactivateContactsRequest) Deactivate contacts Deactivates a collection of contacts (does not apply to removed contacts) ### 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.ContactsApi(); let listId = 56; // Number | ID of the List let deactivateContactsRequest = new egoisdk.DeactivateContactsRequest(); // DeactivateContactsRequest | Parameters for the request apiInstance.actionDeactivateContacts(listId, deactivateContactsRequest, (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 | **deactivateContactsRequest** | [**DeactivateContactsRequest**](DeactivateContactsRequest.md)| Parameters for the request | ### Return type [**AcceptedResponse**](AcceptedResponse.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## actionDetachTag > AcceptedResponse actionDetachTag(listId, detachTagRequest) Detach tag to contact Detach a tag to the provided contacts ### 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.ContactsApi(); let listId = 56; // Number | ID of the List let detachTagRequest = new egoisdk.DetachTagRequest(); // DetachTagRequest | Parameters for the Tag apiInstance.actionDetachTag(listId, detachTagRequest, (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 | **detachTagRequest** | [**DetachTagRequest**](DetachTagRequest.md)| Parameters for the Tag | ### Return type [**AcceptedResponse**](AcceptedResponse.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## actionExportContacts > AcceptedResponse actionExportContacts(listId, contactExportRequest) Exports a list of contacts Exports a list of contacts to the desired callback url ### 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.ContactsApi(); let listId = 56; // Number | ID of the List let contactExportRequest = new egoisdk.ContactExportRequest(); // ContactExportRequest | Parameters for export apiInstance.actionExportContacts(listId, contactExportRequest, (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 | **contactExportRequest** | [**ContactExportRequest**](ContactExportRequest.md)| Parameters for export | ### Return type [**AcceptedResponse**](AcceptedResponse.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## actionForgetContacts > AcceptedResponse actionForgetContacts(listId, contactForgetRequest) Forget contacts Forgets a list of contacts ### 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.ContactsApi(); let listId = 56; // Number | ID of the List let contactForgetRequest = new egoisdk.ContactForgetRequest(); // ContactForgetRequest | Parameters for the action apiInstance.actionForgetContacts(listId, contactForgetRequest, (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 | **contactForgetRequest** | [**ContactForgetRequest**](ContactForgetRequest.md)| Parameters for the action | ### Return type [**AcceptedResponse**](AcceptedResponse.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## actionImportBulk > AcceptedResponse actionImportBulk(listId, importBulkFileRequest) Import collection of contacts Imports a collection of contacts </br> **DISCLAIMER:** stream limits applied. [view here](#section/Stream-Limits 'Stream Limits')<br> ***Notes:***<br>Minimum of 2 contacts to use this method. [Use Create new contact method instead](#operation/createContact 'Create new contact')<br>It defaults to ***Bulk object*** import. ### 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.ContactsApi(); let listId = 56; // Number | ID of the List let importBulkFileRequest = new egoisdk.ImportBulkFileRequest(); // ImportBulkFileRequest | Parameters for the bulk import apiInstance.actionImportBulk(listId, importBulkFileRequest, (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 | **importBulkFileRequest** | [**ImportBulkFileRequest**](ImportBulkFileRequest.md)| Parameters for the bulk import | ### Return type [**AcceptedResponse**](AcceptedResponse.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## actionStartAutomation > StartAutomationResponse actionStartAutomation(listId, startAutomationRequest) Start automation Start automation to the provided contacts ### 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.ContactsApi(); let listId = 56; // Number | ID of the List let startAutomationRequest = new egoisdk.StartAutomationRequest(); // StartAutomationRequest | Parameters for the operation to start automation apiInstance.actionStartAutomation(listId, startAutomationRequest, (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 | **startAutomationRequest** | [**StartAutomationRequest**](StartAutomationRequest.md)| Parameters for the operation to start automation | ### Return type [**StartAutomationResponse**](StartAutomationResponse.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## actionUnsubscribeContact > RemoveResponse actionUnsubscribeContact(listId, removeRequest) Unsubscribes contacts Unsubscribes contacts ### 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.ContactsApi(); let listId = 56; // Number | ID of the List let removeRequest = new egoisdk.RemoveRequest(); // RemoveRequest | Parameters for the contact to unsubscribe apiInstance.actionUnsubscribeContact(listId, removeRequest, (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 | **removeRequest** | [**RemoveRequest**](RemoveRequest.md)| Parameters for the contact to unsubscribe | ### Return type [**RemoveResponse**](RemoveResponse.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## actionUpdateContacts > AcceptedResponse actionUpdateContacts(listId, updateContactsRequest) Updates contacts Updates a collection of contacts (does not apply to removed contacts). Note that all contacts will be updated with the same values and the existance of unique fields in the payload will trigger a 409 Conflict response. ### 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.ContactsApi(); let listId = 56; // Number | ID of the List let updateContactsRequest = new egoisdk.UpdateContactsRequest(); // UpdateContactsRequest | Parameters for the request apiInstance.actionUpdateContacts(listId, updateContactsRequest, (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 | **updateContactsRequest** | [**UpdateContactsRequest**](UpdateContactsRequest.md)| Parameters for the request | ### Return type [**AcceptedResponse**](AcceptedResponse.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## createContact > CreateContactResponse createContact(listId, contactBaseExtraPost) Create new contact Create a new contact ### 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.ContactsApi(); let listId = 56; // Number | ID of the list where the contact belongs let contactBaseExtraPost = new egoisdk.ContactBaseExtraPost(); // ContactBaseExtraPost | Parameters for the Contact apiInstance.createContact(listId, contactBaseExtraPost, (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 where the contact belongs | **contactBaseExtraPost** | [**ContactBaseExtraPost**](ContactBaseExtraPost.md)| Parameters for the Contact | ### Return type [**CreateContactResponse**](CreateContactResponse.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## getAllContactActivities > ActivityCollection getAllContactActivities(contactId, listId, opts) Get all contact activities Returns all contact activities ### 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.ContactsApi(); let contactId = "contactId_example"; // String | ID of the Contact 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 'dateMin': new Date("2013-10-20T19:20:30+01:00"), // Date | Start date 'dateMax': new Date("2013-10-20T19:20:30+01:00"), // Date | End date 'actionName': "actionName_example" // String | Action data to return }; apiInstance.getAllContactActivities(contactId, listId, opts, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contactId** | **String**| ID of the Contact | **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] **dateMin** | **Date**| Start date | [optional] **dateMax** | **Date**| End date | [optional] **actionName** | **String**| Action data to return | [optional] ### Return type [**ActivityCollection**](ActivityCollection.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## getAllContacts > ContactCollection getAllContacts(listId, opts) Get all contacts Returns all contacts ### 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.ContactsApi(); 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 'firstName': "firstName_example", // String | First name of the contacts to return 'lastName': "lastName_example", // String | Last name of the contacts to return 'email': "email_example", // String | Email of the contacts to return 'emailStatus': true, // Boolean | EmailStatus of the contacts to return 'cellphone': "cellphone_example", // String | Cellphone of the contacts to return 'cellphoneStatus': true, // Boolean | CellphoneStatus of the contacts to return 'phone': "phone_example", // String | Phone of the contacts to return 'phoneStatus': true, // Boolean | PhoneStatus of the contacts to return 'birthDate': null, // Date | Birth date of the contacts to return 'language': "language_example", // String | Language date of the contacts to return 'extraFieldId': {key: null} // GetAllContactsExtraFieldIdParameter | Extra field of contacts