Skip to content
This repository has been archived by the owner on Jan 18, 2020. It is now read-only.

Field Resources

Byron Ruth edited this page May 3, 2013 · 5 revisions

Endpoints

Fields are automatically filtered based on various criteria based on the requesting user's access level. This includes permissions, whether the fields are published vs. archived, etc.

/api/fields/

Resource exposing all fields

GET

/api/fields/:id/

Resource exposing a single field

GET

Parameters

These are supported as GET paramaters, e.g. /api/fields/?sort=name&query=cochlear

sort

The properties/fields to sort the fields by.

  • category (default) - sort by the category the field is contained in and by the order relative to the category
  • name - sort by the name of the field

order

The order of the sorting based on the sort method above.

  • asc (default) - ascending order
  • desc - descending order

published

Privileged Users Only

Enables toggling whether to explicitly show only published or unpublished objects. By default both sets are used.

  • true - filters the published objects
  • false - filters the unpublished objects

archived

Privileged Users Only

Enables toggling whether to explicitly show only archived or unarchived objects. By default both sets are used.

  • true - filters the archived objects
  • false - filters the archived objects

query

A query term to be used to filter fields.

  • <query term> - Performs a robust search across metadata and the data values themselves
    • Each term is queried independently by default
    • A - prefix to a term will cause a negation on that term, e.g. -candy
    • Quotes around a series of terms will be perform a verbatim search, e.g. "greek yogurt"
    • Terms can be combined for a complex lookup, e.g. dessert -candy "greek yogurt"

Response

{
    "_links": {
        "self": {
            "href": "http://127.0.0.1:8002/api/fields/2149/", 
            "rel": "self"
        }, 
        "values": {
            "href": "http://127.0.0.1:8002/api/fields/2149/values/", 
            "rel": "data"
        }
    }, 
    "alt_name": null, 
    "alt_plural_name": "File Formats", 
    "app_name": "bulkup", 
    "archived": false, 
    "data_modified": null, 
    "description": null, 
    "enumerable": false, 
    "field_name": "file_format", 
    "id": 2149, 
    "internal_type": "char", 
    "keywords": null, 
    "model_name": "uploadeddatafile", 
    "modified": "2013-03-28T18:06:22.670", 
    "name": "File Format", 
    "nullable": false, 
    "operators": [
        [
            "exact", 
            "is"
        ], 
        [
            "-exact", 
            "is not"
        ], 
        [
            "iexact", 
            "is"
        ], 
        [
            "-iexact", 
            "is not"
        ], 
        [
            "in", 
            "includes"
        ], 
        [
            "-in", 
            "excludes"
        ], 
        [
            "icontains", 
            "contains"
        ], 
        [
            "-icontains", 
            "does not contain"
        ]
    ], 
    "plural_name": "File Formats", 
    "plural_unit": null, 
    "published": true, 
    "searchable": true, 
    "simple_type": "string", 
    "unit": null
}
Clone this wiki locally