I have been following instructions from this Matillion blog post on how to call the API using a CURL command while passing values for job variables. Using the syntax, I am entering something like this:
curl -X POST –user <api_user>:<api_user_password> http://<instance_address>/rest/v1/group/name/<group_name>/project/name/<project_name>/version/name/<version_name>/job/name/<orchestration_job_name>/run?environmentName=<environment_name> -H "Content-Type: application/json" –data-binary '{"scalarVariables":{"target_schema":"TEST","target_table":"test_airport2"}}'
My job variables in the example above would be "target_schema" and "target_table". When I run curl commands without the post header (i.e. removing everything starting at -H) the API call works and runs the job fine.
This is the example given in the blog. I replaced the single and double quotes from the blog post with standard single/double quotes because the blog post had them formatted. I also noticed that some other references had an additional dash before -data-binary, so I also tried ---data-binary (2 dashes before data).
In all attempts, i get invalid URL syntax errors, including this one complaining about the single quote
{"success":false,"msg":"Unexpected character (''' (code 39)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 2].","id":-1}
and after tweaking the URL I get this one, which claims there is an extra bracket which does not seem right:
{"success":false,"msg":"Unexpected character (''' (code 39)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 2].","id":-1}curl: (3) unmatched close brace/bracket in URL position 40:
fake_client,job_geography_name:fake_geo}}'
There is a carat ^ in the output pointing to the second to last bracket above.
Any help would be appreciated.