Start Schedule With API

Hello,

I am working on having a bot schedule itself to run later. I have created schedules using API calls with Postman. However I do now know how to put the body in the JSON Payload parameter of the Orchestrator HTTP request activity. We are also using Org Units which requires an additional header. An example of the Post I am making is shown below:

{
“Enabled”: true,
“Name”: “Test2”,
“ReleaseId”: 71,
“StartProcessCron”: “0 0/5 * 1/1 * ? *”,
“StartProcessCronDetails”: “{“advancedCronExpression”:“0 0/5 * 1/1 * ? *”}”,
“StartStrategy”: 0,
“ExecutorRobots”:
[{“Id”: 00000}],
“TimeZoneId”: “Central Standard Time”
,“TimeZoneIana”: “America/Chicago”,
“StopProcessDate”: “2019-11-21T14:30:00Z”
}

The bot always errors with “JSON not valid” How do I format this with Org Unit header in JSON Payload parameter? If you could give me exact string to use that would be great. It also has to include the header “X-UIPATH-OrganizationUnitId: 4” because we are using org units.

Thanks!

Turns out the Org Unit was not required.

All i needed was this:

{
“Enabled”: true,

"Name": "Test2",

"ReleaseId": 71,

"StartProcessCron": "0 0/1 * 1/1 * ? *",

"StartProcessCronDetails": "{\"advancedCronExpression\":\"0 0/1 * 1/1 * ? *\"}",

"StartStrategy": 0,

"ExecutorRobots": 

[{“Id”: 124}],

"TimeZoneId": "Central Standard Time"

,
“TimeZoneIana”: “America/Chicago”,

"StopProcessDate":"2019-11-21T17:00:00z"

}

Also a Tip I found it easiest to keep the JSON request saved as a .json and read it in then pass it to the activity.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.