Kourier Integrator Online Help

REST Export Specification

Purpose

This page defines a Kourier REST Export Specification, which is used to implement an outbound REST Resource or Sub-Resource.

A REST Export Specification has two parts: selection and fields. The selection portion of the specification allows you to specify any selection criteria and define interface parameters to be used when calling the REST Resource. The fields portion lists the fields to be included in the REST Resource, the column headings to use, data conversions, formulas, etc.

Here's the typical work flow when creating a REST Export Specification:

  1. Create a REST export and add one or more line items to define the data fields returned.
  2. Use the Test command to verify the REST export is returning the correct data.

Available Toolbar Commands 

Click the New icon in the toolbar to save the current REST export specification and then reset the page for new data entry.

Click the Save icon in the toolbar to save the current REST export specification and return to the export specifications listing.

Click the Save and Stay icon in the toolbar to save the REST export specification and continue working.

Click the Save As icon in the toolbar to save the current REST export specification to a new name. You will be prompted to enter a new name. Click OK to save the export to a new name and then continue editing the export. Click Cancel to return to the existing export without saving.

Click the Delete icon in the toolbar to delete the current REST export specification. You will be prompted with a "Are you sure you want to delete?" dialog. Clicking Yes will permanently delete the export and then return to the export specifications listing. Click Cancel to return to the existing export without deleting.

Click the Test icon in the toolbar to test the REST export specification and display the results of the data selection as defined using the data selection criteria and any parameters. This will perform a sample data extract using all of the information entered and then output the results to the screen where it can be viewed and validated. Typically a test is performed to ensure that the correct data fields are being extracted and all data conversions, formats, and formulas are working correctly.

After clicking the Test icon, you will see a dialog requesting additional information:

  • Sample Number of records: Defaults to 100. This number determines how many records are processed and exported to the screen.
  • Record IDs to export: If you want to test individual records, enter one or more item ids separated by commas. Entering a value here overrides the sample number of records.
  • Request Headers: Enter the name(s) of your HTTP request headers followed by a space followed by it's value. Each header should be entered on a single line.
  • Fields: Enter your HTTP header fields.
  • Sort By: Used to control the order in which items are returned in the request result. This query parameter accepts a comma separated list of field names each with a possible unary negative (-) to imply descending sort order.
  • Page: Used to control pagination of requests that return a large number of items. This query parameter takes a numeric value representing the first item to return in the record set.
  • Per Page: Used to control pagination of requests that return a large number of items. This query parameter takes a numeric value representing the number of items to return in the result set. This number cannot be greater than the value returned in the X-Max-Items Header field.
  • Output As: Select an output format.
  • Dynamic Parameters: There may be one or my dynamic parameters (e.g., Customer, Part Number, etc) shown in the Test dialog if any have been defined, enter valid data into those fields to qualify the data selection.

Click the Continue button to view the results or click the Cancel button to return to the RESTful Interface specification page.

For this feature to work correctly you will need to: 1) Add the Kourier website as a trusted site so pop-up dialogs appear and 2) enable the automatic prompting for downloads option in your browser's internet options (e.g., for Internet Explorer this setting is found in Security | Custom Level dialog).


To see the runtime statistics for an individual export, click the Statistics icon from the toolbar. This will take you to the Export Statistics listing which displays all export statistics that have been captured for the export.

Click the Help balloon to open the help for this page.

File/Key Field

KT_EXPORTS/Export Name

Fields

Field Name

Description - Usage - Notes

Name

Enter a unique name for the export. By convention, exports are named using an Integration ID such as KS for KommerceServer, followed by an underscore and a string that describes its purpose (e.g. KS_CONTACTS).

Title

Enter a short descriptive name for this export. This name is displayed in on-line lookups.

Export Format

Enter the export format. If the export verb is KEXPORT, the possible choices are shown below. Other export verbs (normally user-written BASIC programs) may or may not support these formats.

Format

Description

TAB

Data values are delimited by the tab character. Use this format to generate files that can be automatically loaded in the Excel or other PC applications.

FIXED

Data values are of a fixed length. Each column in the export will be padded with blank characters to the length of the column.

XML

Data values are enclosed in XML tags.

JSON

Data values are returned in JSON format.

HTML

Data values are enclosed in standard HTML tags.

ASCII

Data is exported in flat file format where each attribute appears on a separate line. Value marks and sub-value marks are embedded in each line. This format is similar to wIntegrate's ASCII format.

CSV

Data values are delimited by the comma character. If a data value is non-numeric, it is enclosed by the double quote character. If a data value contains the double quote character, it will be duplicated.

PIPE

Data values are delimited by the pipe character. This format is often used when interfacing with Oracle systems.

TILDE

Data values are delimited by the tilde character.

Last Update

Display only field. Shows the last date/time that the export specification was saved.

Note

Enter a free form comment or note for this Export Specification. If a note is entered, a small icon will display on the Export Specification listing. Hovering your mouse over the icon will display about 40 characters of the note.

Select Verb

Enter a valid verb to perform the selection, such as select or sselect.

For UniData systems, ECLTYPE “P” and ECLTYPE “U” syntax is supported. For ECLTYPE “P”, use the upper case version of the select verb. For ECLTYPE “U”, use the lower case version of the select verb.
To ensure that wildcard characters can be specified in a URL, you must use the uppercase version of the select verb.

The export processor first processes the selection portion of the screen, and then passes the selected items to the export section. The selection portion of the screen can be used to limit the number of records exported.

Select Data File

Enter the name of the data file to use to select data records for exporting.

Parameters

Enter the parameters associated with this outbound REST resource. To enter a list of parameters click the Add link. Doing so opens the REST Export Parameters window.

You can define any number of parameters for the resource and reference those parameters in the SELECT statement. Parameters are passed in the URL as query strings.

Each parameter should be entered on a single line and may include any number of keywords to specify additional constraints on the parameter value passed in the query string.

To see a complete list of REST Export Parameters.

If the passed parameter does not meet the constraints specified, the REST request will not be processed and an error message is returned.

Using File

Enter the name of the file that contains the dictionary items referenced in the select statement.

To use the dictionary file with the same name as the data file, leave this field empty. For example, if you enter CUSTOMER as the data file and do not enter a using file, the CUSTOMER dictionary file is used.

To specify an alternate dictionary file, enter DICT and the file name.

To specify a data file that contains dictionary items you want to use, enter the file name.

Select Statement

Enter the selection criteria statement using standard U2 query syntax.

For example, if you want to select all of the CUSTOMER records with PHONE 619], enter WITH PHONE 619] in the Statement field. This field may also contain substitution tags.

If you are defining a Kourier RESTful Web Service, use the Select statement to define the parameters to pass to the Web Service. For example, if you wanted to use the State (attribute F51) and City (attribute F50) as parameters, you would need to include those attributes in your defined Line Item Fields, and then use this for the Select statement: WITH F51 = "{%1}" AND WITH F50 = "{%2}"

Export Data Files

Enter the name of the data file to use to export data records.

Using File

Enter the name of the file that contains the dictionary items referenced in the export statement.

To use the dictionary file with the same name as the export data file, leave this field empty. For example, if you enter CUSTOMER as the data file and do not enter a using file, the CUSTOMER dictionary file is used.

To specify an alternate dictionary file, enter DICT and the file name.

To specify a data file that contains dictionary items you want to use, enter the file name.

Export Verb Requires Select List

If enabled, then an active select list (or an empty selection criteria) must be present before the export statement will be executed. If disabled, the export statement should be processed even if an active select list is not present. 

Export Options

Enter any valid export options.

Option

Usage

COL.HDR.SUPP

Use this option to suppress columnar headings. Syntax is: COL.HDR.SUPP

EXPORT-REPEAT-VALUES

If this option is specified, Kourier will repeat the last non-null value or sub-value of a field. Syntax is: EXPORT-REPEAT-VALUES

EXPORT-SUBNAME

Used by the KEXPORT command to specify the name of the export subroutine associated to the export. Syntax is: EXPORT-SUBNAME "subroutinename".

XML-FORM-TAG

When creating an XML export, this option indicates the form tag of the XML document. Syntax is: XML-FORM-TAG "elementname".

XML-ROOT-TAG

When creating an XML export, this option indicates the root element tag of the XML document. Syntax is: XML-ROOT-TAG "elementname". Default value is: Kourier file=export_data_file

XML-TRANS-TAG

When creating an XML export, this option indicates the transaction tag of the XML document. Syntax is: XML-TRANS-TAG "elementname". Default value is: Trans id=@ID

EXPORT-MAX-ITEMS

Use this option to specify the maximum number of items that can be returned in a single request result.

Event Handler

Refer to the Export Specification Event Handlers topic for detailed information on Event Handlers.

Line Item Fields

Click the add button in the line item section command bar to add a new line item field or click the Line number to edit an existing line item. For more information on each individual field, see the help for an Export Specification Line Item

Related Topics: 

Introduction to Kourier Integrator REST Resources

REST Export Parameters

Export Event Handlers