new GroupsAPI(rest)
This class is used to interact with Groups in TidyHQ.
Parameters:
Name | Type | Description |
---|---|---|
rest | Rest | The rest instance to use for requests. |
- Source
Methods
(async) addContactToGroup(group_id, contact_id, optionsopt) → {Promise.<TidyAPI_EmptyResponse>}
This function is used to add a contact to a group in TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
group_id | number | The ID of the group. | ||||||||||
contact_id | number | The ID of the contact. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- An empty response.
- Type:
- Promise.<TidyAPI_EmptyResponse>
(async) createGroup(name, optionsopt) → {Promise.<TidyAPI_V1_Group>}
Create a new group in TidyHQ.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name | string | The name of the group. | |||||||||||||
options | object | <optional> | Properties
|
- Source
Returns:
- The group.
- Type:
- Promise.<TidyAPI_V1_Group>
(async) deleteGroup(group_id, optionsopt) → {Promise.<TidyAPI_Response>}
Delete a group in TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
group_id | number | The ID of the group. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- Success or failure.
- Type:
- Promise.<TidyAPI_Response>
(async) getGroup(group_id, optionsopt) → {Promise.<TidyAPI_V1_Group>}
Get a single group from TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
group_id | number | The ID of the group. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- A group.
- Type:
- Promise.<TidyAPI_V1_Group>
(async) getGroups(optionsopt) → {Promise.<TidyAPI_V1_Groups>}
Get a list of groups from TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | {} | Properties
|
- Source
Returns:
- An array of groups.
- Type:
- Promise.<TidyAPI_V1_Groups>
(async) getGroupsForContact(contact_id, optionsopt) → {Promise.<TidyAPI_V1_Groups>}
Get groups for a contact from TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
contact_id | number | The ID of the contact. | ||||||||||||||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- An array of groups.
- Type:
- Promise.<TidyAPI_V1_Groups>
(async) removeContactFromGroup(group_id, contact_id, optionsopt) → {Promise.<TidyAPI_EmptyResponse>}
This function is used to remove a contact from a group in TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
group_id | number | The ID of the group. | ||||||||||
contact_id | number | The ID of the contact. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- An empty response.
- Type:
- Promise.<TidyAPI_EmptyResponse>
(async) updateGroup(group_id, optionsopt) → {Promise.<TidyAPI_V1_Group>}
Update a group in TidyHQ.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
group_id | number | The ID of the group. | |||||||||||||||||
options | object | <optional> | Properties
|
- Source
Returns:
- The group.
- Type:
- Promise.<TidyAPI_V1_Group>