Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Custom Fields

Returns a list of all custom fields defined in Crittah.

Data fields

FieldValue typeDescriptionExample
IDCustomFieldstringUnique identifier of the custom field7090fad1-c4da-4488-9ceb-55ee9847edcc
NamestringName of the custom fieldBoxes
Typestring

The custom field type

  • Measurement
  • Date
  • Selector
  • Yes-No
  • Number

Measurement

DescrstringDescription of custom fieldNumber of boxes
DefaultValuestringDefault valueFred
DecimalPlacesintDecimal places if type is numbe2
ManditorybooleanIs the field mandatorytrue
MinimumLengthintwhat is the lengh of the field3
AbbreviationstringField abbreviation used in reports and small displaysBXS

Get custom fields

get all custom fields.

Sample cURL call:

curl -H "Content-Type: application/json"  \
-H "API-AppID: 7090fad1-c4da-4488-9ceb-55ee9847edcc" \
-H "Api-Username: jsmith" \
-H "API-Password: abc123" \
http://[CompanyID].crittah.com/ws/apiv2/json/customfields

JSON Rsponse:

[
   {
    "IDCustomField": "d1caa07e-6867-4f1d-b54b-32c80e63a1b1",
    "Name": "Box Weight",
    "Type": "Measurement",
    "Descr": "Weight of boxes.",
    "DefaultValue": "0",
    "DecimalPLaces": 0,
    "Manditory": true,
    "MinimumLength": 0,
    "Abbreviation": "BXS"
  },
  {
    "IDCustomField": "63d53c06-964a-4b76-bc5f-e9ccad651dc3",
    "Name": "Containers Required",
    "Type": "Yes-No",
    "Descr": "Containers Required",
    "DefaultValue": "0",
    "DecimalPLaces": 0,
    "Manditory": true,
    "MinimumLength": 0,
    "Abbreviation": "CNT"
  }
]

XML Response: 

<?xml version="1.0" encoding="UTF-8"?>
<ArrayOfCustomFieldDefObj xmlns="http://schemas.datacontract.org/2004/07/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<CustomFieldDefObj>
      <IDCustomField>d1caa07e-6867-4f1d-b54b-32c80e63a1b1</IDCustomField>
      <Name>Box Weight</Name>
      <Type>Measurement</Type>
      <Descr>Weight of boxes.</Descr>
      <DefaultValue>0</DefaultValue>
      <DecimalPLaces>0</DecimalPLaces>
      <Manditory>true</Manditory>
      <MinimumLength>0</MinimumLength>
      <Abbreviation>BXS</Abbreviation>
   </CustomFieldDefObj>
   <CustomFieldDefObj>
      <IDCustomField>63d53c06-964a-4b76-bc5f-e9ccad651dc3</IDCustomField>
      <Name>Containers Required</Name>
      <Type>Yes-No</Type>
      <Descr>Containers Required</Descr>
      <DefaultValue>0</DefaultValue>
      <DecimalPLaces>0</DecimalPLaces>
      <Manditory>true</Manditory>
      <MinimumLength>0</MinimumLength>
      <Abbreviation>CNT</Abbreviation>
   </CustomFieldDefObj>
</ArrayOfCustomFieldDefObj>

 

Custom fields for job type

Returns a list of all custom fields configured for a job type. This service provides additional configuration information pertaining to the custom field for this job

Data fields

FieldValue typeDescriptionExample
IDCustomFieldstringUnique identifier of the custom field7090fad1-c4da-4488-9ceb-55ee9847edcc
OrderintThe order to display the custom field in2
NamestringName of the custom fieldBoxes
Typestring

The custom field type

  • Measurement
  • Date
  • Selector
  • Yes-No
  • Number

Measurement

DescrstringDescription of custom fieldNumber of boxes
DefaultValuestringDefault valueFred
AddsToVehiclebooleanIf the custom field is a number or a measure, this value defines if the measure or number is being added to the vehicletrue
DecimalPlacesintDecimal places if type is numbe2
ManditorybooleanIs the field mandatorytrue
MinimumLengthintwhat is the lengh of the field3
AbbreviationstringField abbreviation used in reports and small displaysBXS

Get custom fields

get all custom fields.

Sample cURL call:

curl -H "Content-Type: application/json"  \
-H "API-AppID: 7090fad1-c4da-4488-9ceb-55ee9847edcc" \
-H "Api-Username: jsmith" \
-H "API-Password: abc123" \
http://[CompanyID].crittah.com/ws/apiv2/json/customfields/jobtype/BD176BE9-8C1B-4CD3-9B54-5AD51B2DE3F4

JSON Rsponse:

[
   {
    "IDCustomField": "d1caa07e-6867-4f1d-b54b-32c80e63a1b1",
    "Order": 1,
    "Name": "Box Weight",
    "Type": "Measurement",
    "Descr": "Weight of boxes.",
    "DefaultValue": "0",
    "AddsToVehicle": true,
    "DecimalPLaces": 0,
    "Manditory": true,
    "MinimumLength": 0,
    "Abbreviation": "BXS"
  },
  {
    "IDCustomField": "63d53c06-964a-4b76-bc5f-e9ccad651dc3",
    "Order": 2,
    "Name": "Containers Required",
    "Type": "Yes-No",
    "Descr": "Containers Required",
    "DefaultValue": "0",
    "AddsToVehicle": true,
    "DecimalPLaces": 0,
    "Manditory": true,
    "MinimumLength": 0,
    "Abbreviation": "CNT"
  }
]

XML Response: 

<?xml version="1.0" encoding="UTF-8"?>
<ArrayOfCustomFieldDefMap xmlns="http://schemas.datacontract.org/2004/07/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<CustomFieldDefMap>
      <IDCustomField>d1caa07e-6867-4f1d-b54b-32c80e63a1b1</IDCustomField>
      <Order>1</Order>
      <Name>Box Weight</Name>
      <Type>Measurement</Type>
      <Descr>Weight of boxes.</Descr>
      <DefaultValue>0</DefaultValue>
      <AddsToVehicle>true</AddsToVehicle>
      <DecimalPLaces>0</DecimalPLaces>
      <Manditory>true</Manditory>
      <MinimumLength>0</MinimumLength>
      <Abbreviation>BXS</Abbreviation>
   </CustomFieldDefMap>
   <CustomFieldDefMap>
      <IDCustomField>63d53c06-964a-4b76-bc5f-e9ccad651dc3</IDCustomField>
      <Order>1</Order>
      <Name>Containers Required</Name>
      <Type>Yes-No</Type>
      <Descr>Containers Required</Descr>
      <DefaultValue>0</DefaultValue>
      <AddsToVehicle>true</AddsToVehicle>
      <DecimalPLaces>0</DecimalPLaces>
      <Manditory>true</Manditory>
      <MinimumLength>0</MinimumLength>
      <Abbreviation>CNT</Abbreviation>
   </CustomFieldDefMap>
</ArrayOfCustomFieldDefMap>
  • No labels