Four Stars

Extract JSON parameters from trestClient response

Hello,

 

I receive a String containing a JSON from my tRestClient response. How I can extract a parameter from that JSON?


Thanks.

2 REPLIES
Community Manager

Re: Extract JSON parameters from trestClient response

Try to use tExtractJsonField to extract data from the json response. Let me know if you have troubles to use this component and show an example of json response.
----------------------------------------------------------
Talend | Data Agility for Modern Business
Four Stars

Re: Extract JSON parameters from trestClient response

I don't know how to take the 'id' parameter from that json using tExtractJsonField .

 

Here's an example of that json:

 

{
  "id": "cus_test",
  "object": "customer",
  "account_balance": 0,
  "created": 1493201430,
  "currency": null,
  "default_source": null,
  "delinquent": false,
  "description": "Living",
  "discount": null,
  "email": "test@test.com",
  "livemode": false,
  "metadata": {},
  "shipping": null,
  "sources": {
    "object": "list",
    "data": [],
    "has_more": false,
    "total_count": 0,
    "url": "/v1/customers/cus_test/sources"
  },
  "subscriptions": {
    "object": "list",
    "data": [],
    "has_more": false,
    "total_count": 0,
    "url": "/v1/customers/cus_test/subscriptions"
  }
}