invoke_google_api_using_idq - informatica · web viewinvoke google api using idq document author:...

13
VELOCITY Invoke Google API using IDQ DOCUMENT AUTHOR: Abhay Jacob, Informatica Professional Services DOCUMENT OWNER: Abhay Jacob, Informatica Professional Services DATE CREATED: 12/01/2014 LAST UPDATED: 12/02/2014 PROJECT: Google API

Upload: others

Post on 07-Jun-2020

5 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Invoke_Google_API_using_IDQ - Informatica · Web viewInvoke Google API using IDQ document author: Abhay Jacob, Informatica Professional Services document owner: Abhay Jacob, Informatica

VELOCITY

Invoke Google API using IDQ

DOCUMENT AUTHOR:

Abhay Jacob, Informatica Professional Services

DOCUMENT OWNER:

Abhay Jacob, Informatica Professional Services

DATE CREATED: 12/01/2014LAST UPDATED: 12/02/2014

PROJECT: Google API

Page 2: Invoke_Google_API_using_IDQ - Informatica · Web viewInvoke Google API using IDQ document author: Abhay Jacob, Informatica Professional Services document owner: Abhay Jacob, Informatica

TECHINCAL DESIGN DOCUMENT

Table of Contents

THE INTRODUCTION............................................................................................................................................ 2

PRE-REQUISITE............................................................................................................................................................3STEPS TO CONFIGURE A REST WEB SERVICE CONSUMER TRANSFORMATION..............................................................................4DEMO MAPPING – INVOKE GOOGLE PLACE AND DETAIL API..............................................................................................10

Text Search Requests........................................................................................................................................10Place Details.....................................................................................................................................................10

2 of 12 Informatica Velocity

Page 3: Invoke_Google_API_using_IDQ - Informatica · Web viewInvoke Google API using IDQ document author: Abhay Jacob, Informatica Professional Services document owner: Abhay Jacob, Informatica

INVOKE GOOGLE API

THE INTRODUCTION

This document provides guidelines on how to invoke external API using IDQ.

For this implementation, we have used REST Web Service Consumer Transformation to invoke Google API. The REST web service consumer transformation can send a request to an REST web service and receive a response from REST web service. It can send a request to get, post, put, or delete data. This document provides details on using the GET method only.

The request and the response messages contain XML or JSON data with elements that can form a hierarchy.

PRE-REQUISITE

a.) Get the URL for the APIs to be invokedFor example: https://maps.googleapis.com/maps/api/place/textsearch/xml

The details about Google API are provided on the below URLhttps://developers.google.com/places/documentation/index#

b.) Understand the parameters that need to be passed as input to the REST web service. These are generally provided from the API provider. Generally, there will be a set of required and optional parameters that needs to be passed to a REST Web Service

c.) Validate the REST Web Service using SOAP UI. You can create a REST Project in SOAP UI and test the web services functionality passing the required parameters.

Informatica Velocity 3 of 12

Page 4: Invoke_Google_API_using_IDQ - Informatica · Web viewInvoke Google API using IDQ document author: Abhay Jacob, Informatica Professional Services document owner: Abhay Jacob, Informatica

TECHINCAL DESIGN DOCUMENT

d.) Get the XML schema definition for the response of REST web service. The schema objects needs to be created based on schema definition.

Note: If schema definition is not available then the XML response can be used to create the schema objects. Make sure that the XML response contains all the elements of the web service response otherwise the web service response will be impacted

You can take the response XML from the SOAP UI response or simply open the REST web service URL in a web browser.

Below is a screenshot of opening the below Google API URL in web browserhttps://maps.googleapis.com/maps/api/place/textsearch/xml?query=restaurants+in+Sydney&key=AddYourOwnKeyHere

STEPS TO CONFIGURE A REST WEB SERVICE CONSUMER TRANSFORMATION

a.) Create a Schema Object in Developer using a XML Schema or a response XML file.The Schema object can also be created as empty but then the elements would need to be added manually.

It is recommended to create a Schema Object from a XML schema file as it will contain all the required elements for the response XML.If using XML file, make sure all elements expected from the REST Web Service are present in the XML file otherwise the response may not be received correctly.

4 of 12 Informatica Velocity

Page 5: Invoke_Google_API_using_IDQ - Informatica · Web viewInvoke Google API using IDQ document author: Abhay Jacob, Informatica Professional Services document owner: Abhay Jacob, Informatica

INVOKE GOOGLE API

Make sure that the XML file is read correctly and Click on Finish.

Informatica Velocity 5 of 12

Page 6: Invoke_Google_API_using_IDQ - Informatica · Web viewInvoke Google API using IDQ document author: Abhay Jacob, Informatica Professional Services document owner: Abhay Jacob, Informatica

TECHINCAL DESIGN DOCUMENT

b.) Create an IDQ mapping with a source that contains the data for requests that needs to be sent to Google API.

c.) Add an expression after the source and prepare the attributes that need to be sent to REST web service consumer as input.

d.) Add a REST Web Service Consumer Transformation

Use HTTP Method as ‘Get’.For the current scenario, we just want to retrieve information from the Google API

Click on Next:

6 of 12 Informatica Velocity

Page 7: Invoke_Google_API_using_IDQ - Informatica · Web viewInvoke Google API using IDQ document author: Abhay Jacob, Informatica Professional Services document owner: Abhay Jacob, Informatica

INVOKE GOOGLE API

As inputs are not applicable for a GET request, click on Next

Create elements for the outputs as per the output from the web service.The elements can be created manually or import the schema object to add all the elements

Informatica Velocity 7 of 12

Page 8: Invoke_Google_API_using_IDQ - Informatica · Web viewInvoke Google API using IDQ document author: Abhay Jacob, Informatica Professional Services document owner: Abhay Jacob, Informatica

TECHINCAL DESIGN DOCUMENT

Click on Finish after creating the elements

8 of 12 Informatica Velocity

Page 9: Invoke_Google_API_using_IDQ - Informatica · Web viewInvoke Google API using IDQ document author: Abhay Jacob, Informatica Professional Services document owner: Abhay Jacob, Informatica

INVOKE GOOGLE API

e.) After adding the REST Web Service Consumer Transformation in the mapping, Add Argument Ports that corresponds to the parameters that needs to be passed to the web service

Informatica Velocity 9 of 12

Page 10: Invoke_Google_API_using_IDQ - Informatica · Web viewInvoke Google API using IDQ document author: Abhay Jacob, Informatica Professional Services document owner: Abhay Jacob, Informatica

TECHINCAL DESIGN DOCUMENT

f.) Click on Ports -> Method Output -> output Mapping and add all the required ports that need to passed to output

g.) Click on Advanced Properties Specify the URL, Input format and Output Format

10 of 12 Informatica Velocity

Page 11: Invoke_Google_API_using_IDQ - Informatica · Web viewInvoke Google API using IDQ document author: Abhay Jacob, Informatica Professional Services document owner: Abhay Jacob, Informatica

INVOKE GOOGLE API

DEMO MAPPING – INVOKE GOOGLE PLACE AND DETAIL API

A demo mapping has been created to showcase the functionality of REST Web Service Consumer transformation.This mapping calls the Google Place (Text Search) and Details API and performs dual matching between the source records and the records returned by Google APIs helping in identifying the validity of the source records based on Google data.

Below are more details on the Google APIs:

Text Search RequestsThe Google Places API Text Search Service is a web service that returns information about a set of places based on a string. Below URL provide more details:https://developers.google.com/places/documentation/search

Place DetailsOnce you have a place_id or a reference from a Place Search, you can request more details about a particular establishment or point of interest by initiating a Place Details request.Below URL provide more details:https://developers.google.com/places/documentation/details

Below is the screenshot of the mapping design

Informatica Velocity 11 of 12

Page 12: Invoke_Google_API_using_IDQ - Informatica · Web viewInvoke Google API using IDQ document author: Abhay Jacob, Informatica Professional Services document owner: Abhay Jacob, Informatica

TECHINCAL DESIGN DOCUMENT

12 of 12 Informatica Velocity