Running Jobs with Informatica Cloud REST API

Informatica Cloud offers REST API for us to interact with the platform programmatically. At this point in time, the latest official reference is found here. In this post, we are going to use Python to trigger jobs through API.

Triggering a job is a 2-step process. We need to authenticate with a username and password to retrieve a temporary session id. Then, we can make an API call by using the id. Informatica has an example of running jobs through API with curl here.

Once you understand this process, all the APIs work the same. If you are looking for something specific, you can always look for it in the documentation.

Loading Modules

We are using the requests module for REST API calls. We also need the json module to convert dictionary to string format of JSON.

Authentication

The base URL is the same one as you use to log in through the browser. You do not need to specify org as the user name is unique. The user information needs to be passed as a string, rather than as a dictionary.

On a successful attempt, it returns a session id and server URL which are to be used for subsequent API calls.

Triggering Job

The end point for starting a job is ‘api/v2/job’. This comes after the server URL from the previous call. The temporary session Id is passed in the header. This is a POST request. In the body, we pass the id of the job and the job type. The Id can be found at the end of the url of the job through the UI.

The value for ‘Accept’ in the header needs to be ‘application/xml’ instead of json.

Execution

Now that we have functions to authenticate and trigger jobs, we can execute the entire code. You need to define your user name, password, task id and task type (for example, MTT for Mapping Configuration Task). Then you are ready to go!

ETL
Tips and Troubleshooting For Uploading CSV to Database In Talend

There will be time when you want to upload a big csv file (with many rows and hundreds of columns) to a relational database table. Talend Open Studio is an open source ETL tool that I use regularly to do odd jobs like that. I like using it because it …

ETL
How To Rename Mapping Job In Informatica Cloud

Mappings are where all the magic happens in Informatica Cloud. When I started using it, it took me a while to work out how to rename a mapping job. Since then, a few people asked me the same question. So, I decided to write about it. This is probably the …

ETL
Informatica Cloud: How To Optimise Joiner Performance In Mapping Designer

Joiner is the stage to join tables in Informatica Cloud (see a quick introduction for Joiner Transformation here). If you have a large volume of data, the joiner transformation becomes very slow without performance optimisation. In this post, we will show you a few tricks that you can use to …