new V2_ContactsAPI(rest)
This class is used to interact with Contacts in TidyHQ.
Parameters:
Name | Type | Description |
---|---|---|
rest | Rest | The rest instance to use for requests. |
- Source
Methods
(async) createContact(contact, optionsopt) → {Promise.<TidyAPI_V2_Contacts>}
Creates a new contact with the given data in TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
contact | Tidy_V2_Contact | The contact to create. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
- To Do
- REFACTOR TYPES AND TEST
Returns:
- The created contact.
- Type:
- Promise.<TidyAPI_V2_Contacts>
(async) createContactNote(contact_id, note, optionsopt) → {Promise.<TidyAPI_V2_Note>}
Adds a note to a specified contact.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
contact_id | string | The ID of the contact to create the note for. | ||||||||||
note | string | The note to create. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- The created note.
- Type:
- Promise.<TidyAPI_V2_Note>
(async) deleteContactNote(contact_id, note_id, optionsopt) → {Promise.<TidyAPI_EmptyResponse>}
Deletes a specified note from a specified contact.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
contact_id | string | The ID of the contact to delete the note from. | ||||||||||
note_id | string | The ID of the note to delete. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- An empty response.
- Type:
- Promise.<TidyAPI_EmptyResponse>
(async) getContact(contactIDopt, optionsopt) → {Promise.<TidyAPI_V2_Contact>}
Get a single contact from TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
contactID | string | <optional> | "me" | The ID of the contact to get (me / default returns the contact of the user who authorized the application) | ||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- The contact object.
- Type:
- Promise.<TidyAPI_V2_Contact>
(async) getContactMemberships(contact_id, optionsopt) → {Promise.<TidyAPI_V2_Memberships>}
Gets all memberships for a given single contact.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
contact_id | string | The ID of the contact to find memberships for. | ||||||||||||||||||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- An array of memberships.
- Type:
- Promise.<TidyAPI_V2_Memberships>
(async) getContacts(optionsopt) → {Promise.<TidyAPI_V2_Contacts>}
Get a list of contacts from TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | {} | Properties
|
- Source
Returns:
- An array of contact objects.
- Type:
- Promise.<TidyAPI_V2_Contacts>
(async) updateContact(contact_id, contact, optionsopt) → {Promise.<TidyAPI_V2_Contact>}
Update a contact in TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
contact_id | string | The ID of the contact to update. | ||||||||||
contact | Tidy_V2_Contact | The new contact data. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- The updated contact.
- Type:
- Promise.<TidyAPI_V2_Contact>