new 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_V1_Contact>}
Creates a new contact with the given data in TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
contact | Tidy_V1_ContactParams | The contact to create. Requires a first name. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- The newly created contact.
- Type:
- Promise.<TidyAPI_V1_Contact>
(async) deleteContact(contact_id, optionsopt) → {Promise.<TidyAPI_Response>}
Deletes a contact from TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
contact_id | number | The ID of the contact to delete. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- Success or failure.
- Type:
- Promise.<TidyAPI_Response>
(async) getContact(contactIDopt, optionsopt) → {Promise.<TidyAPI_V1_Contact>}
Get a single contact from TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
contactID | number | | <optional> | "me" | The ID of the contact to get ("me" returns the contact of the user who authorized the application) | ||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- A contact.
- Type:
- Promise.<TidyAPI_V1_Contact>
(async) getContacts(optionsopt) → {Promise.<TidyAPI_V1_Contacts>}
Get a list of contacts from TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | {} | Properties
|
- Source
Returns:
- An array of contacts.
- Type:
- Promise.<TidyAPI_V1_Contacts>
(async) getContactsInGroup(group_id, optionsopt) → {Promise.<TidyAPI_V1_Contacts>}
Get a list of contacts in a group from TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
group_id | string | The ID of the group to get contacts from. | ||||||||||||||||||||||||||||||||||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- An array of contacts.
- Type:
- Promise.<TidyAPI_V1_Contacts>
(async) updateContact(contact_id, contact, optionsopt) → {Promise.<TidyAPI_V1_Contact>}
Updates a contact with the given data in TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
contact_id | number | The ID of the contact to update. | ||||||||||
contact | Tidy_V1_ContactParams | The contact to update. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- The updated contact.
- Type:
- Promise.<TidyAPI_V1_Contact>