Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

POST JSON with REST API

Hello,

 

I need to send data from a JSON file from Talend with REST API.
To verify that my file and my POST URL is working, I did the test on Postman without error, it allows to create new object in my tools.

 

I need it to work since Talend, because it will be industrialized later but I can not do it.

 

Here the contents of my JSON file:
"{
"path": "/Catalogue_Produits/Respiratoire/",
"elements": [
{
"type": "input",
"value": "Respi test 1 RESTAPIxxxx",
"name": "Denom",
"language": null
},
{
"type": "input",
"value": "RESPI test 1 RESTAPIxxxxx",
"name": "Nom_Data",
"language": null
},
{
"type": "select",
"value": "NouveauProduit",
"name": "PROCESSUS_SEL",
"language": null
}
],
"className": "Product",
"parentId": 98,
"key": "Respi3000",
"published": true,
"type": "object"
}"

 

Here the test ok on Postman:
0683p000009M2GK.jpg

 

I am new to Talend, but I tried to add the components:
tFileInputJSON => row => tRest_Client

The setting must be wrong because it does not work.

 

0683p000009M2TN.jpg

0683p000009M2RD.jpg

0683p000009M2TX.jpg

 

Can you help me ?

 

Thank you

Labels (4)
16 Replies
Anonymous
Not applicable
Author

are you passing the row value to tRest? Show me a screenshot of that component

Anonymous
Not applicable
Author

@evansdar 

I do not understand what I have to do?

 

0683p000009M2xh.jpg

Anonymous
Not applicable
Author

Your HTTP Body is empty, you should be passing the value that is sent from the tFileInputRaw. See my first Screenshot:0683p000009M2m6.png

 

Where 'row1' is the row leading from tFileInputRaw and 'content' is what represents the content of the file. (Clicking the row itself, then the component button will let you see what the schema is defined as)

0683p000009M2xr.png

Anonymous
Not applicable
Author

@evansdar, it's work !!

Thank you

Anonymous
Not applicable
Author

tREST does not seem to accept an input. Is there a setting that needs to be changed to enable?

LuciusHunt
Contributor
Contributor

To see how sending JSON via tRestClient works see the gif in my comment at the end of this post.

tMap -> tWriteJSONField -> tRestClient

Lrmr
Contributor
Contributor

I followed all the steps mentioned above but I am still getting the following error.

 

Invalid JSON body.|400

[statistics] disconnected

 

The setup of the job looks as follows

 

0695b00000Dt34IAAR.png 

Can someone please advice or help me out?

 

Thank you in advance