FORMEVER API – VERSION 2
The major difference between version 1 and version 2 is that version 2 has implemented a clear separation between the meta data stored on the master forms and the actual data.
In version 2 there is a request to get the metadata of several forms. For each form this returns form level meta data and an object that specifies metadata for every field by field index. Each of these field metadata objects contains the labels (for different Locales), the field type and specialized metadata for the particular field type.
For example a FevChoice field has metadata that dictates whether multiple choices are allowed, if no selection is allowed etc.
V2 attempts to have all the levels required to add extra data at a later date if and when it becomes clear that such data is needed. For example when requesting metadata for several forms the form name is in an object rather than being an individual string. This allows for a later form of parameterization is required i.e. adding other paramters to the request for that form’s metadata.
Getting Metadata
Request Format
{
"request_type":"get_form_metadata",
"form_name_list": [
{"form_name":"Members"}
]
}
You can see from the example that it is possible to request the metadata of an arbitrary number of forms. The form name is given as an object so that it is possible to add parameters to the request for metadata in the future. This may or may not turn out to be useful, but if it is required it will not require restructuring the request levels.
Reply Format
"metadata_list" : [
{
"status" : "success",
"form_data" : {
"form_level_metadata" : {
"form_name" : "Members",
"form_type" : "`Members"
},
"fields_metadata" : {
"0" : {
"field_type" : "FevDescription",
"field_metadata" : {
"labels" : {
"en" : "`Form Name"
},
"field_data_entry_allowed" : false,
"description_upper_case" : false,
"description_maximum_length" : 32
}
},
"5" : {
"field_type" : "FevCode",
"field_metadata" : {
"labels" : {
"en" : "Member Code"
}
}
},
...
This is an incomplete sample of the reply to show how it is structured. The metadata_list is an array of returns for each form name requested.
The status is given for each form.
The form_level_metada gives the form name and the form type. The form type is an internal unique name that is the actual ID of the form. It always starts with a backtick. It doesn’t change, even if the form name is changed.
There may be more form level metadata in the future. Most of the form level metadata is graphical – size, backgrounds etc. and hasn’t been included at the moment.
The fields_metadata is an object using the index of the field as an ID. The type of the field is included and then the metadata is given for the field. It includes the field label (with localized versions) and specialized data that depends on the field type.
Getting Form Data
{
"request_type":"get_form",
"form_data":
{
"form_name":"Members",
"Member Code":"GUTTC1"}}
}
}