Trigger Jobs through API. Where is to get to ReleaseId, ReleaseKey, ExternalJobKey, and Id Information

Hello Sir/Madam,
I will like to setup and trigger a job via API (Jason).
I refer to the API document as the hyperlink below.
However, there is some Json Parameter which is not clear to me. I am wondering if anyone could give me guides or tell me how to get the information. Any advice is highly appreciated.

  1. ReleaseId: (not sure where to get this information)
  2. ReleaseKey: ( UiPath license key?)
  3. ExternalJobKey: (not sure how to get the information)
  4. Id: (not sure how to get the information)

Starting a Schedule with Input Parameters Values

{
	"@odata.context": "https://staging.uipath.com/Docs/Docs/odata/$metadata#ProcessSchedules/$entity",
	"Enabled": true,
	"Name": "ArgumentsTestAPI",
	"ReleaseId": 1267,
	"ReleaseKey": "00000000-0000-0000-0000-000000000000",
	"ReleaseName": null,
	"PackageName": null,
	"EnvironmentName": null,
	"EnvironmentId": null,
	"JobPriority": null,
	"RuntimeType": null,
	"StartProcessCron": "0 0/5 * 1/1 * ? *",
	"StartProcessCronDetails": "{\"type\":0,\"minutely\":{\"atMinute\":5},\"hourly\":{},\"daily\":{},\"weekly\":{\"weekdays\":[]},\"monthly\":{\"weekdays\":[]},\"advancedCronExpression\":\"\"}",
	"StartProcessCronSummary": null,
	"StartProcessNextOccurrence": null,
	"StartStrategy": -1,
	"StopProcessExpression": "",
	"StopStrategy": null,
	"ExternalJobKey": "b72b3799-ce22-4eb4-9de3-fd3a568acecc",
	"TimeZoneId": "W. Central Africa Standard Time",
	"TimeZoneIana": "Africa/Lagos",
	"UseCalendar": false,
	"CalendarId": null,
	"CalendarName": null,
	"StopProcessDate": null,
	"InputArguments": "{\"Username\":\"AUsername\",\"Password\":\"MyPasswordb\"}",
	"QueueDefinitionId": null,
	"QueueDefinitionName": null,
	"ItemsActivationThreshold": 1,
	"ItemsPerJobActivationTarget": 1,
	"MaxJobsForActivation": 2,
	"Id": 1362
}

Hey @dean_division

There is no need to use all these parameters to trigger a job from API.

Release Key, Job Startegy, The parameter related to the Startegy - These three should do the job as a first step.

To get the Release Key you need to call the Get:Releases endpoint and find your process with release key.

Hope this helps

Thanks
#nK

As a call out… Please be sure you are looking at the most recent documentation for up to date information, Unless you are still using Orchestator 2019.

The docs don’t provide all information on the API, when in doubt review Swagger by tacking swagger to the end of your Orchestrator URL.

You’ll find more description on each of the properties and whether they are required or optional along with example Request and Response Schema https://cloud.uipath.com/XXXX/YYYY/orchestrator_/swagger/index.html#/ProcessSchedules/ProcessSchedules_Post

ReleaseId	integer($int64)
The Id of the process associated with the schedule.

ReleaseKey	string
The unique key of the process associated with the schedule.

ExternalJobKey	string
The unique identifier of the external job associated with the jobs generated by this schedule. A key is generated for each group of jobs triggered by this schedule.

As well, sometime if you want to know how different endpoints interact with one another, perform the actions like Creating a Trigger/Schedule in the Orchestrator Web UI while using your Browser’s Inspector to see the Network requests. This lets you see what requests are being made in what order, along with what parameters are being used and how.

If started from the point of Viewing the Triggers View and creating a new Trigger you’d see the following requests.

image

Thanks. I know how to use the API now.

Hello CodeMonKee,
I tried to setup the job, but return the error as below. Do you know what it mean, and how to make it works?
Appreciated for your advice in advance.

{
  "message": "This ProcessScheduleDto key is already used or has been used in the past.",
  "errorCode": 1000,
  "resourceIds": null
}
{
"Enabled": false,
"Name": "fake_trigger",
"ReleaseId": 31,
"EnvironmentId": "",
"StartProcessCron": "0 0 0 ? 1/3 MON *",
"StartProcessCronDetails": "{\"type\":4,\"minutely\":{},\"hourly\":{},\"daily\":{},\"weekly\":{\"weekdays\":[]},\"monthly\":{\"weekdays\":[{\"id\":\"MON\",\"weekly\":\"Monday\",\"monthly\":\"Monday\"}],\"atMinute\":0,\"atHour\":0,\"frequencyInMonths\":\"3\"},\"advancedCronExpression\":\"\"}",
"StartProcessCronSummary": "At 12:00 AM, only on Monday, every 3 months",
"StartStrategy": 0,
"ExecutorRobots": [
{
"Id": 6
}
],
"TimeZoneId": "Taipei Standard Time",
"TimeZoneIana": "Asia/Taipei",
"Id": 30
}

Hey @dean_division

You are trying to create a trigger now ?

Thanks
#nK

I’m assuming you already have a Trigger created that has the same name or ID. Try using an ID of 0 or leaving ID out of the JSON payload.

Hello Adrian,
I tried to setup the job, but return the error as below. Do you know what it mean, and how to make it works?

{
  "message": "This ProcessScheduleDto key is already used or has been used in the past.",
  "errorCode": 1000,
  "resourceIds": null
}
{
"Enabled": false,
"Name": "fake_trigger",
"ReleaseId": 31,
"EnvironmentId": "",
"StartProcessCron": "0 0 0 ? 1/3 MON *",
"StartProcessCronDetails": "{\"type\":4,\"minutely\":{},\"hourly\":{},\"daily\":{},\"weekly\":{\"weekdays\":[]},\"monthly\":{\"weekdays\":[{\"id\":\"MON\",\"weekly\":\"Monday\",\"monthly\":\"Monday\"}],\"atMinute\":0,\"atHour\":0,\"frequencyInMonths\":\"3\"},\"advancedCronExpression\":\"\"}",
"StartProcessCronSummary": "At 12:00 AM, only on Monday, every 3 months",
"StartStrategy": 0,
"ExecutorRobots": [
{
"Id": 6
}
],
"TimeZoneId": "Taipei Standard Time",
"TimeZoneIana": "Asia/Taipei",
"Id": 30
}

Hi @dean_division.
Where do you test this piece od automation? In Studio?

I have not encountered this error. Did you send a new Bearer Token to the activity?

Hello Adrian,
Sorry for the unclear description.
I simulated the script on Swagger UI (on promise version).
I got the Bearer Token also.

Hey @dean_division

This looks like the Trigger you are trying to create is already present or the trigger for the process is already present !

Kindly check once please.

Thanks
#nK

It is working now by simplifying the script.
Thanks.

https://docs.uipath.com/orchestrator/reference/schedules-requests

It is working now, thanks.

Cool @dean_division :slightly_smiling_face::+1:

Can you provide details on what your resolution was, then we can mark it as a solution for other readers.

There are two post method on ProcessSchedule API- Starting a Schedule with Dynamic Robot Allocation, and Starting a Schedule with Input Parameters Values.

https://docs.uipath.com/orchestrator/reference/schedules-requests

I simplify the Json script as below, and it works.

{
	"Name": "testJedox_Service_Running_Time_Check",
	"ReleaseId": 31,
	"ReleaseName": "RPA_Jedox_Service_Restart",
	"StartProcessCron": "0 55 23 2 AUG ? 2022",
	"StartProcessCronDetails": "{\"type\":4,\"minutely\":{},\"hourly\":{},\"daily\":{},\"weekly\":{\"weekdays\":[]},\"monthly\":{\"weekdays\":[{\"id\":\"SUN\",\"weekly\":\"Sunday\",\"monthly\":\"Sunday\"}],\"atMinute\":0,\"atHour\":0,\"frequencyInMonths\":\"5\"},\"advancedCronExpression\":\"\"}",
	"StartStrategy": 1,
	"ExecutorRobots": [6],
	"StopProcessExpression": "",
	"StopStrategy": null,
	"TimeZoneId": "Taipei Standard Time"
}
2 Likes

Hello Adrian, and CodeMonkee,
Do you know why I encounter the error screen at Studio, but success to get the response in Swagger UI with the same script below?
Although I encounter the error, I succeed in editing the Trigger via the put of ProcessSchedules(key).

/odata/ProcessSchedules({key})

{
	  "Enabled": true,
      "Name": "testRPA_Jedox_Service_Restart",
      "ReleaseId": 31,
      "StartProcessCron": "0 53 23 7 AUG ? 2022",
      "StartProcessCronDetails": "{\\\"type\\\":4,\\\"minutely\\\":{},\\\"hourly\\\":{},\\\"daily\\\":{},\\\"weekly\\\":{\\\"weekdays\\\":[]},\\\"monthly\\\":{\\\"weekdays\\\":[{\\\"id\\\":\\\"SUN\\\",\\\"weekly\\\":\\\"Sunday\\\",\\\"monthly\\\":\\\"Sunday\\\"}],\\\"atMinute\\\":0,\\\"atHour\\\":0,\\\"frequencyInMonths\\\":\\\"5\\\"},\\\"advancedCronExpression\\\":\\\"\\\"}",
      "StartStrategy": 1,
      "TimeZoneId": "Taipei Standard Time",
      "Id": 112,
      "MachineRobots": [
        {
          "MachineId": 3,
          "MachineName": "unattended robot1",
          "RobotId": 6
        }
      ]
}

Response from Swagger UI successfully.

Response from Studio via API

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