Home Page > Integration > REST API > Fields

Fields

Fields - /REST/1/Fields/:id

This endpoint is used for manipulating both custom and built in field resources within the system. Objects are always returned in a JSON format within an array. Empty results return an empty array.

 

Object

The Field object takes the following JSON object:

[
    {
        "alive": "<bool>",
        "cardinality": "<int>",
        "code": "<string>",
        "description": "<text>",
        "display_order": "<int>",
        "field_display_type": "<enum>",
        "field_type": "<enum>",
        "id": "<int>",
        "include_on_info": "<bool>",
        "include_on_search": "<bool>",
        "name": "<string>",
        "protected": "<bool>"
    }
]

 

GET

As with other resources, this resource is subject to the global parameters mentioned in the REST Overview.

 

PUT

The following JSON parameters are available when updating a resource:

 

JSON Parameter Allowed values
alive

boolean

description string
name string
display_order integer

 

POST

The following JSON parameters are required when creating a resource:

 

JSON Parameter Allowed values
name string
field_type

enum:

  • image
  • project
field_display_type

enum:

  • ​suggestion
  • fixedSuggestion
  • option
  • singleLine
  • multiLine
  • ​date

 

 

Below is an example of creating a new field:

curl \
-H "Authorization: Basic YWRtaW46YWRtaW4=" \
http://my.openasset.example.org/REST/1/Fields \
-D - \
-X POST \ 
-d '
  {
  ​  "name": "TEST TEST TEST",
  ​  "field_type": "image",
  ​  "field_display_type": "singleLine"
  ​}'

 

Successful POST response:

HTTP/1.1 201 Created

{
   "message" : "Field 33 with name TEST TEST TEST created.",
   "new_id" : "33"
}

DELETE

The resource can be deleted using this verb and including the id in the endpoint URL.

 

 

 

 

Last modified

Tags

This page has no custom tags.

Classifications

This page has no classifications.