Informatica Cloud API and App Integration - API Implementation and Management Workshop
Informatica Cloud API and App Integration - API Implementation and Management Workshop
Table of Contents
GOAL ............................................................................................................................................................ 3
SYNOPSIS .................................................................................................................................................... 3
APPENDIX .................................................................................................................................................. 41
Goal
In this session, you will learn how to use API and Application Integration capabilities which are
available as part of Informatica Intelligent Cloud Services Platform to:
Synopsis
Create your first API: Hello World
Learn the basics of creating Processes using Cloud Application Integration and exposing them
as APIs.
The retail clothing company also has distributors who can place bulk orders by using the APIs
that the company provides.
John is a developer for the retail clothing company. John creates business workflows and
implements each flow in Informatica Cloud Application Integration. Then, he exposes the flow
as an API. Since the API is not secured, it is vulnerable to misuse.
Mia is an IT Administrator for the company. Mia decides to use Informatica Cloud API Manager
to manage the API that John created. She applies policies to the API to secure it also provide
visibility so that other users can find the API on Informatica Cloud API Portal.
Then, Cathy can use the API behind the scenes when she places an order on the company’s
website. The company’s distributors can also use the API since they can access it now in
Informatica Cloud API Portal.
The company can also monitor and track the API’s use in Informatica Cloud API Manager.
4
Steps Screenshot
Login to Informatica Intelligent Cloud Services (IICS)
• Enter Username
• Enter Password
• Click Log In
Review Explorer
Go to Start Tab
• Go to Assignments
In this lab, we would be automating Order Initiation using Cloud Application Integration. This is
how the flow looks like:
1. Customer provides Order Details (e.g. ItemName, ItemCount) and personal information
(e.g. CustomerName, CustomerEmail)
2. Item is looked-up in the inventory for the availability.
3. If item is found:
a. Fetch details from inventory on margins for this item.
b. Send emails to Customer and Vendor with order confirmation details.
c. Respond back to the Customer with Order Status, Order ID, Item Price and Order
price.
4. If item is not found:
a. Respond back to the Customer with “Item not in stock. Apologies for the
inconvenience.” Status.
• Get Inventory Detail – This is a Service Connector. It defines the means to connect to a
third-party webservice and details on the operations, endpoint, input and output for these
operation(s).
• Get-Inventory-Detail – This is a Connection for above service connector.
Follow below steps to import Cloud Application Integration artifacts into Cloud Platform.
1. Go to https://network.informatica.com/docs/DOC-17733 and download the “Get
Inventory Detail Connector.zip” file. Save it on your local file system.
2. Click on “Import” button on top right corner and import the downloaded file following
below steps:
12
4. Click Import.
5. Post Import, you can go to “My Import/Export Logs” and click on “Get Inventory Detail
Connector” to get details on Import process.
13
6. Importing these artifacts will come with their own Project/Folder hierarchy. It would have
automatically created a Project “Order Management” and a folder “Shared” inside the
project. The artifacts would be inside the “Shared” folder”. The assets would be in Published
state.
1. Go to “Lab Exercise” folder and Click “New” > Processes > Create to create a new
Process.
2. This will open Process Designer. You will see process with Start and End Steps already
configured. We will be filling the business logic between “Start” and “End”.
3. Select “Start” Step. We will define the input and output for this process as explained above:
a. Go to “General”. Here we configure basic process properties around
name/description.
i. Give this process a meaningful name in the “Name” field. We will call it
“Initiate Order”.
b. Go to “Start”. Here we need to configure process properties around accessibility.
i. Binding=REST/SOAP. This property defines the accessibility for this process.
With this setting, the process would be available as a WebService over HTTP
ii. Allowed Users=<your IICS username>. This property defines who can invoke
this service. You can use multiple users as well.
16
iii. Run On=Cloud Server. This property defines the execution environment for
this process. We have chosen the default value, Cloud Server.
e. Go to “Advanced” and set the Tracing Level to Verbose. This will help you debug
by viewing field data and execution path.
Setting the Tracing Level to Verbose can cause performance degradation. Set it back to None once you deploy
the process to production.
We also understand that it is virtually impossible to build native connectors for each system as
they run into thousands. However, we live in the age of “standards” where each of these
systems offer API interface.
Cloud Application Integration provides a “visual” way to create connections to any of such
systems via REST API. We call them Service Connectors (but they are more like creating
connectors on-the-fly). This is in addition to supporting native connectors like File, AMQP, JDBC.
It is a mere 5-min, less than 10-click process to create a service connector as long as the third-
party system has a web service interface for access, for which the service definition is available
in standard format, and user have access to the third-party system through credentials, if any
required.
1. Drag and drop Service Step (or double-click on the link and choose Service Step
from dropdown) between Start and End Step.
2. Go to “General”. Name the Step as “Get Inventory Detail”.
3. Go to “Service”. Here we need to select the service/operation that we need to call.
a. Choose Service Type=Connection, Connection=Order Management > Shared >
Get-Inventory-Detail and Action=getInventoryDetail.
b. You would see the service description below along with Input needed by the
service and Output fields given out by the service.
4. Go to “Input Fields”. Add Field using as:
1. Drag and drop Assignment Step between Get Inventory Detail and End Step.
2. Go to “General”. Name the Step as “Assign Order Details”.
3. Go to “Assignments”. Add fields using and assign value to the output fields as
given below.
For Value=Formula, open the Formula Editor , click on the field name and “Add”
Note: Field names are case-sensitive
2. Here, you will see details on service Endpoints and the service definition .
Click on this link to see service details (Operation, Authentication, Input and Output).
3. We will now invoke this process as a service using browser. Copy the service URL
using “Copy” button and paste it in a separate browser window.
22
4. Add Input parameters to this request. You final URL should look like this:
<Service
URL>?CustomerName=TestConsumer&CustomerEmail=testconsumer@mailinator.c
om&ItemName=item1&ItemCount=2
You may be asked for authentication. In case, you are asked, please use your Cloud
account details for authentication.
5. You should see a successful response; something like:
{"Status":"Your order is
accepted.","OrderID":"178749969799331840","ItemPrice":50.0,"OrderPrice
":100.0}
6. Go to “My Processes” . You will see the process execution details here.
23
username testuser2
password password2#
b. Go to Actions > Input and set the input request for the action as given below:
c. Go to Actions > Test Results and click Test button. You should see a
successful response.
6. Save the Service Connector.
7. Publish the Service Connector.
We will now augment the Process to calculate margin and commission using the connection we
just created.
1. Close and open “Initiate Order” Process.
2. Go to Start step > Temp Fields and add a new field by clicking on . This field will be
used as input to the Get Margin Detail Service
3. Add a new field as:
a. Name=InventoryDetails, Type=More Types > Connection defined Types > Order
Management > Lab Exercise > Get-Margin-Detail and choose
Calculate_Margin_ServiceRequest.
4. Go to Assign Order Details Assignment Step and Add Field:
5. Drag and drop Service Step between Assign Order Details Assignment Step and End
Step.
25
username testuser2
password password2#
27
b. Go to Actions > Input and set the input request for the action as given below:
6. Go to Actions > Test Results and click Test button. You should see a successful
response.
7. Save the Service Connector.
8. Publish the Service Connector.
We will create a Connection for this Service Connector that defines connection to this Service.
1. Go to New > App Connections and click Create. You will see an edit dialogue.
2. Fill in the details as given below:
a. Name= Email-Service
b. Location= Order Management\Lab Exercise
c. Description=<As per your choice>
d. Type= Order Management > Lab Exercise > Email Service
e. Run On=Cloud Server or any Secure Agent
3. Also, fill in the Connection Properties as:
a. hostname= na1.ai.dm-us.informaticacloud.com:443
b. username= testuser2
c. password= password2#
4. Save the Connection.
5. Publish the Connection.
6. Metadata tab shows the Actions available for this connection as well as Input and
Output for the action.
28
d. Go to Temp Fields and add a new field by clicking on . This field will be used as
input to the Email Service Service. Add a new field as:
• Name=Email, Type=More Types > Connection defined Types > Order
Management > Lab Exercise > Email-Service and choose
Email_ServiceRequest.
e. Go to “Advanced” and set the Tracing Level to Verbose. This will help you debug
by viewing field data and execution path.
Setting the Tracing Level to Verbose can cause performance degradation. Set it back to None once you deploy the
process to production.
4. Drag and drop Assignment Step between Start and End Step.
a. Go to “General”. Name the Step as “Create Email”.
b. Go to Assignments and assign value to the output fields as given below:
5. Drag and drop Service Step between Create Email Assignment Step and End Step.
6. Go to “General”. Name the Step as “Call Email Service”.
7. Go to “Service”. Here we need to select the service/operation that we need to call.
a. Choose Service Type=Connection, Connection= Order Management > Lab Exercise >
Email-Service and Action=Email_ServiceOperation.
b. You would see the service description below along with Input needed by the service
and Output fields given out by the service.
8. Go to “Input Fields”. Assign body as Field “Email”.
9. Save the Process.
10. Publish the Process.
30
2. Drag and drop Parallel Paths Step between Get Margin Detail and End Step.
3. Go to “General”. Give a meaningful name to this Step. We will name it “Send Emails”.
Hint: You can add more parallel paths by going to “Parallel Paths” tab and add using
4. Drag and drop Subprocess Step on Path 0 (Top path). Configure this as given below:
a. Go to “General”. Give a meaningful name to this Step. We will name it “Send
Email to Consumer”.
b. Go to “Subprocess”. Select the Process as “Send Email”. You would see the
process description below along with Input needed by the process and Output
given out by the process.
c. Go to “Input Fields” tab and add Inputs as given below:
5. Drag and drop Subprocess Step on Path 1 (Bottom path). Configure this as given below:
a. Go to “General”. Give a meaningful name to this Step. We will name it “Send
Email to Vendor”.
b. Go to “Process”. Select the Process as “Send Email”. You would see the process
description below along with Input needed by the process and Output given out
by the process.
c. Go to “Input Fields” tab and add Inputs as given below:
31
Message Content Order has been accepted. The order ID is: {$output.OrderID}. <br>Please
note below details for your records. <br><br>Overall Profit:
{$output.Calculate_Margin_ServiceResponse[1]/MarginBeforeCommission}
<br>Sales Commission:
{$output.Calculate_Margin_ServiceResponse[1]/SalesCommission}
<br>Profit after Commission:
{$output.Calculate_Margin_ServiceResponse[1]/MarginAfterCommission}
<Service
URL>?CustomerName=TestConsumer&CustomerEmail=testconsumer@mailinator.com
&ItemName=item1&ItemCount=2
You will be asked for authentication. Please use your Cloud account details for
authentication.
4. You should see a successful response; something like:
{"Status":"Your order is
accepted.","OrderID":"178749969799331840","ItemPrice":50.0,"OrderPrice"
:100.0}
5. Additionally, you will see Emails into two email accounts, testvendor@mailinator.com
and testconsumer@mailinator.com. To do this:
a. Go to www.mailinator.com
b. Search for testconsumer
c. Search for testvendor
d. Review the emails.
6. Go to “My Processes” and click refresh . You will see the process execution
details here.
33
<Service
URL>?CustomerName=TestConsumer&CustomerEmail=testconsumer@mailinator.com
&ItemName=item7&ItemCount=2
2. The response would be:
{"error":{"code":500,"detail":{"reason":"{\"status\":\"not_found\"}","c
ode":"HTTP_404"},"message":"{\"status\":\"not_found\"}"}}
3. Go to “My Processes” and click refresh . You will see the process
execution details here.
4. Click on “Id” link and review the process execution flow. It indicates that fault occurred
at “Get Inventory Detail” Step.
5. To handle this fault, go to “Initiate Order” Process and select “Get Inventory Detail” Step.
34
6. Go to “Fault Handling” and check “Catch Faults”. This will create a fault handling branch
in the process as shown below.
7. We want to calculate margin and send emails when we do not fault. Hence, we need to
move the success path on the non-faulted branch. We will do this by dragging and
dropping each of the steps one-by-one on the success branch.
35
https://na1.ai.dm-us.informaticacloud.com/active-
bpel/rt/Initiate_Order?CustomerName=TestConsumer&CustomerEmail=testconsumer@
mailinator.com&ItemName=item7&ItemCount=2
You will be asked for authentication. Please use your Cloud account details for
authentication.
2. The response would be:
{"Status":"Item not in stock. Apologies for the inconvenience."}
3. Go to “My Processes” and click refresh .. You will see the process
execution details here.
4. Click on “Id” link and review the process execution flow. It indicates that fault occurred
at “Get Inventory Detail” Step but the process did not fault and completed successfully
with the expected message.
37
We will learn how to put this API under Management and consume these managed APIs. Let’s
introduce you to the two IICS Services that helps you do that:
Prerequisite: In order to invoke the serviceYou need to assign Service Consumer role to the user
invoking this service. You can do this by going to Administrator (Application) -> Users -> Click on
<username> and assign Service Consumer role, as illustrated below:
API Manager
Control and manage your APIs by applying authentication and authorization, rate limits, IP
filtering, versioning and more. With API Management analytics, get insight on your APIs’
consumption, trends, events and exceptions. This service caters to the Administrator persona
which controls the API access to different roles.
38
API Portal
Promote broader use of your APIs and offer consumer developers through an easy-to-access
API Portal that includes API information, “try it” capabilities, SDK generation and more. This
service caters to Developer persona who are keen on discovering and consuming the APIs.
3. You would be taken to API Registry page which shows all the available services
(REST/SOAP) in the org. You will see something like:
4. You can create a Managed API for an available API by clicking Actions > Create
Managed API. With this, the service will become available with a different URL that you
can apply policies on and perform analytics. We will create Initiate_Order API with REST
Protocol into a Managed API.
39
5. Choose appropriate API name. For this lab, we will use the default name as shown
below. Click Create.
6. This will make the API Status as Active. It indicates that the API is now available through
a URL from API Manager.
7. Copy the URL by clicking on Actions > Copy URL and suffix the request parameters (as
we did earlier). Request parameters are:
CustomerName=TestConsumer&CustomerEmail=testconsumer@mailinator.com&It
emName=item1&ItemCount=2
40
There are other key features of API Manager that we will let you explore on your own.
Apply rate limit policies per API through Actions > View Details > Rate Limit OR for all the APIs
in the org by going to Policies tab.
Perform Analytics on the API invocations using the Analytics tab. This includes:
Overview tab
You can use the Overview page in the Analytics page to view graphical summary information
about APIs, including trends in usage over time, APIs with the most invocations, and the most
frequent users.
Activity Log
You can use the Activity Log tab in the Analytics page to view managed APIs access requests
for a selected date range.
Event Log
You can use the Event Log tab in the Analytics page to view policy breaches on managed APIs
for a selected date range.
API Versioning
Test and validate your APIs - Use API Versioning to control your API lifecycle.
Caching
Shorten response time and off load your backend - Use API Caching.
41
Appendix
Learn More
Visit below link to learn more about Informatica Cloud Application Integration,
• Searching an issue
• Browse the content by Categories
• Latest updates
https://network.informatica.com/community/informatica-network/products/cloud-
integration/cloud-application-integration