Use the fwConfig resource to configure column widths for flat file source, lookup, and target objects.
GET Request
To request all of the fixed-width formats, use the following URI:
/api/v2/fwConfig
To request the details of a particular fixed-width format, you can include the fixed-width format ID or fixed-width format name in the URI. Use one of the following URIs:
/api/v2/fwConfig/<id>
/api/v2/fwConfig/name/<name>
If you use the fixed-width format name in the URI and the fixed-width format name includes a space, replace the space with %20. For example:
/api/v2/fwConfig/name/my%20fixedwidth%20format
GET Response
The fwConfig object returns the following attributes:
Field | Type | Description |
---|---|---|
id | Fixed-width format ID. | |
name | Fixed-width format name. | |
description | Description of the fixed-width format. | |
createTime | Time that the fixed-width format was created. | |
updateTime | Last time that the fixed-width format was updated. | |
createdBy | User who created the fixed-width format. | |
updatedBy | User who last updated the fixed-width format. | |
lineSequential | Whether each row ends with a newline character. True. Line sequential is enabled. False. Line sequential is not enabled. | |
padBytes | Number of bytes between the last column of one row and the first column of the next. | |
skipRows | Number of rows to skip. You can skip blank or header rows. | |
nullChar | The character to represent a null value. | |
dateFormat | Default date format to use when a date format is not specified in the flat file connection. | |
nullCharType | Determines if the null character is single-byte or multibyte. | |
repeatNullChar | Determines how to treat null characters in a single field. True. Read repeat null characters as a single null value. False. does not read repeat null characters as a single null value. | |
stripTrailingBlank | Determines how to treat trailing blanks in string values. True. Removes trailing blanks from string values. False. Does not remove trailing blanks in string values. | |
columns | Includes the following attributes for each column: name. Name of the column. nativeType. Native data type. precision. Length of the field in bytes. scale. Number of digits after the decimal point for numeric values. |
GET Example
The following example shows a request to get details for a fixed-width format using the fixed-width format ID:
GET <serverUrl>/api/v2/fwConfig/00001R29000000000002
Accept:application/json
icSessionId: <icSessionId>
The following text is a sample response:
"@type": "fwConfig",
"id": "00001R29000000000002",
"orgId": "00001R",
"name": "item",
"description": "",
"createTime": "2016-10-06T17:08:09.000Z",
"updateTime": "2016-10-06T17:08:09.000Z",
"createdBy": "[email protected]",
"updatedBy": "[email protected]",
"lineSequential": true,
"padBytes": 0,
"skipRows": 0,
"nullChar": "*",
"nullCharType": "ASCII",
"repeatNullChar": false,
"stripTrailingBlank": false,
"dateFormat": "",
"columns": [
{
"@type": "fwColumn",
"name": "COLUMN_0",
"nativeType": "string",
"precision": 1,
"physicalLength": 0,
"scale": 0
},
{
"@type": "fwColumn",
"name": "COLUMN_1",
"nativeType": "string",
"precision": 9,
"physicalLength": 0,
"scale": 0
},
{
"@type": "fwColumn",
"name": "COLUMN_2",
"nativeType": "string",
"precision": 10,
"physicalLength": 0,
"scale": 0
}
]
}
POST Request
To update a fixed-width format, use the fixed-width format ID in the following URI. To create a fixed-width format, omit the optional ID.
/api/v2/fwConfig/<id>
You can submit a partial update using partial mode. If you want to update a field in the fwColumn object using partial mode, you must include the name. To submit a request using partial mode, use a JSON request and include the following line in the header:
Update-Mode=PARTIAL
You can use the following attributes in a fwConfig POST request:
Field | Type | Required | Description |
---|---|---|---|
id | Fixed-width format ID. | ||
name | Fixed-width format name. | ||
description | Description of the fixed-width format. | ||
lineSequential | Whether each row ends with a newline character. True. Line sequential is enabled. False. Line sequential is not enabled. | ||
padBytes | Number of bytes between the last column of one row and the first column of the next | ||
skipRows | Number of rows to skip. You can skip blank or header rows. | ||
nullChar | The character to represent a null value. | ||
dateFormat | Default date format to use when a date format is not specified in the flat file connection | ||
nullCharType | Determines if the null character is single-byte or multibyte. | ||
repeatNullChar | Determines how to treat null characters in a single field. True. Read repeat null characters as a single null value. False. does not read repeat null characters as a single null value. | ||
stripTrailingBlank | Determines how to treat trailing blanks in string values. True. Removes trailing blanks from string values. False. Does not remove trailing blanks in string values. | ||
columns | Includes the following attributes for each column: name. Name of the column. nativeType. Native data type. precision. Length of the field in bytes. scale. Number of digits after the decimal point for numeric values. |
POST Response
If successful, returns the fwConfig object that you created or updated. Returns the error object if errors occur.
POST Example
POST /api/v2/fwConfig/00000103000000000004
Content-Type: application/json
Accept: application/json
{
"@type": "fwConfig",
"name": "FW_FILE_CONFIG_1",
"description": "Test description",
"lineSequential": false,
"padBytes": 1,
"skipRows": 2,
"nullChar": "*",
"nullCharType": "ASCII",
"repeatNullChar": false,
"stripTrailingBlank": false,
"columns": [
{
"@type": "fwColumn",
"name": "ASCII",
"nativeType": "string",
"precision": 10
}
]
}
DELETE Request
/api/v2/fwConfig/<id>
To delete a fixed-width format, use the fixed-width format ID in the following URI:
DELETE Response
Returns the 200 response code if the request is successful.
Returns the error object if errors occu