Integratec API Platform
addressTableCreateFromTemplate

Description

Creates an address table from an address table template.

Remarks

template is either the file name of the address table template in JSON format or an inline address table template object. If the extension is not specified, it uses .json. If the path is relative, it is relative to the path to the addresstables/templates/ folder.

templateName is the file name of the address table template in BCC Mail Manager format. If the extension is not specified, it uses .mwt. If the path is relative, it is relative to the path to the addresstables/templates/ folder.

addresstable object

The addresstable object defines the address table to create.

classId must be dbf.

connection is the dBASE or FoxPro file name associated with the address table. If the extension is not specified, it uses .dbf. If the path is relative, it is relative to the path to the addresstables/ folder.

name is the name of the address table.

template object

fields defines the fields in the table schema.

indexes defines the indexes. This is an array of index resources, excluding the id property. These are added to the address table if and only if the useIndexes property is true.

layouts defines the layouts. This is an array of layout resources, excluding some properties. These are added to the address table and the first layout becomes the default layout.

selectivities defines the selectivities. This is an array of selectivity resources, excluding the id property. These are added to the address table.

Example for Template in JSON Format

Request

This request creates an address table associated with a new database, created using parameters defined by the template property, and overwrites any existing address table associated with the same database.

{
"addressTable": {
"classId": "dbf",
"connection": "test"
},
"overwrite": true,
"template": {
"fields": [
{
"fieldName": "COMPANY",
"fieldSize": 50,
"fieldType": "string"
},
{
"fieldName": "DELADDR",
"fieldSize": 50,
"fieldType": "string"
},
{
"fieldName": "CITY",
"fieldSize": 28,
"fieldType": "string"
},
{
"fieldName" :"STATE",
"fieldSize": 2,
"fieldType": "string"
},
{
"fieldName": "ZIPCODE",
"fieldSize": 9,
"fieldType": "string"
}
],
"indexes":[
{
"name": "COMPANY",
"expression": "UPPER(COMPANY)"
},
{
"name": "CSZ",
"expression": "UPPER(CITY+STATE+ZIPCODE)"
}
],
"layouts":[
{
"fields":[
{
"name": "COMPANY",
"addressGroup": "MAIN",
"dataType": "Company"
},
{
"name": "DELADDR",
"addressGroup": "MAIN",
"dataType": "DeliveryAddress"
},
{
"name": "CITY",
"displayName":" City",
"addressGroup": "MAIN",
"dataType": "City"
},
{
"name": "STATE",
"displayName": "State",
"addressGroup": "MAIN",
"dataType": "State"
},
{
"name": "ZIPCODE",
"displayName": "ZIP+4",
"addressGroup": "MAIN",
"dataType": "ZIPCode9Digit"
}
]
}
],
"selectivities":[
{
"name": "NY",
"expression": "STATE=\"NY\""
}
]
},
"useIndexes": true
}

Reply

id is the ID of the new address table.

{
"id": "1234567890"
}

Example for Template File in JSON Format

Request

This request creates an address table associated with a new database, created using parameters defined by templatefile.json, and overwrites any existing address table associated with the same database.

{
"addressTable": {
"classId": "dbf",
"connection": "test"
},
"overwrite": true,
"template": "templatefile",
"useIndexes": true
}

templatefile.json

{
"fields": [
{
"fieldName": "COMPANY",
"fieldSize": 50,
"fieldType": "string"
},
{
"fieldName": "DELADDR",
"fieldSize": 50,
"fieldType":" string"
},
{
"fieldName": "CITY",
"fieldSize": 28,
"fieldType": "string"
},
{
"fieldName": "STATE",
"fieldSize": 2,
"fieldType": "string"
},
{
"fieldName": "ZIPCODE",
"fieldSize": 9,
"fieldType": "string"
}
],
"indexes": [
{
"name": "COMPANY",
"expression": "UPPER(COMPANY)"
},
{
"name": "CSZ",
"expression": "UPPER(CITY+STATE+ZIPCODE)"
}
],
"layouts":[
{
"fields": [
{
"name": "COMPANY",
"addressGroup": "MAIN",
"dataType": "Company"
},
{
"name": "DELADDR",
"addressGroup": "MAIN",
"dataType": "DeliveryAddress"
},
{
"name": "CITY",
"displayName": "City",
"addressGroup": "MAIN",
"dataType": "City"
},
{
"name": "STATE",
"displayName": "State",
"addressGroup": "MAIN",
"dataType": "State"
},
{
"name": "ZIPCODE",
"displayName": "ZIP+4",
"addressGroup": "MAIN",
"dataType": "ZIPCode9Digit"
}
]
}
],
"selectivities": [
{
"name": "NY",
"expression": "STATE=\"NY\""
}
]
}

Reply

id is the ID of the new address table.

{
"id": "1234567890"
}

Example for Template File in BCC Mail Manager Format

Request

This request creates an address table associated with a new database, created using parameters defined by Business Mailing List With Route Information.mwt, and overwrites any existing address table associated with the same database.

{
"addressTable": {
"classId": "dbf",
"connection": "test"
},
"overwrite": true,
"templateName": "Business Mailing List With Route Information",
"useIndexes": true
}

Reply

id is the ID of the new address table.

{
"id": "1234567890"
}

Request Schema

{
"$schema":"http://json-schema.org/draft-04/schema#",
"description":"Creates an address table from a template.",
"type":"object",
"oneOf":[
{
"required":[
"addressTable",
"templateName"
]
},
{
"required":[
"addressTable",
"template"
]
}
],
"properties":{
"addressTable":{
"title":"Address Table",
"description":"Address table parameters.",
"type":"object",
"required":[
"classId",
"connection"
],
"properties":{
"classId":{
"title":"Class ID",
"description":"Database class ID.",
"type":"string",
"enum":[
"dbf"
],
"enumValues":[
{
"value":"dbf",
"displayValue":"dBASE/FoxPro",
"description":"dBASE or FoxPro table."
}
]
},
"connection":{
"title":"Connection",
"description":"Database connection parameters.",
"type":"string",
"minLength":1
},
"schema":{
"title":"Schema",
"description":"Table schema.",
"type":"object",
"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."
}
]
}
},
"additionalProperties":false
},
"name":{
"title":"Name",
"description":"Address table name.",
"type":"string",
"minLength":1
}
},
"additionalProperties":false
},
"overwrite":{
"title":"Overwrite",
"description":"Indicates whether or not to overwrite an existing address table with the same Class ID and Connection.",
"default":false,
"type":"boolean"
},
"template":{
"title":"Template",
"oneOf":[
{
"description":"Name of the template file; path and extension are optional.",
"type":"string",
"minLength":1
},
{
"description":"Defines a template without requiring a template file.",
"type":"object",
"required":[
"fields"
],
"properties":{
"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
}
},
"indexes":{
"title":"Indexes",
"description":"Defines the indexes.",
"type":"array",
"items":{
"title":"Index",
"description":"Defines an index by its object representation, excluding the `id` property.",
"type":"object",
"required":[
"name",
"expression"
],
"properties":{
"name":{
"title":"Name",
"description":"Name of the index",
"type":"string",
"minLength":1
},
"expression":{
"title":"Expression",
"description":"Database expression.",
"type":"string",
"minLength":1
},
"unique":{
"title":"Unique",
"description":"`true` if the index is unique, `false` if it allows non-unique values.",
"type":"boolean"
},
"descending":{
"title":"Descending",
"description":"`true` if the index is ascending, `false` if the index is descending.",
"type":"boolean"
}
},
"additionalProperties":false
},
"additionalItems":false
},
"layouts":
{
"title":"Layouts",
"description":"Defines the layouts.",
"type":"array",
"items":
{
"description":"Defines a layout.",
"type":"object",
"properties":{
"fields":{
"title":"Fields",
"description":"Defines the fields in the layout.",
"type":"array",
"items":{
"type":"object",
"required":[
"addressGroup",
"dataType"
],
"properties":{
"name":{
"title":"Name",
"description":"Name of the field.",
"type":"string",
"minLength":1
},
"displayName":{
"title":"Display Name",
"description":"Display name of the field.",
"type":"string",
"minLength":1
},
"addressGroup":{
"title":"Address Group",
"description":"Address group of the field.",
"oneOf":[
{
"type":"integer",
"minimum":1,
"maximum":255
},
{
"type":"string",
"minLength":1
}
]
},
"dataType":{
"title":"Data Type",
"description":"Data type of the field.",
"oneOf":[
{
"type":"integer",
"minimum":1,
"maximum":255
},
{
"type":"string",
"minLength":1
}
]
}
},
"additionalProperties":false
}
}
},
"additionalProperties":false
}
},
"selectivities":{
"title":"Selectivities",
"description":"Defines the selecivities.",
"type":"array",
"items":
{
"description":"Defines a selectivity by its object representation, excluding the `id` property.",
"type":"object",
"properties":{
"name":{
"title":"Name",
"description":"Name of the selectivity.",
"type":"string",
"minLength":1
},
"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
},
"additionalItems":false
}
},
"additionalProperties":false
}
]
},
"templateName":{
"title":"Template Name",
"description":"Name of the binary template file; path and extension are optional.",
"type":"string",
"minLength":1
},
"useIndexes":{
"title":"Use Indexes",
"description":"Indicates whether or not to use the indexes defined in the template.",
"default":false,
"type":"boolean"
}
},
"additionalProperties":false
}

Reply Schema

{
"$schema":"http://json-schema.org/draft-04/schema#",
"type":"object",
"required":[
"id"
],
"properties":{
"id":{
"title":"ID",
"description":"Identifies the newly created address table.",
"type":"string",
"minLength":1
}
},
"additionalProperties":false
}