Skip to main content

API Reference: form-index


API Reference: form-index

Used to get a filtered list of a form data model

URL : /api/v1/form

URL Parameters :

  • name=[string] : a valid form data model name (the same name which was defined in the template)
  • per-page=[integer] : number of records per page
  • page=[integer] : page number
  • sort=[string] : the name of the field used to sort results (prefix with - for descending sort)
  • filter=[array] : field values to use for filtering e.g. filter[expedition_id]=1&filter[site_id]=4

Method : GET

Auth required : YES

Permissions required

  • Roles: _administrator_, developer, operator, viewer
  • Permissions: form-<data model name>:edit, form-<data model name>:view

Data constraints : None

Data example : None

Success Response

GET http://localhost:8080/api/v1/form?name=cores&per-page=3

Code : 200 OK

Content example

{
    "items": [
        {
            "rqd_abundance": 32,
            "rqd_intensity": 1,
            "id": 38,
            "hole_id": 205,
            "core": 1,
            "combined_id": "5063_1_A_1",
            "analyst": "NB",
            "bottom_depth": 3.1,
            "continuity": null,
            "core_catcher": 1,
            "core_diameter": 67,
            "core_loss_reason": "DRILL",
            "core_ondeck": "2017-06-14 09:00:00",
            "core_recovery": 2.9,
            "core_recovery_pc": 93.548387096774,
            "core_type": "R",
            "drilled_length": 3.1,
            "igsn": "ICDP5063EC81001",
            "last_section": 2,
            "mcd_offset": 0,
            "oriented": 0,
            "remarks": "Simple tube barrel used to drill the casing. Fractures of excavation damage zone (blasting fractures) also reduce the RQD.",
            "temperature": null,
            "top_depth": 0,
            "site_id": 41,
            "expedition_id": 1,
            "program_id": 1,
            "archive_files": {
                "filter": {
                    "expedition": 1,
                    "site": 41,
                    "hole": 205,
                    "core": 38
                },
                "files": [
                    {
                        "id": 1,
                        "parent_combined_id": "5063_1_A_1",
                        "type": "BA",
                        "number": null,
                        "filename": "BA_5063_1_A_1.F1.jpg",
                        "original_filename": "BW_5063_1_A_2_BW_2.jpg",
                        "filesize": 25386,
                        "mime_type": "image/jpeg",
                        "checksum": "0e0599831ef80b92a88d25a179c220ba",
                        "upload_date": "2017-09-18 03:55:12",
                        "expedition_id": 1,
                        "site_id": 41,
                        "hole_id": 205,
                        "core_id": 38,
                        "section_id": null,
                        "remarks": null,
                        "metadata": "FILE:\n- FileName: BW_5063_1_A_2_BW_2.jpg\n- FileSize: 25386\n- FileDateTime: 2017-09-18 03:55:12\n- MimeType: image/jpeg\n\n"
                    }
                ]
            }
        },
        {
            "rqd_abundance": 25,
            "rqd_intensity": 1,
            "id": 39,
            "hole_id": 205,
            "core": 2,
            "combined_id": "5063_1_A_2",
            "analyst": "NB",
            "bottom_depth": 6,
            "continuity": null,
            "core_catcher": 1,
            "core_diameter": 67,
            "core_loss_reason": "BROKEN",
            "core_ondeck": "2019-03-31 22:00:00",
            "core_recovery": 2.7,
            "core_recovery_pc": 90,
            "core_type": "R",
            "drilled_length": 3,
            "igsn": "ICDP5063EC91001",
            "last_section": 2,
            "mcd_offset": 0,
            "oriented": 0,
            "remarks": "Simple tube barrel used to drill the casing. Fractures of excavation damage zone (blasting fractures) also reduce the RQD.",
            "temperature": null,
            "top_depth": 3,
            "site_id": 41,
            "expedition_id": 1,
            "program_id": 1,
            "archive_files": {
                "filter": {
                    "expedition": 1,
                    "site": 41,
                    "hole": 205,
                    "core": 39
                },
                "files": []
            }
        },
        {
            "rqd_abundance": 95,
            "rqd_intensity": 4,
            "id": 40,
            "hole_id": 205,
            "core": 3,
            "combined_id": "5063_1_A_3",
            "analyst": "NB",
            "bottom_depth": 9,
            "continuity": null,
            "core_catcher": 1,
            "core_diameter": 49,
            "core_loss_reason": null,
            "core_ondeck": "2017-06-15 08:00:00",
            "core_recovery": 3,
            "core_recovery_pc": 100,
            "core_type": "R",
            "drilled_length": 3,
            "igsn": "ICDP5063ECC1001",
            "last_section": 1,
            "mcd_offset": 0,
            "oriented": 1,
            "remarks": "Core drilled with a double core barrel",
            "temperature": null,
            "top_depth": 6,
            "site_id": 41,
            "expedition_id": 1,
            "program_id": 1,
            "archive_files": {
                "filter": {
                    "expedition": 1,
                    "site": 41,
                    "hole": 205,
                    "core": 40
                },
                "files": []
            }
        }
    ],
    "_links": {
        "self": {
            "href": "http://localhost:8000/api/v1/form?name=cores&per-page=3&page=1"
        },
        "next": {
            "href": "http://localhost:8000/api/v1/form?name=cores&per-page=3&page=2"
        },
        "last": {
            "href": "http://localhost:8000/api/v1/form?name=cores&per-page=3&page=98"
        }
    },
    "_meta": {
        "totalCount": 292,
        "pageCount": 98,
        "currentPage": 1,
        "perPage": 3
    }
}