-
SAM CARPENTER authoredSAM CARPENTER authored
Contents
- Introduction
- Prerequesites
- Connections
- Usage as Source in Mappings
- Creating Your Own Swagger Files
- Important Notes
Introduction
This tutorial demonstrates how to create a connection within Informatica Intelligent Cloud Services Cloud Data Integration (IICS CDI) using the RESTv2 connector to connect to the Mock Person API. In production, you will want to use the non-Mock Person API. Instructions for requesting access to it are located Here if you don't have access already.
Prerequisites
Connections
-
Open a browser window and browse to the Mock Person API page. You will need to log in with your NetID. At the very bottom of the page, make note of the Token URL: https://api.wisc.edu/oauth/token
-
In the upper right of the developer.wisc.edu portal, click your name's drop menu and select Apps
- Select the application connected to your developer account, then browse to the API Keys section. You will need the Key and the Secret on the IICS portal. If you do not have access to this, please follow these instructions to gain access to Person API.
- Log into IICS with your NetID.
- Chose the Administrator tile in the My Services window.
- Select Connections in the left pane.
- Select the New Connection button in the upper right of the window.
- In the Type dropdown menu:
- Create a Connection Name
- Select REST V2 (Informatica Cloud)
- Select your Runtime Environment
- Select OAuth 2.0-Client Credentials in the drop menu for Authentication
- Paste https://api.wisc.edu/oauth/token in the Access Token URL field (we got this from step 1 above)
- Paste API and Secret from step 3 into the Client ID and Client Secret fields
- Click the Generate Access Token button next to the Access Token field and it will auto-populate
- In the Swagger File Path field, paste https://git.doit.wisc.edu/interop/iics/external-iics-docs/-/raw/master/docs/tutorials/PersonAPI/swagger.json (this is a REST v2 OpenAPI specification file that may be different than the one you use in production later. IICS doesn't currently accept V3 and also frequently refers to this OpenAPI specification as a Swagger file.)
- Press the Test Connection button in the upper right of the window to verify the connection is successful.
- If the connection is successful, press the Save button.
Usage as Source in Mappings
- To use PersonAPI as a source in a mapping, select the connection you just created as the source. To get a list of all people, select get people as the operation.
- In order for the source to be used, you must go to the Request Options of the source and Configure the Request Message
- No request message is required for this specific API function to work, although IICS requires one. Simply add '{}'. This will throw an error message while validating, but will still result in successful access to the data once the mapping is run.
- Go to the Field Mapping tab within the source, and click the boxes on the left for each item you would like to map. Different dropdowns will show up on the right, containing the values you have mapped. These are groups that will be used in the next step. Select data.
- Once you have done Field Mapping, attempt to connect your source to any transformation. This will create a selection menu of several values, each corresponding to the groups seen in the Field Mapping. In this specific case, "data" contains all of the relevant data related to a Student.
Creating Your Own Swagger Files
To perform different operations, you will need to create and host your own Swagger files in the OpenAPI 2.0 Format. IICS provides a tool for the creation of Swagger files, although these can only have one associated operation.
- Log into IICS with your NetID.
- Chose the Administrator tile in the My Services window.
- Select Swagger Files on the left pane.
- Select the New button in the upper right of the window.
- Set the Runtime Enviornment of your Swagger File.
- Set the URL as https://mock.api.wisc.edu and the API Path as /people. Leave the API Base Path blank.
- Note that while there is authentication for the API, you can leave the Authentication as blank in the swagger file, as authorizing requests is handled on the connector level.
- Set the Operation ID to the name of the operation you want to use. This can be found in the API spec.
- Also set the Verb to the one matching the operation. For operations which involve recieving data, this will usually be GET.
- Obtain a response file from PersonAPI for the operation you have selected. This can easily be done using Postman.
- Upload this response file in the Json Response File field.
- Edit the Headers and Query Parameters fields as needed.
- Save your Swagger file. Once you have saved it you can no longer edit it, and must repeat the process from step 5 to make any changes.
- Navigate back to Swagger Files on the left pane.
- Locate the Swagger File you just created in the list below.
- Press the Download button to download the file to your personal computer.
- Host the file somewhere that can be publically accessed, such as a public Gitlab repository.
Once this process is complete, you will be able to use the link to your Swagger file in the Swagger File Path section of the RESTv2 Connector.
Important Notes
- The RESTv2 Connector does not accept swagger files of the OpenAPI3.0 specification (which PersonAPI uses), so the Swagger files must be created using the IICS tool.
- PersonAPI has a strict limit on the amount of requests you can make per minute. Using operations besides Get People may not be feasible in the context of mass data load.