tHttpRequest not giving same results as Postman/JS script

Five Stars

tHttpRequest not giving same results as Postman/JS script

Hi everyone,

 

I'm trying to recreate the logic of a Node JS script in Talend. The script runs calls on GameAnalytics API. A screenshot is attached and the logic is:

 

  1. Request an authentication token (works fine)
  2. Request a list of games with info about them (works fine)
  3. Request URLs for each game (doesn't work)
  4. Fetch the file at the URL (doesn't work because of step 4)

Where I'm struggling is for the 3rd API call that uses 10 parameters (see a screenshot for the JS script and Postman setup). Both the script and Postman return data (an array of URLs) but Talend doesn't give anything. I checked the values passed as parameters and that I'm getting from the globalMap and they look good. When I take the same parameters used in Talend and use them in Postman, it works.

 

So is there anything I should set differently to make this job run? How different are the calls done with a tHttpRequest VS Node JS libraries and Postman?

 

Any help appreciated!

 

Best,

 

Antoine

Forteen Stars

Re: tHttpRequest not giving same results as Postman/JS script

Hi,

 

Why you decide - API does not work?

as I can see from attached screenshots - it tExtractJSON returns 0,  but response contain data

may be an error just in parse JSON settings?

 

what is the response file after tReplicate?

 

cheers

-----------
Highlighted
Five Stars

Re: tHttpRequest not giving same results as Postman/JS script

So when I tested yesterday the file containing the response was empty, no rows. Now I've tested again and it contains what's shown in the attached picture. Not sure what this format is to be honest. Some kind of encoding?

 

Also I noticed the JS script was using a "gzip: true" parameter but I didn't specify anything except accepted encodings in the headers. Please see attached the tHttpRequest component parameters.

 

I'm not a huge Talend user so please forgive my lack of knowledge here Smiley Happy

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download