new CustomFieldsAPI(rest)
This class is used to interact with Custom Fields in TidyHQ.
Parameters:
Name | Type | Description |
---|---|---|
rest | Rest | The rest instance to use for requests. |
- Source
Methods
(async) createCustomField(title, type, optionsopt) → {Promise.<TidyAPI_V1_CustomField>}
Create a new custom field in TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
title | string | The title of the custom field to create. | ||||||||||
type | Tidy_V1_CustomFieldType | The type of the custom field to create. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- The newly created custom field.
- Type:
- Promise.<TidyAPI_V1_CustomField>
(async) createCustomFieldChoice(customFieldID, title, optionsopt) → {Promise.<TidyAPI_V1_CustomFieldChoice>}
Get a single choice for a dropdown custom field by name.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
customFieldID | string | The ID of the custom field to get the choice for. | ||||||||||
title | string | The title of the choice to get. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- A choice object.
- Type:
- Promise.<TidyAPI_V1_CustomFieldChoice>
(async) deleteCustomField(customFieldID, optionsopt) → {Promise.<TidyAPI_Response>}
Delete a custom field in TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
customFieldID | string | The ID of the custom field to delete. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- Success or failure.
- Type:
- Promise.<TidyAPI_Response>
(async) deleteCustomFieldChoice(customFieldID, choiceID, optionsopt) → {Promise.<TidyAPI_Response>}
Delete a choice for a dropdown custom field.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
customFieldID | string | The ID of the custom field to delete the choice for. | ||||||||||
choiceID | string | The ID of the choice to delete. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- Success or failure.
- Type:
- Promise.<TidyAPI_Response>
(async) getCustomField(customFieldID, optionsopt) → {Promise.<TidyAPI_V1_CustomField>}
Get a single custom field from TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
customFieldID | string | The ID of the CustomField to get | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- The custom field.
- Type:
- Promise.<TidyAPI_V1_CustomField>
(async) getCustomFieldChoice(customFieldID, choiceID, optionsopt) → {Promise.<TidyAPI_V1_CustomFieldChoice>}
Get a single choice for a dropdown custom field.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
customFieldID | string | The ID of the custom field to get the choice for. | ||||||||||
choiceID | string | The ID of the choice to get. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- A choice object.
- Type:
- Promise.<TidyAPI_V1_CustomFieldChoice>
(async) getCustomFieldChoices(customFieldID, optionsopt) → {Promise.<TidyAPI_V1_CustomFieldChoices>}
Get the choices for a dropdown custom field.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
customFieldID | string | The ID of the custom field to get the choices for. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- An array of choice objects.
- Type:
- Promise.<TidyAPI_V1_CustomFieldChoices>
(async) getCustomFields(optionsopt) → {Promise.<TidyAPI_V1_CustomFields>}
Get a list of custom fields from TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | {} | Properties
|
- Source
Returns:
- An array of custom fields.
- Type:
- Promise.<TidyAPI_V1_CustomFields>
(async) updateCustomField(customFieldID, optionsopt) → {Promise.<TidyAPI_V1_CustomField>}
Update a custom field in TidyHQ.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
customFieldID | string | The ID of the custom field to update. | |||||||||||||||||
options | object | <optional> | The options to update the custom field with. At least one option is required that isn't the access_token.Properties
|
- Source
Returns:
- The updated custom field.
- Type:
- Promise.<TidyAPI_V1_CustomField>
(async) updateCustomFieldChoice(customFieldID, choiceID, title, optionsopt) → {Promise.<TidyAPI_V1_CustomFieldChoice>}
Update a choice for a dropdown custom field.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
customFieldID | string | The ID of the custom field to update the choice for. | ||||||||||
choiceID | string | The ID of the choice to update. | ||||||||||
title | string | The new title of the choice. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- The updated choice object.
- Type:
- Promise.<TidyAPI_V1_CustomFieldChoice>