tRestClient get cookie then keep track of it

Highlighted
Four Stars

tRestClient get cookie then keep track of it

Hi,

 

This is my first try using Talend ESB Studio, so I am still learning how it work and how I have to design my workflow.

 

I am trying to connect to an API.

This API need authentication using a POST method, "Basic HTTP" and context variables.

The API then respond with a session ID and a cookie.

 

Talend don't return any error, the webserver logs tell me that a 200 code is returned, so I thing my authentication is ok.

 

In order to continue using the API, I need to keep this session and cookie, but I can't understand how I can keep this informations...

 

I've read some tutorials, some of it provide answers using tJava, doesn't seem to work.

 

 

Do I miss something about tRestClient ?

 

 

By advance, thank you.

Tags (1)
Moderator

Re: tRestClient get cookie then keep track of it

Hello,

Could you give us more information about your workflow? Screenshots of your job design will be enough.

Thanks for your time.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars

Re: tRestClient get cookie then keep track of it

Hi,

 

Thank you for your reply and sorry for being inactive.

 

 

Well, I tried different job designs without having anything working...

 

The best I have for now is tFetchFile.

I think this is ok because the console print me a JSESSIONID response header.

But I can't get this response header in context/global variable in order to reuse it.

 

The real workflow is :

1) POST to login.jsp with username and password parameters

2) Receive the Cookie : JSESSIONID=XXXXXXXXXXXXXXXXXXXX from the response header

3) Store the cookie, use it for every API call needed (like downloading a json)

 

Tried with httpie and it worked.

I can give some URL and testing credential if needed (in PM of course).

 

 

By advance, thank you.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Talend API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now

Getting Started with APIs

Find out how to get started with APIs

Read