getFields

Follow

Api/Customers/getFields asks for field configuration set up in your organisation. It can be used for save command.

Requirements

API user needs customers module to access to this command.

Syntax

Api/Customers/getFields

This command does not need any parameters, except API key.

Response

Inside fields element, there is list of field elements, what contain following elements:

  • id: unique number of field
  • type: what system type this field has. For possible values, see subtopic below.
  • name: human-readable name

Those fields are defined under settings - customers dialog.

System types

Default, all fields have text type, but all possible values are:  

 

text, number, id, name, combo, date, html, address-1..address-7, latitude, longitude, m_style, phone, link, email, personid, visitCount, visitGroup, visitDrive
  • text: just any text
  • number: all field values must contain number
  • id: field contains customer unique identificator. In save command, it's recommended to use externalId instead.
  • name: on that field lies customer name. In save command, it's recommended to use name instead.
  • combo: field contains array of values
  • date: field contains date in format YYYY-mm-dd
  • html: field contains hypertext document
  • address-1, .. address-7: those fields contain parts of customer address. It's recommended to create customer with rawaddress, though.
  • latitude, longitude: world coordinates. For saving, it's better to use coordinates in location parameter.
  • m_style: field contains marker style of that customer. Possible values: circle, star, diamond, cross, dcross (diagnonal cross), square, triangle
  • phone: field contains telephone number
  • link: field contains web address
  • email: field contains e-mail address
  • personid: field contains person number, only who can see specific customer
  • visitCount: part of target visits feature
  • visitGroup: part of target visits feature
  • visitDrive: part of target visits feature

 

Field types determine, what values can insert to each columns via save command.

Example

Here is how one example query may look like:

 

XML: query: https://app.ecofleet.com/seeme/Api/Customers/getFields?key=apidemo-NJ8V7PENgkau5FYH
<?xml version="1.0" encoding="utf-8" ?>
<nodes>
  <status>0</status>
  <meta></meta>
  <response>
    <fields>
      <field>
        <id>35467</id>
        <type>id</type>
        <name>id</name>
      </field>
      <field>
        <id>33096</id>
        <type>name</type>
        <name>name</name>
      </field>
      <field>
        <id>33097</id>
        <type>address-1</type>
        <name>address</name>
      </field>
      <field>
        <id>33098</id>
        <type>phone</type>
        <name>phone</name>
      </field>
      <field>
        <id>33099</id>
        <type>link</type>
        <name>website</name>
      </field>
    </fields>
  </response>
</nodes>
JSON: Query: https://app.ecofleet.com/seeme/Api/Customers/getFields?key=apidemo-NJ8V7PENgkau5FYH&json
	{
"status":0,
"meta":{},
"response":{
  "fields":{
    "___xmlNodeValues":[{
        "___xmlNodeName":"field",
        "field":{
          "id":35467,
          "type":"id",
          "name":"id"
        }
      },{
        "___xmlNodeName":"field",
        "field":{
          "id":33096,
          "type":"name",
          "name":"name"
        }
      },{
        "___xmlNodeName":"field",
        "field":{
          "id":33097,
          "type":"address-1",
          "name":"address"
        }
      },{
        "___xmlNodeName":"field",
        "field":{
          "id":33098,
          "type":"phone",
          "name":"phone"
        }
      },{
        "___xmlNodeName":"field",
        "field":{
          "id":33099,
          "type":"link",
          "name":"website"
        }
      }]
  }
}
}

Was this article helpful?
0 out of 0 found this helpful