Skip to main content

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

  1. To use custom fields, you need to create a custom field definition first.
  2. Once the custom field is created, you can use it in various entities by referencing its key.

Example

  1. 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"
}
  1. 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
}
}
  1. 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 NameValue Type
idstring
entitystring
is_activeboolean

Available Sort

Field Name
created_on
updated_on
Field Name
name
key

Example Filter

Value TypeExample
stringFO-0001, "dbffb68c-f5ab-4ec4-83fd-91ca6bc1d1df"
date2010-02-02T20:23:05+07:00
float90.345
Operator TypeDescription
gteGreater Than or Equal
gtGreater Than
lteLower Than or Equal
ltLower Than
eqEqual
inIn

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')

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

OK