tExtractJSONFields question - unable extract JSON field

Highlighted
One Star

tExtractJSONFields question - unable extract JSON field

Hey guys - I'm trying to get an authorization token via rest basic authentication. The rest request seems to work okay, but I'm not able to extract the authorization token from the response. Here's what the response looks like:
{"access_token":"asdfwerwerasd2342343245wqerssf",
"token_type":"bearer",
"expires in":"1235"
}
I'm using the tExtractJSONFields to try and extract the "access_token" parameter. See attached screenshot of what I'm doing

Here's how I have the tExtractJSONFields configured:

and here's what how the schema is set:

Unfortunately, the output of the component is null.
Any suggestions would be appreciated.
Moderator

Re: tExtractJSONFields question - unable extract JSON field

Hi,
We can't see the screenshot on our side. Could you please check it? Make sure your screenshot is not bigger than 2MB.

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.
One Star

Re: tExtractJSONFields question - unable extract JSON field

Sabrina,
Thank you for the response. The preview of the post showed that the screenshots loaded successfully - not sure what happened.
I decided to try and use a tJava component to parse it myself. I believe the error is (and this is a fundamental misunderstanding of how Talend works on my end) is that, the tRest component sends the request and the rest of the subjob triggers BEFORE the response is received. So, effectively a NULL value is passed to the rest of the subjob. appears. Not sure how to pass the actual response from tREST to the rest of the subjob... Would it be a wait step or something else?
Better understanding this issue would really help in a lot of ares in using Talend...
So, here's a very simplified example of what I'm doing.
tRest sends request. tJava triggers at the same time. if the simple code in tJava_1 is
    System.out.println(row4.Body);
NULL is printed.
I'm sure this is rudimentary stuff - I really appreciate your help.

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

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog