Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
SI3
Contributor
Contributor

Problem in passing JSON parameter in TMC REST API call /tmc/v2.2/executions

From a Java application, we are trying to run a Standard job in TMC by invoking this REST API endpoint -

https://api.us-west.cloud.talend.com/tmc/swagger/swagger-ui.html# !/executions/execute

In the Body of the request, one of the parameters, say "arg2" is a JSON string as shown. This request fails with HTTP error 400. We used escape characters and we are very sure it's a valid JSON.

{

 "executable": "task id here",

 "parameters": {

"arg1": "a",

"arg2": {"one":"x", "two": "y"}

 },

 "logLevel": "WARN"

}

Now, if we change "arg2" to just a string value, it works successfully.

 "executable": "",

 "parameters": {

"arg1": "a",

"arg2": "b"

 },

 "logLevel": "WARN"

}

Does anybody know how to pass an argument that itself is a JSON string ?'

Thanks

2 Replies
Anonymous
Not applicable

Hi

Can you try

 "{\"one\":\"x\", \"two\": \"y\"}"

 

Regards

Shong

SI3
Contributor
Contributor
Author

Hi Shong,

 

Thanks for your response. As I have mentioned earlier, we have already escaped all the " characters and any slashes that needs escaping.

 

The body of the request is a valid JSON. However, the TMC REST API fails with 400