Using Components: Rest API Destination

The REST API destination provides access to send data to HTTP endpoints, such as REST Web Services. Use the REST API destination component to define the authentication method, request parameters, headers, and request body.

Authentication

  • None - No authentication
  • Basic - Use basic authentication (username and/or password).
  • Connection - Use an Integrate.io ETL connection to handle authentication automatically.

Request and response Configuration

  • Method - The HTTP method to use. Select from POST (default), GET, PATCH, PUT, or DELETE.
  • URL - Enter the destination endpoint URL.
    • You can customize the URL dynamically by inserting record values using the #{fieldName} pattern. Simply wrap the field name in curly braces within the URL.
      Example:  https://your-service.com/#{id}/details.
    • This automatically enables the "Single per record" option for the "Number of requests" setting in the next step.
  • Headers - Optionally, add request headers (name-value pairs).
    • Similar to the URL, you can also dynamically customize headers by inserting record values using the #{fieldName} pattern.
      Example:  Bearer #{token}
    • This automatically enables the "Single per record" option for the "Number of requests" setting.
  • Stop the job if an error is returned by the API - If selected, the job will fail if the API response status is not in the 2xx range.
  • Save responses to file - If selected, you can specify a connection and path for a CSV file where all API responses will be saved. The CSV will contain columns for URL, Response Code, and Response Body.
    • Specify the output path as an existing directory (e.g., /path/to/directory). You can optionally include a filename (e.g., /path/to/directory/custom_name.csv). If no filename is provided, the file will be saved as responses-<job_id>.csv.
    • This option allows the Integrate.io application to display this CSV file in the Job Details view, as shown in the screenshot.
      thumbnail image

Request payload and preview

Body

  • Request format 
    • JSON - Adds application/json Content-Type header if not specified in the headers section.
    • CSV - Adds text/csv Content-Type header if not specified in the headers section.
    • x-www-form-urlencoded - Adds application/x-www-form-urlencoded Content-Type header if not specified in the headers section.
  • Payload type
    • Records - Uses fields from the previous component as the request body.
    • Custom input - Manually specify the request body in the next step.
  • Number of requests
    • Single per record 
      • Sends a single request for each record in the data flow.
      • This is the default for x-www-form-urlencoded request format.
      • Not available for the CSV request format.it is not available for CSV request format
      • Can be used with the #{fieldName} pattern in URLs or headers.
    • Batch requests
      • Sends requests in batches. You can specify the batch size in the input field below.
        thumbnail image
      • Not available for the x-www-form-urlencoded request format.
    • One request
      • Sends only one request for all records.

Records attributes mapping

  1. When JSON Request format and Records Payload type are selected:

    thumbnail image
    You can map fields in the request body. The Input field represents the value from the record, and the Destination column is the attribute name used in the request body.
    You can specify the value type using the Value Type dropdown, which includes options such as String, Number, Boolean, Array, and Object (default is String).

    If the Single per record option is selected, the request body will be a JSON Object.
    If Batch requests or One request options are selected, the request body will be a JSON Array, where items are generated based on the fields mapping table.

    The Send record as a nested attribute option allows sending the record inside a nested attribute, such as properties (as shown in the screenshot).
    You can also define custom attributes with specific values.
    thumbnail image
  2. When JSON Request format and Custom input Payload type are selected.
    thumbnail image
    You can manually specify the exact request body in JSON format in the provided text input.


  3. When CSV Request format and Records Payload type are selected
    thumbnail image
    You can map fields in the request body following the CSV format. The Input field corresponds to the value from the record, and the Destination Column is the column header.

  4. When CSV Request format and Custom input Payload type are selected.
    thumbnail image
    You can specify the exact CSV body format in the input field.

  5. When x-www-form-urlencoded Request format and Custom input Payload type are selected.
    thumbnail image
    You can map fields in the request body using the HTML query parameters standard. The Input field represents the value from the record, and the Destination Column corresponds to the query parameter name.

  6. When x-www-form-urlencoded Request format and Custom input Payload type are selected.
    thumbnail image
    You can specify the exact HTML query parameters format using the fields table.

Request preview

The preview shows how the payload will be structured. It presents the specified format with example values, which will be replaced with real data from the previous component when the job is executed.