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