Swagger Robot creation problem

Hi all,

Newbie here. Trying to use swagger to create a robot with the following curl on our testing env:

 curl -v "https://******/odata/Robots" \
 -H "accept: application/json" \
 -H "Content-Type: application/json" \
 --header "Authorization: Bearer eyJhbGciOiJSUzI1NiI...sImtpZCI6I4g" \
 -d '{ \
                   "MachineName": "testing_machine_02", \
                   "Name": "robot_05_name_01", \
                   "Type": "NonProduction", \
                   "HostingType": "Standard", \
                   "Username": "robotOps" \
  }'

All I am getting is “HTTP/1.1 400 Bad Request” followed by
{“message”:“robotDto must not be null”,“errorCode”:0,“traceId”:“003…9a69”,“resourceIds”:null}%

  • I have admin rights.
  • Machine search and machine creation work no problem with similar requests.
  • Using similar values on the web works no problem and creates the robot.

Can’t find any doc on how to do it properly, what the error might mean or some basic examples.

Any pointer appreciated

@galmaza3

in latest there are no robots..ideally users is where you would assign all these

please try with create or update roles

to check you can try swagger

cheers

Hi @galmaza3

have you tried creating the robot using postman?

Thanks for responses folks.

Problem was I was missing a header:
--header 'X-UIPATH-OrganizationUnitId: 1'
After adding it, it automagically works no problem.

Still, it took me the whole day to figure out, and we have plans to add some more automation. For that reason I would appreciate any pointers to some doc/samples on basic management of robots, users and machines with the swagger.

Cheers.

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