Get form template

Get form template with identifier

GET http://try-server.labpipe.org/api/form/template/identifier/:identifier

Path Parameters

Name
Type
Description

identifier

string

Form identifier

Headers

Name
Type
Description

Authorization

string

HTTP Basic authentication

{
    "code": "example-form",
    "name": "Example Form",
    "template": {
        "title": "Example Form Template",
        "pages": [{
            "key": "p1",
            "title": "Page 1 Title",
            "navTitle": "P1 Nav",
            "requireValidForm": true,
            "order": 1,
            "questions": [{
                "key": "q1",
                "label": "Question 1",
                "controlType": "select",
                "required": true,
                "order": 1,
                "type": null,
                "pattern": null,
                "options": "__config::participant_id::prefix__",
                "helperText": "This is help text",
                "target": null,
                "multiple": false,
                "filter": []
            }, {
                "key": "q2",
                "label": "Question 2",
                "controlType": "input",
                "required": true,
                "order": 2,
                "type": "text",
                "pattern": "__config::participant_id::length__",
                "options": "",
                "helperText": "This is help text",
                "target": null,
                "multiple": false,
                "filter": []
            }],
            "formValidProcess": [{
                "processType": "concat",
                "dataField": "-::participant_id_prefix::participant_id_number",
                "newField": "participant_id"
            }, {
                "processType": "concat",
                "dataField": "-::p1::p2::--R::--RP",
                "newField": "sample_id"
            }]
        }, {
            "key": "p_file",
            "title": "File Upload",
            "navTitle": "File",
            "requireValidForm": true,
            "order": 3,
            "questions": [{
                "key": "file",
                "label": "Sample File",
                "controlType": "file",
                "required": false,
                "order": 1,
                "type": null,
                "pattern": null,
                "options": "",
                "helperText": "Select file to upload",
                "target": "file",
                "multiple": true,
                "filter": [{
                    "name": "HDF5 file",
                    "extensions": ["h5"]
                }]
            }],
            "formValidProcess": []
        }]
    },
    "url": "/api/record/add",
    "study_code": "example-study",
    "instrument_code": "R",
    "notification_style": "ADMIN_ONLY",
    "notification_subject": "Notification email subject"
}

Get form template with study identifier and instrument identifier

GET http://try-server.labpipe.org/api/form/template/study/:sid/instrument/:iid

Return all form templates for given study and instrument combination

Path Parameters

Name
Type
Description

sid

string

Study identifier

iid

string

Instrument identifier

Headers

Name
Type
Description

Authorization

string

HTTP Basic authentication

[{
    "code": "example-form",
    "name": "Example Form",
    "template": {
        "title": "Example Form Template",
        "pages": [{
            "key": "p1",
            "title": "Page 1 Title",
            "navTitle": "P1 Nav",
            "requireValidForm": true,
            "order": 1,
            "questions": [{
                "key": "q1",
                "label": "Question 1",
                "controlType": "select",
                "required": true,
                "order": 1,
                "type": null,
                "pattern": null,
                "options": "__config::participant_id::prefix__",
                "helperText": "This is help text",
                "target": null,
                "multiple": false,
                "filter": []
            }, {
                "key": "q2",
                "label": "Question 2",
                "controlType": "input",
                "required": true,
                "order": 2,
                "type": "text",
                "pattern": "__config::participant_id::length__",
                "options": "",
                "helperText": "This is help text",
                "target": null,
                "multiple": false,
                "filter": []
            }],
            "formValidProcess": [{
                "processType": "concat",
                "dataField": "-::participant_id_prefix::participant_id_number",
                "newField": "participant_id"
            }, {
                "processType": "concat",
                "dataField": "-::p1::p2::--R::--RP",
                "newField": "sample_id"
            }]
        }, {
            "key": "p_file",
            "title": "File Upload",
            "navTitle": "File",
            "requireValidForm": true,
            "order": 3,
            "questions": [{
                "key": "file",
                "label": "Sample File",
                "controlType": "file",
                "required": false,
                "order": 1,
                "type": null,
                "pattern": null,
                "options": "",
                "helperText": "Select file to upload",
                "target": "file",
                "multiple": true,
                "filter": [{
                    "name": "HDF5 file",
                    "extensions": ["h5"]
                }]
            }],
            "formValidProcess": []
        }]
    },
    "url": "/api/record/add",
    "study_code": "example-study",
    "instrument_code": "R",
    "notification_style": "ADMIN_ONLY",
    "notification_subject": "Notification email subject"
}]

Last updated

Was this helpful?