How to Trigger a Job using API in a specific machine in Modern folders

Hi All,

we were using an API to trigger a job in classic folders earlier and it was working very fine and recently it got migrated to Modern folder since when our API is not working properly as its triggering only in one machine.is there any way to specifc the Robotid to specify the machine that bot has to trigger in ??

@Aswini

You can configure these to start the job on machine you need

Inlike in classic we donot have robots here so use the users endpoint to get the unattended robot id you need and use them here

Machines you can get from get machines

Cheers

@Anil_G thank you so much for responding.Could you please me how to update the body using these values as currently we are specifying only release key details in the body.if you could provide the format/syntax it would be a great help

@Aswini

sample

{
  "startInfo": {
    "ReleaseKey": "<Key>",
    "Strategy": "ModernJobsCount",
    "JobsCount": 1,
    "Source": "Manual",
    "InputArguments":"{}"
    "MachineRobots": [
      {
        "MachineId": <From Machines End PointID>,
        "RobotId": <From Users EndpointID>
      }
    ]
  }
}

cheers

@Anil_G Machine Id is machine Name correct? because i didn’t get machine id after using Machines end point

@Anil_G i have tried executing it but getting error like “Startjobparameters must not be null error”

Attacahing the below screenshots for reference.Kindly help on the same

@Aswini

If you see in response of get machines you will have ID…you can use name as well if you want to but then the key should be changed to machine name

As per error input parameters are null…you left them blank…it cannot be blank

cheers

I have provided the Name like in the screenshot shared by u and what input parameters i should provide?

@Aswini

If there are no inputs then remove that completely and check…if not depending on what arguments you are using in process send the input parameters

What parameters were you sending before ?

cheers

@Anil_G its just a test process so im not passing any input parameters so i tried to remove that part in body and tried but still getting same error.Incase if we want to pass imput parameters can we just mention them in double quotes or should be in paranthesis?

@Aswini

Try passing input arguments like this "InputArguments": "{}"

cheers

@Anil_G ihave given the values as following.Let me know if im missing something

@Aswini

Please update the post properly…

Also have double quotes around parathesis for inputArguments as specified above

Cheers

@Anil_G Updated the post and as you see i am passing the arguments as excepted.

@Aswini

That is wrong…if you dont have any arguments pass as"{}" …and if there are arguments to pass then "{\"ArgumentName\":\"value\"}"

Hope this is clear

Cheers

@Anil_G i got it but getting same error after updating the input values in this format

@Aswini

Is the argument name is given properly and is argument present in the process?

When I try same I dont see any issue

Cheers

@Anil_G attaching the argument name screenshot for reference

@Aswini

is this how you tried?

"{\"input\":\"value\"}"

And also beside raw please check you will find an option text(Dropdown beside GraphQL)…click on it and select json

Hope this helps

cheers

@Anil_G its Json only input is being passed the same way like you mentioned