REST API Reference > Data Integration REST API > Fixed-width configuration
  

Fixed-width configuration

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, the fixed-width federated ID, or fixed-width format name in the URI. If you include the federated ID, the response includes the project and folder location of the fixed-width format. Use one of the following URIs:
/api/v2/fwConfig/<id>
/api/v2/fwConfig/frs/<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
String
Fixed-width format ID.
name
String
Fixed-width format name.
description
String
Description of the fixed-width format.
createTime
Date/time
Time that the fixed-width format was created.
updateTime
Date/time
Last time that the fixed-width format was updated.
createdBy
String
User who created the fixed-width format.
updatedBy
String
User who last updated the fixed-width format.
lineSequential
Boolean
Whether each row ends with a newline character.
  • - True. Line sequential is enabled.
  • - False. Line sequential is not enabled.
padBytes
Int
Number of bytes between the last column of one row and the first column of the next.
skipRows
Int
Number of rows to skip. You can skip blank or header rows.
nullChar
String
The character to represent a null value.
dateFormat
String
Default date format to use when a date format is not specified in the flat file connection.
nullCharType
String
Determines if the null character is single-byte or multibyte.
repeatNullChar
Boolean
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
Boolean
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.
location
String
The project and folder that the fixedd-width file resides in.
columns
String
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": "org1@infa.com",
"updatedBy": "org1@infa.com",
"lineSequential": true,
"padBytes": 0,
"skipRows": 0,
"nullChar": "*",
"nullCharType": "ASCII",
"repeatNullChar": false,
"stripTrailingBlank": false,
"location": Default\\MyProject
"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 create a fixed-width format, use the following URI:
/api/v2/fwConfig
If you want to specify a location for the fixed-width format, include the container ID in the request. If the container ID isn't included in the request, the fixed-width format is created in the Default folder. You can find the container ID for a project or folder in the Data Integration user interface. On the Explore page, select the folder. In the URL, the last string of characters is the container ID.
For example, in the following URL, the container ID is dH2DuGJYda7ijgW4Sm32sR
https://na1.dm-us.informaticacloud.com/diUI/products/integrationDesign/main/Explore/dH2DuGJYda7ijgW4Sm32sR
To update a fixed-width format, include the fixed-width format ID in the following URI:
/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
String
Yes
Fixed-width format ID.
name
String
Yes
Fixed-width format name.
description
String
Description of the fixed-width format.
containerId
String
ID of the project or folder to contain the linear taskflow.
If not included in request, the linear taskflow is created in the Default folder.
lineSequential
Boolean
Yes
Whether each row ends with a newline character.
  • - True. Line sequential is enabled.
  • - False. Line sequential is not enabled.
padBytes
Int
Yes
Number of bytes between the last column of one row and the first column of the next.
skipRows
Int
Yes
Number of rows to skip. You can skip blank or header rows.
nullChar
String
Yes
The character to represent a null value.
dateFormat
String
Yes
Default date format to use when a date format is not specified in the flat file connection.
nullCharType
String
Yes
Determines if the null character is single-byte or multibyte.
repeatNullChar
Boolean
Yes
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
Boolean
Yes
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
String
Yes
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 <serverURL>/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

To delete a fixed-width format, use the fixed-width format ID in the following URI:
/api/v2/fwConfig/<id>

DELETE response

Returns the 200 response code if the request is successful.
Returns the error object if errors occur.