Can't pass argument to Orchestrator using API

Hello,
I Need to pass argument to Orchestrator using API.
argument contains back slash (eg. arg = \11.11.11.1\reports\production.txt)

Here is my code
api_code

and this is the response from orchestrator

How can I achieve this
Thanks in Advance

1 Like

Hey, I think you should escape each backslash, so this line:
"InputArguments":"{\"file_path\":\"\\11.11.11.1\reports\production.txt\"}"
should become
"InputArguments":"{\"file_path\":\"\\\\11.11.11.1\\reports\\production.txt\"}"
Didn’t work for me though, I got following error
{ "message": "Argument Values validation failed.", "errorCode": 2003, "resourceIds": null }

Did you ever figure this out I am stuck on the same issue. Im just trying to get the api call to work from a Ui Path Sequence so I know how to work it before I start using it externally.

@LeftBrainCo

One way to find out the exact syntax is to try to use the Network tab in your browser. I have just passed a sample input argument as per the first post:

\11.11.11.1\reports\production.txt

And this is what my browser sent to Orchestrator :slight_smile:

{
	"startInfo": {
		"ReleaseKey": "***",
		"RobotIds": [],
		"JobsCount": 1,
		"JobPriority": "Normal",
		"Strategy": "JobsCount",
		"InputArguments": "{\"in_argument\":\"\\\\11.11.11.1\\\\reports\\\\production.txt\"}"
	}
}

Another hint would be what happens after you paste your value into the field in the browser and click Save:
Before:


After:

I hope this helps.

1 Like

I am not able to use variable for inputarguments. Its giving arguments validation error . Can you help me with the syntax of using variables.

Is there any possible way that you could show how to correctly use InputArguments when typed DIRECTLY in UiPath Studio. So without using a separate .txt file. All your available guides use a .txt file and in my business case, it is not possible. I say again, it is not possible so please don’t suggest that I type the json request in a .txt file and read the .txt file.

Thank you,
Regards

Sure, please see this post as a sample: