Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
        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);
        }