def addField( dbid, label, type, mode = nil )

      @dbid, @label, @type, @mode = dbid, label, type, mode

      if isValidFieldType?( type )
         xmlRequestData = toXML( :label, @label ) + toXML( :type, @type )
         xmlRequestData << toXML( :mode, mode ) if mode

         sendRequest( :addField, xmlRequestData )

         @fid = getResponseValue( :fid )
         @label = getResponseValue( :label )

         return self if @chainAPIcalls
         return @fid, @label
      else
         raise "addField: Invalid field type '#{type}'.  Valid types are " + @validFieldTypes.join( "," )
      end
   end
def addField( dbid, label, type, mode = nil )

      @dbid, @label, @type, @mode = dbid, label, type, mode

      if isValidFieldType?( type )
         xmlRequestData = toXML( :label, @label ) + toXML( :type, @type )
         xmlRequestData << toXML( :mode, mode ) if mode

         sendRequest( :addField, xmlRequestData )

         @fid = getResponseValue( :fid )
         @label = getResponseValue( :label )

         return self if @chainAPIcalls
         return @fid, @label
      else
         raise "addField: Invalid field type '#{type}'.  Valid types are " + @validFieldTypes.join( "," )
      end
   end
------------------------------------------------------------------------------------
 ------------------------------ API_ wrapper methods. --------------------------
 Each method expects the 'Input Parameters' of the equivalent HTTP API request.
 Each method returns the 'Output Parameters' of the equivalent HTTP API response.
 (Ruby methods can return multiple values)
 Input and Output Parameters are all stored in '@' member variables.
 This makes it easy to reuse parameters across multiple requests.
  Methods returning lists can be called with an iteration block, e.g. doQuery(){|record|, puts record } .

  Each method with dbid as the first parameter has a corresponding method with '_' before the name.
  The '_' methods re-use @dbid instead of a requiring the dbid parameter.
 ------------------------------------------------------------------------------------
 API_AddField