Error starting job

Hi,
I’m trying to start a job via Orchestrator API using Python.
So far I’ve got:

import requests
url_login = “https://myurl/api/account/authenticate
params_login = {“tenancyName” : “Default” , “usernameOrEmailAddress” : “username” , “password” :“ExtraStrongPassword”}

r = requests.post(url = url_login, data = params_login, verify=False)

data = r.json()
result = data[‘result’]

url_start_job = " https://myurl/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs"
params_start_job = {
“startInfo”: {
“ReleaseKey”: “xxxxx”,
“RobotIds”: ,
“NoOfRobots”: 0 ,
“Strategy”: “All”,
“Source”:“Manual”
}
}

header = { “Authorization”: "Bearer "+result }
r = requests.post(url = url_start_job, data = params_start_job, headers = header , verify=False)
data = r.json()
print (data)

The result i’ve got is: {‘message’: “Parameter ‘name’ is missing.”, ‘errorCode’: 1014, ‘resourceIds’: None}

I’ve tried many things, but so far i always get the same error. Can someone help me ?

Hi @Nuno_Durao

Welcome to our UiPath Forum! :slight_smile:

Could you check this post for some reference:

It might give you some clues.

1 Like

Thanks @loginerror. I’ve seen those post.
I’ve tried to get Robots, Process and ProcessKey. All my calls work, except for startJobs.

Could you give this post a read?

It might be the ReleaseKey name at fault (maybe).

I’ve done it!! :smiley:
The full code is:
Replace [URL],[USER],[PASSWORD],[PROCESS NAME],[ID],[KEY]

import requests
import json

s = requests.session()
# Getting the login
url_login = “[URL]/api/account/authenticate”
params_login = {“tenancyName” : “[NAME]” , “usernameOrEmailAddress” : “[USER]” , “password” : “[PASSWORD]”}
r = s.post(url = url_login, data = params_login, verify=False)
data_info = r.json()
result = data_info[‘result’]

# The header
headers = {
‘Content-Type’: ‘application/json’,
‘Accept’: ‘application/json’,
‘X-XSRF-TOKEN’: ‘null’,
‘Authorization’ : "Bearer "+str(result)
}

# Starting Job
url_start_job = “/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs”
params_start_job = {
“startInfo”: {
“ReleaseKey”: “[KEY]”,
“RobotIds”: [ ID ],
“NoOfRobots”: 0 ,
“Strategy”: “Specific”, } }

r = s.post(url = url_start_job, data = json.dumps(params_start_job), headers = headers , verify=False)
data_info = r.json()

If you need to get [KEY] for the ReleaseKey, run:

# Getting the process key
url_process_key = “[URL]/odata/Releases?$filter=contains(ProcessKey,’[PROCESS NAME]’)”
r = s.get(url = url_process_key, headers = headers , verify=False)
data_info = r.json()
print (data_info)

The information you need is the ‘Key’

If you need to get [ID] for the RobotIds, run:

# Getting info of the robots
url_robots = “[URL]/odata/Robots”
r = s.get(url = url_robots, headers = headers , verify=False)
data_info = r.json()
print (data_info)

The information you need is the ‘Id’.

2 Likes

Tried this out. Unfortunately, didn’t help resolving the issue (Parameter ‘name’ is missing)

Yeah even im facing the same issue . All my call workes except start job. Really need help on it ?

Sir i am doing it int postman but still getting th 409 conflict error.