Index Custom Field
GET/custom-field
Get the list of customizable fields
Description
A custom field is a user-defined field that can be added to various entities. Custom fields allow you to store additional information that is not included in the default fields provided by us.
How to Use
- To use custom fields, you need to create a custom field definition first.
- Once the custom field is created, you can use it in various entities by referencing its key.
Example
- Create a custom field definition with the following body:
- 1st custom field, the generated key will be
custom_field_a
(lower snakecase).
{
"name": "Custom Field A",
"type": "TEXT",
"entity": "FLEET_TASK_INSTANT"
}
- 2nd custom field, the generated key will be
custom_field_b
(lower snakecase).
{
"name": "Custom Field B",
"type": "NUMERIC",
"entity": "FLEET_TASK_INSTANT"
}
- Use the custom field in the
FLEET_TASK_INSTANT
entity by including the custom field key in the body when creating or updating it:
{
"custom_fields": {
"custom_field_a": "Custom Text",
"custom_field_b": 12345
}
}
- When you retrieve the entity, the custom field value will be included in the response:
{
"custom_fields": {
"custom_field_a": "Custom Text",
"custom_field_b": 12345
}
}
Querying Custom Fields
You can query custom fields using the following parameters:
Available Filter
Field Name | Value Type |
---|---|
id | string |
entity | string |
is_active | boolean |
Available Sort
Field Name |
---|
created_on |
updated_on |
Available Search
Field Name |
---|
name |
key |
Example Filter
Value Type | Example |
---|---|
string | FO-0001, "dbffb68c-f5ab-4ec4-83fd-91ca6bc1d1df" |
date | 2010-02-02T20:23:05+07:00 |
float | 90.345 |
Operator Type | Description |
---|---|
gte | Greater Than or Equal |
gt | Greater Than |
lte | Lower Than or Equal |
lt | Lower Than |
eq | Equal |
in | In |
Filter with Format
{Field Name} {Operator} {Value}
Example :
- To Filter single value, with quote
status.name eq 'STARTED'
- To Filter with multiplies values, values is separated by space ('value1' 'value 2' 'value 3')
status.name in ('STARTED' 'ENDED')
Example Search
When using the query param Search, it only searches the Available Search Field Name
Example Sort
Sort Format with Value is asc | desc.
{Field Name} {Value}
Example :
- To sorting by the latest order.
created_on asc
- To sorting by the oldest order.
created_on desc
Request
Responses
- 200
OK