Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to call json data from http(s) in tRest or tRestclient component in Talend studio for DI

Hi all,

can someone solve this issues?

I'm using fiddler web debug proxy, from that I'm trying to get some JSON data through trest component in Talend open studio for DI.

Following are my credentials.

1.https link

2.Post method

3.content-type : application/json

4.Accept : application/json

50683p000009Ltf8.png0683p000009Ltst.png0683p000009Lu1Z.png.json data as like below

 

{
"Commit": "false",
"Client": "AvaTaxSample",
"CompanyCode": "CYPHERTAX",
"CustomerCode": "ABC4335",
"DocCode": "INV001",
"DocType": "SalesOrder",
"DocDate": "2014-01-01",
"Addresses": [
{
"AddressCode": "01",
"Line1": "2345 Carlmont Drive",
"Line2": "Suite 100",
"Line3": "ATTN Accounts Payable",
"City": "Belmont",
"Region": "CA",
"Country": "US",
"PostalCode": "94002"
}
],
"Lines": [
{
"LineNo": "1",
"DestinationCode": "01",
"OriginCode": "01",
"ItemCode": "N543",
"TaxCode": "NT",
"Description": "Red Size 7 Widget",
"Qty": "1",
"Amount": "100"
}
]
}

 

I couldn't get the results for this.

instead of json data I have tried with xml data its working fine.

Labels (5)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

Thanks a Lot 0683p000009MACn.png

It works fine.

I can get my output.

 

0683p000009LtkU.png0683p000009LsAk.png

View solution in original post

6 Replies
TRF
Champion II
Champion II

Hi,

The error is at compile time, not at runtime.
As I can see, the body is malformed.
It should contains a Java String enclosed between ".
If it contains " they must be protected by an \ character.
Try this 1st to correct your compile error.
Anonymous
Not applicable
Author

Hi,

I really don't know where to use '\'. with the same JSON data, I execute in fiddler tool and I got expected output.

Anonymous
Not applicable
Author

Hi Sir,

Can You please work on that data and show  with screenshots.

Anonymous
Not applicable
Author

"{
\"Commit\": \"false\",
\"Client\": \"AvaTaxSample\",
\"CompanyCode\": \"CYPHERTAX\",
\"CustomerCode\": \"ABC4335\",
\"DocCode\": \"INV001\",
\"DocType\": \"SalesOrder\",
\"DocDate\": \"2014-01-01\",
\"Addresses\": [
{
\"AddressCode\": \"01\",
\"Line1\": \"2345 Carlmont Drive\",
\"Line2\": \"Suite 100\",
\"Line3\": \"ATTN Accounts Payable\",
\"City\": \"Belmont\",
\"Region\": \"CA\",
\"Country\": \"US\",
\"PostalCode\": \"94002\"
}
],
\"Lines\": [
{
\"LineNo\": \"1\",
\"DestinationCode\": \"01\",
\"OriginCode\": \"01\",
\"ItemCode\": \"N543\",
\"TaxCode\": \"NT\",
\"Description\": \"Red Size 7 Widget\",
\"Qty\": \"1\",
\"Amount\": \"100\"
}
]
}"
Anonymous
Not applicable
Author

Hi,

Thanks a Lot 0683p000009MACn.png

It works fine.

I can get my output.

 

0683p000009LtkU.png0683p000009LsAk.png

K11
Contributor II
Contributor II

Can we print HTTP body in the tLogRow?Is it possible?