close anchor

Element Options

To get information on element options:

GET /element/options

Parameters

Param Type Description
id string The UUID of an individual element option, as provided for the element in which it exists.

Data Fields

The data object provided by this endpoint includes the properties below:

Field Type Description
id string The UUID of the element option for which data is being provided.
text string The element option text, or name, provided in the endpoint transaction or fallback locale (if plural, this will be delivered in an object keyed by each).
element object The option's parent element. Includes only the element id.
parent object The parent option identified with this option, including the option id, text, the parent of that element option if defined (i.e., the parent of the parent), and the parent ordinal. If empty or not provided, this option is on the top level of the element.
ordinal integer The desired position of the element option (if being displayed in a pull-down, for instance), either on the top level or in a parent option if defined.
options array The element option(s) of which this option is the parent, in which each value is an object including the option id, text, ordinal, and the options of which it, in turn, is the parent.

To post element options:

POST /element/options

In order to post element options, log in a user identified with owner-level privileges.

Parameters

Provide the input field(s) below as a JSON-encoded data object:

Param Type Description
element string The UUID of the element to which the option(s) will be posted.
options array The option(s) to be posted to the element, being a one-dimensional, indexed array in which each value is an object on which further information is provided in the data fields table below.

Data Fields

Include the properties below for each of the options to be posted:

Field Type Description Optional
parent string The UUID of the element option to be identified as the parent of this option (if empty or not provided, the option will be included on the top level of the element by default).
ordinal integer The position in which the option will be delivered for the element or parent option in question for which, if not indicated, the default value o zero will be inferred.
text string The element option label text, provided in the endpoint transaction locale.

The data object provided by this endpoint is the element identified with the option(s) being posted.

Errors

If there is an endpoint transaction failure, or a problem with user input data, an error is provided:

ID/Type Description
illegal_parent_option The parent option indicated either does not exist or is not identified with the element in question.
text_not_provided The element option text is an empty value or not provided.

If an error is not described on this page, the platform-wide error table provides further information.

To edit or update an individual element option:

PUT /element/options

In order to update an element option, log in a user identified with owner-level privileges.

Parameters

Provide the input field(s) below as a JSON-encoded data object:

Param Type Description Optional
id string The UUID of the element option to be updated.
parent string The UUID of the element option to be identified as the parent of this option (if empty, this option will be included on the top level of the element).
ordinal integer The desired position in which the option will be delivered for the element or parent option in question.
text string The element option text, or name, provided in the endpoint transaction locale.

The data object provided by this endpoint is the updated element option.

Errors

If there is an endpoint transaction failure, or a problem with user input data, an error is provided:

ID/Type Description
element_not_found The option is not identified with a known element in the project.
illegal_parent_option The parent option indicated either does not exist, is not identified with the element in question, or is a descendant of this option. In order to prevent an infinite loop, do not indicate a parent option for which this option would be a parent, too, even indirectly.
text_not_provided The element option text is an empty value or not provided.

If an error is not described on this page, the platform-wide error table provides further information.

To edit or update element option positions:

PUT /element/options

In order to update element option positions, log in a user identified with owner-level privileges.

Parameters

Provide the input field(s) below as a JSON-encoded data object:

Param Type Description
element string The UUID of the element for which the position of its option(s) will be updated.
options array The option(s) identified with this element, being an indexed array in which each value is an object including the option id and the options of which it, in turn, is the parent, in order by the desired position of each (do not include the option in question, or a parent thereof, in the options index for an option or this endpoint will either initialize the parent of that option or yield an error as indicated below).

This endpoint will initialize both the ordinal (to a default value of zero) and the parent of options excluded from the transaction, but those options will not be deleted.

The data provided by this endpoint is the updated element.

Errors

If there is an endpoint transaction failure, or a problem with user input data, an error is provided:

ID/Type Description
illegal_parent_option The parent option indicated either does not exist, is not identified with the element, or is a descendant of the option in question. In order to prevent an infinite loop, do not indicate a parent option for which this option would be a parent, too.
invalid_element_option The option indicated does not exist or is not identified with the element in question.

If an error is not described on this page, the platform-wide error table provides further information.

To delete an element option:

DELETE /element/options

In order to delete an element option, log in a user identified with owner-level privileges.

Parameters

Param Type Description
id string The UUID of the element option to be deleted.

The data object provided by this endpoint is the deleted element option.

Errors

If there is an endpoint transaction failure, or a problem with user input data, an error is provided:

ID/Type Description
entity_in_use The element option was not deleted because it is presently in use, being identified with content entries in the project. The data included for this error will be the ID of the element option not to be deleted.

If an error is not described on this page, the platform-wide error table provides further information.

Register for an Invitation
Thank you!
We'll be in touch.
First Name*
Last Name*
(optional) Business Name
Role*
Email*