/// <summary> /// Job execution related methods /// </summary> private async Task <ProcessRelease> GetProcessRelease() { ProcessRelease processRelease = new ProcessRelease(_workflowName, _envName); string getEndpoint = $"{ProcessReleaseEndpoint}?$filter=Name eq '{processRelease.Name}'"; Utilities.WebUtility uipathApiProcRelease = new Utilities.WebUtility(getEndpoint); string jsonStringResponse = await uipathApiProcRelease.GetAsync("application/json", _authToken); processRelease.Key = JsonProcessing.ExtractFromODataJsonByKey(jsonStringResponse, "Key"); return(processRelease); }
public async Task <string> StartJob() { ProcessRelease release = await GetProcessRelease(); Robot robot = await GetRobot(); Utilities.WebUtility uipathApiStartJob = new Utilities.WebUtility(StartJobEndpoint); string jobJsonBody = "{\"startInfo\": {\"ReleaseKey\": \"" + release.Key + "\",\"Strategy\": \"Specific\",\"RobotIds\": [" + robot.Id + "],\"NoOfRobots\": 0}}"; string jobResponse = await uipathApiStartJob.PostAsync(jobJsonBody, _headerList, _authToken); return(jobResponse); }