Integratec API Platform
addressTableExport

Description

Exports data from an address table to a database.

Remarks

addressTable must be one of the following.

  • The ID of an address table. The ID of an address table is guaranteed to be unique.
  • The name$ prefix plus the name of an address table. The name of an address table is not required to be unique. However, if you use the name$ prefix to reference an address table with a name that is not unique, there is an error. In this case, you must refer to the address table by its ID.
  • The file$ prefix plus the name of a JSON file representing an address table, excluding extension. The file name must be lower case and have an extension of .json. The file must be in the addresstables/ folder.

index must be one of the following.

  • The ID of an index. The ID of an index is guaranteed to be unique.
  • The name$ prefix plus the name of the index. The name of an index is the same as the ID of the index.
  • default$. The value of the INDEXNAME property in the parent address table resource is used as the ID of the index.

selectivity must be one of the following.

  • The ID of a selectivity. The ID of a selectivity is guaranteed to be unique.
  • The name$ prefix plus the name of a selectivity. The name of a selectivity is not required to be unique. However, if you use the name$ prefix to reference a selectivity with a name that is not unique, there is an error. In this case, you must refer to the selectivity by its ID.
  • default$. The value of the SEL_ID property in the parent address table resource is used as the ID of the selectivity.
  • An object representing a selectivity.

destination object

The destination object defines the database to export data to.

classId is the class of database and is an enumeration of the following values.

  • csv - Comma Separated Values file, as defined in RFC 4180.
  • dbf - dBASE or FoxPro file.
  • delimited - Delimited file. This is similar to csv except that the record delimiter, field delimiter character and field quote character are user-defined.
  • fixed - Fixed length file.

connection is the file name. If classId is dbf and the extension is not specified, it uses .dbf.

Example

Request

This request exports to a dBASE or FoxPro file. It uses the selectivity property to define selection criteria for the address table records.

{
"addressTable": "7112661645",
"selectivity": "0267163171",
"index": null,
"overwrite": true,
"destination": {
"classId": "dbf",
"connection": "MyListExport",
"schema": {
"dbaseLevel": 7,
"fields": [
{
"fieldName": "City",
"fieldType": "string",
"fieldSize": 30
},
{
"fieldName": "State",
"fieldType": "string",
"fieldSize": 2
},
{
"fieldName": "ZIPCode",
"fieldType": "string",
"fieldSize": 10
}
]
}
},
"fieldMappings": [
{
"sourceField": "CITY",
"destField": "City"
},
{
"sourceField": "STATE",
"destField": "State"
},
{
"sourceField": "ZIPCODE",
"destField": "ZIPCode"
}
]
}

Reply

The reply provides information about the records processed.

{
"recordsProcessed": 57032,
"recordsSelected": 26867,
"recordsAdded": 26867,
"fieldsCopied": 53734,
"fieldsNotCopied": 26867
}

recordsProcessed is the number of address table records processed.

recordsSelected is the number of address table records that meet the selectivity criteria.

recordsAdded is the number of records added to the destination database.

fieldsCopied is the number of field values copied to the destination database.

fieldsNotCopied is the number of field values not copied to the destination database due to an unresolved field reference in the fieldMappings object.

Request Schema

{
"$schema":"http://json-schema.org/draft-04/schema#",
"description":"Exports data from an address table.",
"type":"object",
"required":[
"addressTable",
"destination",
"fieldMappings"
],
"properties":{
"addressTable":{
"title":"Address Table",
"description":"Resource item identifying the address table.",
"type":"string",
"pattern":"(?i)^([0-9]{10}|name\\$.+|file\\$[a-z]+)$"
},
"index":{
"title":"Index",
"default":null,
"oneOf":[
{
"description":"Resource item identifying the index to use.",
"type":"string",
"pattern":"(?i)^((?!name\\$|default\\$).*|name\\$.+|default\\$)$"
},
{
"description":"Indicates that no index is to be used.",
"type":"null"
}
]
},
"selectivity":{
"title":"Selectivity",
"default":null,
"oneOf":[
{
"description":"Resource item identifying the selectivity to use.",
"type":"string",
"pattern":"(?i)^([0-9]{10}|name\\$.+|default\\$)$"
},
{
"description":"Indicates that no selectivity is to be used.",
"type":"null"
},
{
"description":"Defines a selectivity to use by its object representation, excluding the 'id' and 'name' properties.",
"type":"object",
"properties":{
"expression":{
"title":"Expression",
"description":"Expression defining the condition that a record must satisfy to be sampled.",
"default":null,
"oneOf":[
{
"type":"string",
"minLength":1
},
{
"type":"null"
}
]
},
"sampleInterval":{
"title":"Interval Sample",
"description":"Interval at which to sample records; if negative, the sample is inverted.",
"default":null,
"oneOf":[
{
"type":"integer"
},
{
"type":"null"
}
]
},
"sampleRandom":{
"title":"Random Sample",
"description":"Probability of a record being sampled at random.",
"default":null,
"oneOf":[
{
"type":"number",
"minimum":0,
"maximum":1
},
{
"type":"null"
}
]
},
"sampleMaximum":{
"title":"Maximum Sample",
"description":"The maximum number of records to be sampled.",
"default":null,
"oneOf":[
{
"type":"integer",
"minimum":0
},
{
"type":"null"
}
]
}
},
"additionalProperties":false
}
]
},
"destination":{
"title":"Destination",
"description":"Destination table.",
"type":"object",
"required":[
"classId",
"connection",
"schema"
],
"properties":{
"classId":{
"title":"Class ID",
"description":"Database class ID.",
"type":"string",
"enum":[
"csv",
"dbf",
"fixed",
"delimited"
],
"enumValues":[
{
"value":"csv",
"displayValue":"Comma Separated Values",
"description":"Comma Separated Values file, as defined in RFC 4180, with ANSI encoding."
},
{
"value":"dbf",
"displayValue":"dBASE/FoxPro",
"description":"dBASE or FoxPro table."
},
{
"value":"fixed",
"displayValue":"Fixed Length",
"description":"Fixed length text file, with ANSI encoding."
},
{
"value":"delimited",
"displayValue":"Delimited",
"description":"Delimited text file, with ANSI encoding."
}
]
},
"connection":{
"title":"Connection",
"description":"Database connection parameters.",
"type":"string",
"minLength":1
},
"schema":{
"title":"Schema",
"description":"Defines the structure of the table.",
"type":"object",
"required":[
"fields"
],
"properties":{
"dbaseLevel":{
"title":"dBASE Level",
"description":"File format version of the dBASE file.",
"default":5,
"enum":[
5,
7
],
"enumValues":[
{
"value":5,
"displayValue":"dBASE IV/dBASE 5/Visual dBASE 5",
"description":"File format compatible with dBASE IV, dBASE 5 and Visual dBASE 5."
},
{
"value":7,
"displayValue":"Visual dBASE 7",
"description":"File format compatible with Visual dBASE 7."
}
]
},
"recordDelimiter":{
"title":"Record Delimiter",
"description":"String used in the delimited file to indicate the end of a record.",
"type":"string",
"minLength":1
},
"fieldDelimiter":{
"title":"Field Delimiter",
"description":"Character used in the delimited file to indicate the end of a field value and the start of the next field value.",
"type":"string",
"minLength":1,
"maxLength":1
},
"fieldQuote":{
"title":"Field Quote",
"description":"Character used in the delimited file to quote a field value as needed.",
"type":"string",
"minimum":1,
"maxLength":1
},
"fields":{
"title":"Fields",
"description":"Definitions of the fields in the table schema.",
"type":"array",
"minItems":1,
"items":{
"type":"object",
"required":[
"fieldName",
"fieldType"
],
"properties":{
"fieldName":{
"title":"Field Name",
"description":"Name of the field in the table schema.",
"type":"string",
"minLength":1
},
"fieldType":{
"title":"Field Type",
"description":"Type of the field in the table schema.",
"type":"string",
"enum":[
"autoInc",
"boolean",
"currency",
"date",
"dateTime",
"float",
"integer",
"memo",
"smallInt",
"string",
"word"
],
"enumValues":[
{
"value":"autoInc",
"displayValue":"Auto-Increment",
"description":"Auto-incrementing 32-bit signed integer value."
},
{
"value":"boolean",
"displayValue":"Boolean",
"description":"Boolean value."
},
{
"value":"currency",
"displayValue":"Currency",
"description":"Currency value."
},
{
"value":"date",
"displayValue":"Date",
"description":"Date value."
},
{
"value":"dateTime",
"displayValue":"Date/Time",
"description":"Date/time (timestamp) value."
},
{
"value":"float",
"displayValue":"Floating Point",
"description":"Floating point numeric value."
},
{
"value":"integer",
"displayValue":"Integer",
"description":"32-bit signed integer value."
},
{
"value":"memo",
"displayValue":"Memo",
"description":"Binary value."
},
{
"value":"smallInt",
"displayValue":"Small Integer",
"description":"16-bit signed integer value."
},
{
"value":"string",
"displayValue":"String",
"description":"String value."
},
{
"value":"word",
"displayValue":"Word",
"description":"16-bit unsigned integer value."
}
]
},
"fieldSize":{
"title":"Field Size",
"description":"Size, or length, of the field in the table schema.",
"type":"integer",
"minimum":0,
"maximum":65535
}
},
"additionalProperties":false
}
}
},
"additionalProperties":false
}
},
"additionalProperties":false
},
"overwrite":{
"title":"Overwrite",
"description":"Indicates whether or not to overwrite an existing table.",
"default":false,
"type":"boolean"
},
"fieldMappings":{
"title":"Field Mappings",
"description":"Maps source fields in the address table to destination fields.",
"type":"array",
"items":{
"type":"object",
"required":[
"sourceField",
"destField"
],
"properties":{
"sourceField":{
"title":"Source Field",
"description":"Field reference identifying the source field in the address table.",
"oneOf":[
{
"description":"Identifies a field by name.",
"type":"string",
"minLength":1
},
{
"description":"Identifies a field by display name.",
"type":"object",
"required":[
"displayName"
],
"properties":{
"displayName":{
"title":"Display Name",
"description":"Display name to match to a field.",
"type":"string",
"minLength":1
}
},
"additionalProperties":false
},
{
"description":"Identifies a field by address group and data type.",
"type":"object",
"required":[
"addressGroup",
"dataType"
],
"properties":{
"addressGroup":{
"title":"Address Group",
"description":"Address group to match to a field.",
"oneOf":[
{
"type":"integer",
"minimum":1,
"maximum":255
},
{
"type":"string",
"minLength":1
}
]
},
"dataType":{
"title":"Data Type",
"description":"Data type to match to a field.",
"oneOf":[
{
"type":"integer",
"minimum":1,
"maximum":255
},
{
"type":"string",
"minLength":1
}
]
}
},
"additionalProperties":false
}
]
},
"destField":{
"title":"Destination Field",
"description":"Name of the field in the destination table.",
"type":"string",
"minLength":1
}
},
"additionalProperties":false
}
}
},
"additionalProperties":false
}

Reply Schema

{
"$schema":"http://json-schema.org/draft-04/schema#",
"type":"object",
"required":[
"recordsProcessed",
"recordsSelected",
"recordsAdded",
"fieldsCopied",
"fieldsNotCopied"
],
"properties":{
"recordsProcessed":{
"title":"Records Processed",
"description":"Number of records processed from source tables.",
"type":"integer",
"minValue":1
},
"recordsSelected":{
"title":"Records Selected",
"description":"Number of records selected from source tables.",
"type":"integer",
"minValue":1
},
"recordsAdded":{
"title":"Records Added",
"description":"Number of records added to the address table.",
"type":"integer",
"minValue":1
},
"fieldsCopied":{
"title":"Fields Copied",
"description":"Number of fields copied.",
"type":"integer",
"minValue":1
},
"fieldsNotCopied":{
"title":"Fields Not Copied",
"description":"Number of fields not copied because a source or destination field reference is incorrect.",
"type":"integer",
"minValue":1
}
},
"additionalProperties":false
}