SSIS API Destination
PreviousNext

SSIS API Destination can be used to write data to popular API Data Services using predefined Connector File without learning internals of API Calls. This component also allows you to return API call response as Flat Table after you submit data.

Download SSIS PowerPack

Content

Video Tutorial

Step-By-Step

In this tutorial we will learn how to write data to API Datasource using ZS API Destination. For example purpose we will use Google Sheets Connector and write sample rows but concept is same for other API Connectors too.
  1. Download and Install SSIS ZappySys PowerPack (Skip this if you already installed SSIS PowerPack).

  2. Once you finished the previous step, Open Visual Studio and Create New SSIS Package Project.

  3. Drag and Drop SSIS Data Flow Task from SSIS Toolbox and Double click on it


    SSIS Data Flow Task - Drag and Drop
  4. Drag and drop any source in the data flow designer surface (for this example we will use Dummy Data Source)
    SSIS Dummy Data Source- Drag and Drop
  5. Now drag and drop the ZS API Destination in the design surface.
    SSIS API Destination - Drag and Drop
  6. Select Dummy Data Source and you will see blue arrow coming out from it. Drag Blue arrow on API Destination to link the flow


    SSIS API Destination - Drag and Drop

How to create API Connection Manager

Now lets look at how to create API connection which can be used with API Source or Destination. Basically there are two ways you can create API Connection Manager

Method #1 - Create connection from UI (Recommended)

  1. Double click API Destination to edit. On UI Click [New] Connection.
    SSIS API Destination - Create API Connector

Method #2 - Create connection from Connection Manager Panel

Here is another way of creating connection manager.
  1. Right click in the Connection Manager panel and click on New Connection.
    SSIS Create New Connection
  2. Select ZS-API Connection Manager from the Connection Managers list and Click on Add Button.
    SSIS API Connection - ADD

Configure API Connection

Method #1 - Choose [OData] from Popular Connectors dropdown and Click Continue


SSIS Create New Connection 1

Method #2 - Select Search Online and select the one you need


SSIS Create New Connection 2

Method #3 - Select a local file


SSIS Create New Connection 3

Method #4 - Select Direct Config XML and insert a valid XML connection


SSIS Create New Connection 4

Configure API Destination to write data to API Service

Now let's configure API Destination.
  1. Double click on API Destination to configure it.
  2. In the API Destination, select connection we have created in previous section, select Table > Sheets.
  3. From the Table / EndPoints dropdown choose Table > Sheets.
  4. Now make sure operation dowpdown is selected as Insert.
    SSIS API destination - Select connection
  5. Now click on the mappings tab, some columns are mapped automatically when you come on this UI first time. Verify the columns mapped correctly. For dynamic Row by Row operation you can also map Parameters (starting with $$).
    SSIS API Destination - Select Columns
  6. Now click on the response output tab to check the output columns
    SSIS API Destination - Output Columns
  7. Click OK to save API Destination UI.
  8. From the SSIS toolbox drag and drop Trash Destination on the data flow designer surface.
  9. Now single click on the API Destination, once you see blue arrow from source ... connect it to Trash Destination.
  10. Double click on ZS Trash Destination to Configure it.
    SSIS Trash Destination - Configure
  11. Click on OK button to save Trash Destination configure setting UI.
  12. Execute the package and verify source data in file.
    SSIS API Destination Execute - Table Mode

API Connector Files (for Enterprise Edition Only)

Following Pre-Configured API connectors are now available with our brand new API Source and API Destination.

How to parametrize values

There are mainly three ways you can parameterize for API Destination. Check this help page to learn more about this approach.

Method #1 - Mapping Screen (Map Upstream column to Parameter)

In previous section we saw how to Map Parameter to some upstream column to do row-by-row operation which gives you dynamic value for parameter at runtime. However there is one drawback for this approach. When you map Parameter on mapping screen (i.e. Map $$ prefixed names) it always invokes row-by-row operation regrdless Target has Bulk support or not.

Method #2 - Placeholder Engine


SSIS API Source / Destination - Using Variable for Dynamic Value

Method #3 - SSIS Expression


SSIS Expression Editor - Use of Variable / Parameters

Properties

Property Name Description
TableName Table name. This option only used when AccessMode=Table
Parameters Parameters overrides for selected endpoint. Value set of these parameters overrides any default value defined in API Template
ContinueOnUrlNotFoundError If this option is true then component will continue without exception on 404 error (Url not found). This allows you to consume data gracefully.
ContineOnAnyError Continue when any type of exception occurs during http request
ContineOnErrorForMessage Continue on error when specified substring found in response
ContineOnErrorForStatusCode Continue on error when specified status code returned from web server
ConsumeResponseOnError When error occurs no data is returned. Use this option to get content eventhough error occurs. When this option is checked you can't use [continue on error when specific string found in response] option
ErrorStatusCodeToMatch Status code to match when error occurs and ContineOnErrorForStatusCode option is true. If Response status code matches to this code then task continues to run
ErrorStatusCodeToMatchRegex Status code(s) to match - separated by vertical bar (e.g. 404|405). When error occurs and ContineOnErrorForStatusCode option is true then if StatusCode matches to this code(s) then task continues to run
ErrorSubstringToMatch Error substring to match when error occurs and ContineOnErrorForMessage option is true. If Response status code matches to this code then task continues to run
Operation Specifies operation for destination data load (e.g. Insert, Update, Delete etc). Default operation is Insert.

Available Options (Use numeric value listed in bracket if you have to define expression on this property (for dynamic behavior).

Option Description
Insert [0] Insert (i.e. Create New)
Update [1] Update
Delete [2] Delete
Lookup [3] Lookup
Upsert [4] Upsert (Update or Insert)
Select [5] Select
OutputRaw Output raw data instead of parsed rows/columns in the response output for downstream. This option is ignored if EnableResponseOutput is not true.
LoggingMode LoggingMode determines how much information is logged during Package Execution. Set Logging mode to Debugging for maximum log.

Available Options (Use numeric value listed in bracket if you have to define expression on this property (for dynamic behavior).

Option Description
Normal [0] Normal
Medium [1] Medium
Detailed [2] Detailed
Debugging [3] Debugging
PrefixTimestamp When you enable this property it will prefix timestamp before Log messages.
DoNotCreateOutputs Enable / Disable Response Output. Checking this option can remove unwanted warnings about unused Columns and many times speedup performance so if output is not needed set this option to True so its removed.

Error Handling

  • This component supports error output.
  • Any bad value will cause Error or Truncation (e.g. If your sample value is 5 character long but output column length is set to 3 chars). If you have error output attached with RedirectRow option on Error, Truncation then you can capture bad rows along with exact reason of error.
  • Use error handling tab to set option for error handling. By default component fails on any data error or truncation issue

Settings UI

SSIS API Destination Setting-UI - Settings
SSIS API Destination Setting-UI - Mappings
SSIS API Destination Setting-UI - Response Output
SSIS API Destination Setting-UI - General
SSIS API Destination Setting-UI - Error Handling

FAQ

References

See Also

Articles / Tutorials

Click here to see all articles for [SSIS API Destination] category
Export API Table Data to SQL Server in SSIS

Export API Table Data to SQL Server in SSIS

ZappySys provides high performance drag and drop connectors for API Integration. In this post you will see how to Export API Table Data to SQL Server Table using SSIS API Destination. API Destination supports SQL language to query API data. API is a powerful, open source relational database with strong reputation for reliability, feature robustness, and performance. […]


Load API Table Data to CSV File in SSIS

Load API Table Data to CSV File in SSIS

Introduction ZappySys provides high performance drag and drop connectors for API Integration. In this post you will see how to Load API Table Data to CSV File using SSIS API Destination. API Destination supports SQL language to query API data. API is a powerful, open source relational database with strong reputation for reliability, feature robustness, and performance. In […]



Copyrights reserved. ZappySys LLC.