Skip to content
Snippets Groups Projects
PersonAPIwRESTv2.md 4.71 KiB
Newer Older
This tutorial demonstrates how to create a connection within Informatica Intelligent Cloud Services (IICS) using the RESTv2 connector to connect to the [Mock Person API](https://developer.wisc.edu/docs/mock-person-api/1/overview). In production, you will want to use the non-Mock [Person API](https://developer.wisc.edu/docs/person-api/1/overview). Instructions for requesting access to it are [here](https://developer.wisc.edu/person-api/getting-access) if you don't have access already.
- [Access to IICS](../../on-boarding-to-iics.md)
- [Access to a working IICS secure agent](../../best-practices/secure-agent.md)
- [An App within the UW-Madison Developer Portal](https://developer.wisc.edu/get-started)
### Connections
1. Open a browser window and browse to the [Mock Person API page](https://developer.wisc.edu/docs/person-api/1/routes/people/get). You will need to log in with your NetID. At the very bottom of the page, make note of the Token URL: https<area>://api.wisc.edu/oauth/token

2. In the upper right of the developer.wisc.edu portal, click your name's drop menu and select _Apps_

![Developer API Portal](images/devportallogin.png "Developer API Portal")

3. 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](https://developer.wisc.edu/person-api/getting-access) to gain access to Person API.

![API Keys](images/APIKeys.png "API Keys")

4. [Log into IICS](../../logging-in.md) with your NetID.
5. Chose the _Administrator_ tile in the My Services window.
6. Select _Connections_ in the left pane.
7. Select the _New Connection_ button in the upper right of the window.

![IICS Administrator](images/administrator.png "IICS Administrator")

8. In the _Type_ drop 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<area>://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<area>://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.)

![RESTv2 Settings](images/RESTv2settings.png "RESTv2 Settings")

9. Press the _Test Connection_ button in the upper right of the window to verify the connection is successful.
10. If the connection is successful, press the _Save_ button.
### Usage as a Source in a Mapping
1. 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.

![Selection of Mapping Source](images/mapping1.png "Output Group")

2. In order for the source to be used, you must go to the Request Options of the source and Configure the Request Message

![Request Options](images/mapping2.png "Request Options")

3. 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.

![Request Message](images/mapping3.png "Request Message")

4. 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_.

![Field Mapping](images/mapping4.png "Field Mapping")

5. 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.

![Output Group](images/mapping5.png "Output Group")

### Important Notes
- Web Service connectors enabled by Business Service options do not currently operate with this API. 
- The RESTv2 Connector does not accept swagger files of the OpenAPI3.0 specification (which PersonAPI uses), so the Swagger file must be converted to 2.0 through tools or by hand. There is a link to a converted swagger file provided in this tutorial.