IN DEVELOPMENT: FEATURE IS CURRENTLY NOT AVAILABLE
Due to the dynamic nature of AffinityLive it's really difficult to determine what fields are available and required when creating and editing objects. The forms feature can be used to retrieve a list of required and optional fields for a given object or group of objects. Once you have selected the details you wish to store, you can then simply submit the form.
Endpoints
(POST|GET) [/object_type1,object_type2,..object_typeN]/_forms/fields
Request fields for given object type(s). For example,
$ curl -XGET /addresses,contacts/_forms/fields
would give you something back like
{ "response": { "forms": { "addresses": [{ "title": "Address", "fields": [{ "key": "title", "title": "Title", "type": "text", "required": 1 }, ...] }], "contacts": [{ ... }], } }, "meta": { ... } }
You can also pass the form information in as body data. This can be used to configure the forms, which we will discuss a little bit later in the document. For example,
$ curl -XPOST /_forms/fields -d'{ "forms": { "addresses": { ... configure addresses form ... }, "contacts: 1, } }';
would return a similar structure of fields. The fields endpoint accept the following parameters:
forms
: The forms for each object type, with optional configuration options.