The API lets you fetch lists of data such as projects, jobs, orders, people, configurations and so on.
URL
(POST) ./list/fields
Examples: /jobs/list/fields
PARAMETERS
None.
RESULTS
The result includes a cols node with a list of all available fields. Each field has these properties:
|
id |
The column ID. |
string |
|
type |
The data type, any of:
|
string |
|
control |
Specifies how a user can select values (e.g. how a UI filter control would be implemented):
|
string |
|
name |
A user friendly title of the field. |
string |
|
desc |
A user friendly description of the field. |
string |
|
fname |
Filter title if different from "title". Whereas "title" is worded to serve as a column header in a list, "ftitle" is focused to be used as a filter control label. |
string? |
|
fdesc |
Filter description/tooltip if different from "desc" |
string? |
|
nullable |
If true then the field can have a null value. |
bool |
|
max |
Optional maximum length of the field value. |
int? |
|
isdata |
True if the field is always included with the results. Generally, these are fields not shown to end users: Internal object identifiers etc. |
bool |
|
iscol |
A column field. A field that can be shown to end users. In the Wordbee system the field is shown in a separate grid column. |
bool |
|
iscoldef |
A default column field. By default this field is shown to the user. |
bool |
|
canquery |
If true then the field can be filtered by means of the layout.query parameter. |
bool |
|
cansort |
If true then data can be sorted by this field. |
bool |
|
canautocomplete |
If true, then you can use the auto-completion service for this field. See ./list/autocomplete (post) |
bool |
|
options |
This is used for filtering or querying purposes. For example: Pickup list fields may require you to know which possible values the field can have. Full details can be found here: Field types and options
Example for an ajax instruction to retrieve the list of all codes and titles. Example for task codes:
Example of a key / value list of options:
|
object? |
|
width |
Optional default user interface width. For example: "10%", "200px" etc. Null means that the width will be adjusted automatically in the web interface. |
string? |
|
uifilter |
Internal use. 0 = no filter, 1 = top, 2 = primary, 3 = secondary |
|
About fields in results
If you execute a query with ./list/full you get:
-
All fields
If you specify your fields when querying ./list, you get:
-
All fields listed in the query's fields parameter
-
And all fields with isdata = true (these cannot be removed)
If you do not specify your fields when querying ./list, you get:
-
And all fields with isdata = true or iscoldef = true
EXAMPLES
A JSON array of fields. An example with jobs when calling /api/jobs/list/fields:
[
{
"id": "id",
"name": "Unique ID",
"desc": "The globally unique string ID of the job, such as 'c2002' or 's773'",
"type": "String",
"cat": "Regular",
"nullable": false,
"isdata": true,
"iscol": true,
"iscoldef": false,
"canquery": false,
"cansort": false,
"max": null,
"width": null,
"uifilter": 0
},
{
"id": "jobid",
"name": "Job ID",
"desc": "The standard or codyt specific job id. For backwards compatibility.",
"type": "Integer",
"cat": "Regular",
"nullable": false,
"isdata": true,
"iscol": true,
"iscoldef": false,
"canquery": true,
"cansort": true,
"max": null,
"width": null,
"uifilter": 0
},
{
"id": "iscodyt",
"name": "Project type",
"desc": "Indicates if project is Standard or Codyt",
"type": "Boolean",
"cat": "Regular",
"nullable": false,
"isdata": true,
"iscol": true,
"iscoldef": true,
"canquery": true,
"cansort": true,
"max": null,
"width": null,
"uifilter": 2
},
{
"id": "status",
"name": "Status Number",
"desc": "Job status, numeric value",
"type": "Integer",
"cat": "Regular",
"nullable": false,
"isdata": true,
"iscol": false,
"iscoldef": false,
"canquery": true,
"cansort": true,
"max": null,
"width": null,
"options": {
"otype": "dic",
"items": [
{
"v": 0,
"t": "Draft"
},
{
"v": 1,
"t": "Not assigned"
},
{
"v": 2,
"t": "Inactive"
},
{
"v": 3,
"t": "Proposal"
},
{
"v": 4,
"t": "Not started"
},
{
"v": 5,
"t": "In progress"
},
{
"v": 6,
"t": "Completed"
},
{
"v": 7,
"t": "Approved"
},
{
"v": 8,
"t": "Closed"
},
{
"v": 9,
"t": "Proposal declined"
},
{
"v": 10,
"t": "Cancelled"
}
]
},
"uifilter": 1
},
....