Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Bonjour,
Je suis nouvelle sur Talend Open Studio et je rencontre une difficulté avec le composant tRESTClient.
Je souhaiterais savoir quelle est la bonne méthode pour transmettre un JSON contenant deux valeurs en input (par exemple username et password) dans une requête POST.
Quelle est la bonne pratique recommandée pour construire et envoyer ce type de JSON avec tRESTClient ?
Merci d’avance pour votre aide.
Hello anyxs,
Thank you for reaching out to the Qlik community.
In tRESTClient, don’t manually concatenate JSON in the body. Instead: Prepare JSON with tMap / schema
You can configure tRESTClient
Recommended approach
In short, you can generate JSON using schema-based components, then pass it as a body string with application/json header.
Hello anyxs,
Thank you for reaching out to the Qlik community.
In tRESTClient, don’t manually concatenate JSON in the body. Instead: Prepare JSON with tMap / schema
You can configure tRESTClient
Recommended approach
In short, you can generate JSON using schema-based components, then pass it as a body string with application/json header.
Thank you for your answer!
I am trying to follow your recommended approach using tWriteJSONField → tRESTClient, but I am struggling with the tWriteJSONField configuration.
I have:
- A tFixedFlowInput with 3 columns: username (String), password (String), body (String)
- The JSON structure configured with username and password mapped under rootTag
However, I get the following error:
"Le paramètre (Boucle JSON) doit avoir au moins une valeur"
(The JSON Loop parameter must have at least one value)
Could you please clarify:
1. How to properly configure the JSON loop in tWriteJSONField?
2. How to configure the "Body type: String" and "Use column" in tRESTClient? I cannot find these fields in my version.
Thank you!
You’re very close—your issue comes from how tWriteJSONField expects a loop (array context) and how tRESTClient consumes the body.
Required (one JSON per row), otherwise you get the error.
So:
jsonBody → string
Tip: For simple cases, skip tWriteJSONField and build JSON directly in tMap.