Start job process via API in Modern Folders - The job's associated process could not be found

Hello everyone,
I’m facing an issue while starting a job process using postman:
odata/Jobs/UiPath.Server.Configuration.OData.StartJobs

{
    "startInfo": {
        "ReleaseKey": "732de7da-135f-xxxxxxx-xxxx-xxxxxxx",
        "JobsCount": 1,
        "Strategy": "ModernJobsCount",
        "InputArguments": "{}",
        "MachineRobots": [
            {
                "RobotId": 875937,
                "MachineId":2544118
            }
        ]
    }
}

it returns 404

{
    "message": "The job's associated process could not be found",
    "errorCode": 1002,
    "traceId": "00-8af634a7c28e15235b9edf063ae70c22-90e52267d0feb38b-00",
    "resourceIds": null
}

I have traced the process from the web orchestrator

What seems to be the problem?
I would really appreciate your help.

Double check the Body payload as I think you missed some data.

Thank you for your reply, I have added all the parameters in the picture still the same response.

{
    "startInfo": {
        "ReleaseKey": "732de7da-135f-49e6-xxxx-xxx",
        "JobsCount": 1,
        "Strategy": "ModernJobsCount",
        "InputArguments": "{}",
        "JobPriority": null,
        "RuntimeType":"Unattended",
        "RunAsMe":"false",
        "ResumeOnSameContext":"false",
        "MachineRobots": [
            {
                "RobotId": 875937,
                "MachineId":2544118
            }
        ]
    }
}

Check these posts:

I have checked the post:
I got the machine id using
/odata/Machines
and I got the robot id using odata/Sessions/UiPath.Server.Configuration.OData.GetGlobalSessions?$expand=Robot($expand=License)
because odata/robots returns empty.

Moreover, I am using a local user account with all permissions assigned


is the problem exists because I’m using local user not a robot account?

PS: 1. it works fine if I start the process from the web orchestrator. 2. the api worked fine before when using classic robots

An easy approach to identify what might be being overlooked is to use your Browsers Inspector to capture the Requests and then perform the actions within the WebUI.

From here you should be able to replicate the actions and payload and then as a final step I generally cleanup any attributes/properties that are not required.

Thank you for your reply, if I added the process key alone it works fine in classic folders. However, when using modern folders , I inspect my browser I have found more attributes than what I have found in the startJob documentation and I have tried to send the request using these attributes still no luck.

I think the problem might be related to the the local user I am using. since I’m not using a robot account. So should I use robot account instead or it does not matter?

It doesn’t matter.

I think you still missing some information in your request.

Did you add the folder information in your Headers request?

X-UiPath-OrganizationUnitId: FOLDER_ID

or

X-UiPath-FolderPath: FOLDER_NAME


Which is the Rest call for Folder details?

You can use a GET request for

https://cloud.uipath.com/your_organization_name/your_tenant_name/odata/Folders?$orderby=Id asc

Thanks mate, I really appreciate it.
All I had to add is the folder name in header request: X-UiPath-FolderPath: FOLDER_NAME

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