Add header value in http request activity

Hi All,

I need the output in JSON format of Orchestrator http request activity which is currently i am getting as html format.
How can i pass value in header to be
“headers”: {
“Content-Type”: “application/json”,
}
as Header is asking for dictionary<string,string> format…

Currently i am getting output like below…but i need it in JSON format.

{
“message”: “\r\n\r\n<html lang=“en”>\r\n\r\n <meta charset=“utf-8” />\r\n <meta http-equiv=“X-UA-Compatible” content=“IE=edge” />\r\n <meta name=“viewport” content=“width=device-width, initial-scale=1” />\r\n <meta name=“description” content=”" />\r\n <meta name=“author” content="" />\r\n <meta name=“referrer” content=“no-referrer” />\r\n\r\n <base href="/coxinc/coxtest1/" />\r\n\r\n UiPath Orchestrator \r\n <link rel=“shortcut icon” href=“favicon.png” />\r\n <link rel=“manifest” href=“manifest.json”>\r\n\r\n \r\n <script type=“text/javascript” src=“dist/assets/js/preload.js”>\r\n <link rel=“stylesheet” type=“text/css” href=“dist/preloader.theme.c2d710908eec8080f1de.css” />\r\n <link rel=“stylesheet” type=“text/css” href=“dist/default.theme.76ffb34959ce8434bced.css” />\r\n <link rel=“stylesheet” type=“text/css” href=“dist/css/noto/noto-font-jp-zh-woff.css” />\r\n <link rel=“stylesheet” type=“text/css” href=“dist/css/noto/noto-font-jp-zh.css” />\r\n <link rel=“stylesheet” type=“text/css” href=“dist/css/material-icons/material-icons-fontface.css” />\r\n\r\n <script type=“text/javascript” src=“dist/js/mixpanel-init.js”>\r\n\r\n\r\n\r\n<body class=“light”>\r\n \r\n <div class=“loader-container”>\r\n <div class=“loader-logo”>\r\n <svg version=“1.1”\r\n id=“orchestrator-logo-text”\r\n xmlns=“http://www.w3.org/2000/svg”\r\n xmlns:xlink=“http://www.w3.org/1999/xlink”\r\n x=“0px”\r\n y=“0px”\r\n width=“304px”\r\n height=“37px”\r\n viewBox=“0 0 304 37”\r\n enable-background=“new 0 0 304 37”\r\n fill=“currentColor”\r\n xml:space=“preserve”>\r\n <path d=“M26.5,3.6c2.6,1.5,4.8,3.7,6.3,6.3c1.5,2.8,2.3,5.9,2.3,9.1c0.1,3.2-0.7,6.4-2.3,9.2c-1.5,2.7-3.7,4.9-6.3,6.4\r\n c-2.7,1.5-5.8,2.3-9,2.3c-3.1,0.1-6.2-0.7-8.9-2.3C6,33.2,3.8,31,2.4,28.3c-3.1-5.7-3.1-12.6,0-18.3C3.8,7.3,6,5.1,8.7,3.6\r\n c2.7-1.5,5.8-2.3,8.9-2.3C20.7,1.3,23.8,2.1,26.5,3.6z M12.2,9.2c-1.6,0.9-2.8,2.3-3.6,4C7.6,15,7.1,17,7.2,19.1\r\n c0,2.1,0.4,4.1,1.3,6c0.8,1.7,2.1,3.1,3.6,4c3.4,1.9,7.5,1.9,10.8,0c1.6-1,2.8-2.4,3.7-4c1.7-3.8,1.7-8.1,0-11.9\r\n c-0.8-1.6-2.1-3-3.7-4C19.6,7.3,15.5,7.3,12.2,9.2z” />\r\n <path\r\n d=“M55.3,8.8v6.3c-8,0-9.9,2.8-9.9,9.6v11.9h-7V9.2h7v3.5C47.3,10.4,50.5,8.8,55.3,8.8z” />\r\n <path d=“M83.2,19.5h-7.4c-0.6-3-2.9-4.6-6.1-4.6c-4.2,0-7,3.3-7,8s2.9,8,7,8c3.3,0,5.5-1.8,6.1-4.6h7.4C82,33.1,76.9,37,69.9,37\r\n c-8.3,0-14.2-5.6-14.2-14.1c0-8.7,6-14.1,14.2-14.1C77,8.8,82,12.9,83.2,19.5z” />\r\n <path d=“M100.7,8.8c6.5,0,11.6,4.7,11.6,11.9v16h-7V21.5c0-4.2-2.1-6.9-6.3-6.9s-6.6,2.8-6.6,7.5v14.6h-7V0h7v12\r\n C94.2,9.9,96.9,8.8,100.7,8.8z” />\r\n <path d=“M142.3,25.1h-20.7c0.8,4.1,3.5,6.1,6.8,6.1c3,0,5.3-1.2,6.1-3.9h7.5c-1.4,6-6.8,9.6-13.3,9.6c-8.7,0-14.1-5.7-14.1-14.1\r\n c0-8.6,5.5-14,14.1-14c5.3,0,9.7,2.3,12,6.3C142.2,18.2,142.8,21.7,142.3,25.1z M135.1,20c0-2.9-2.8-5.5-6.5-5.5\r\n c-4.2,0-6.3,2.6-7,5.5H135.1z” />\r\n <path d=“M165.5,18h-6.5c-0.2-2.8-1.8-3.8-4.1-3.8c-2.1,0-3.5,1-3.5,2.6c0,1.5,1.9,2.1,5.6,3.5c5.2,2,8.8,4.1,8.8,8.5\r\n c0,5.2-4.5,8.2-10.2,8.2c-7.3,0-11.2-3.9-11.9-9.6h7c0.4,3,2.5,4,4.7,4c2.5,0,3.5-1.2,3.5-2.8c0-2.1-2.3-2.4-7.6-4.6\r\n c-4.5-2-6.4-3.8-6.4-7.3c0-4.4,3.8-8,10.3-8C161,8.7,165.1,12.6,165.5,18z” />\r\n <path d=“M184.6,30.7v6h-3.7c-6.7,0-9.5-3.2-9.5-9.6V15.2h-3.3V9.2h3.3V1.7h7v7.5h6.1v5.9h-6.1v11.9c0,2.4,0.7,3.6,3.4,3.6\r\n L184.6,30.7z” />\r\n <path\r\n d=“M204.7,8.8v6.3c-8,0-9.9,2.8-9.9,9.6v11.9h-7V9.2h7v3.5C196.7,10.4,199.9,8.8,204.7,8.8z” />\r\n <path\r\n d=“M234.2,9.2v27.5h-7.1v-3.1c-1.8,2.2-4.8,3.4-8.9,3.4c-7.5,0-12.7-5.8-12.7-14s5.2-14.1,12.7-14.1c4,0,7,1.4,8.9,3.8V9.2\r\n L234.2,9.2L234.2,9.2z M227.1,22.9c0-4.8-2.8-8-7.2-8s-7.3,3.1-7.3,8c0,4.6,2.5,7.9,7.3,7.9C224.1,30.8,227.1,27.7,227.1,22.9z” />\r\n <path d=“M253.9,30.7v6h-3.7c-6.7,0-9.5-3.2-9.5-9.6V15.2h-3.3V9.2h3.3V1.7h7v7.5h6.1v5.9h-6.1v11.9c0,2.4,0.7,3.6,3.4,3.6\r\n L253.9,30.7z” />\r\n <path d=“M284.3,22.9c0,8.6-5.9,14.1-14.1,14.1c-8.3,0-14.1-5.6-14.1-14.1s5.8-14,14.1-14C278.7,8.8,284.3,14.4,284.3,22.9z\r\n M263.3,22.9c0,4.8,2.7,8.1,7,8.1c4.3,0,6.9-3.4,6.9-8.1c0-4.8-2.7-8-6.9-8C265.9,14.9,263.3,18.2,263.3,22.9z” />\r\n <path\r\n d=“M304,8.8v6.3c-8,0-9.9,2.8-9.9,9.6v11.9h-7V9.2h7v3.5C295.9,10.4,299.1,8.8,304,8.8z” />\r\n \r\n\r\n <div class=“loader-mask”>\r\n\r\n <div class=“loader-logo-wrap”>\r\n <svg version=“1.1”\r\n id=“orchestrator-logo-ui”\r\n xmlns=“http://www.w3.org/2000/svg”\r\n xmlns:xlink=“http://www.w3.org/1999/xlink”\r\n x=“0px”\r\n y=“0px”\r\n width=“37px”\r\n height=“37px”\r\n viewBox=“0 0 37 37”\r\n enable-background=“new 0 0 37 37”\r\n xml:space=“preserve”>\r\n <rect id=“orchestrator-square-logo-blue”\r\n x=“1”\r\n y=“1”\r\n fill="#1976D2"\r\n width=“35”\r\n height=“35” />\r\n <path fill="#FFFFFF"\r\n d=“M22.2,20.6c0,4.8-2.7,7.7-7.3,7.7c-4.5,0-7.2-2.8-7.2-7.7V10h3.6v10.6c0,2.7,1.1,4.3,3.6,4.3\r\n c2.4,0,3.6-1.5,3.6-4.3V10h3.6V20.6z” />\r\n <rect x=“25.1”\r\n y=“13.9”\r\n fill="#FFFFFF"\r\n width=“3.6”\r\n height=“14.2” />\r\n <path fill="#FFFFFF"\r\n d=“M26.9,12.2c-1.2,0.1-2.1-0.8-2.2-2c0-0.1,0-0.1,0-0.2c0.1-1.2,1.1-2.2,2.3-2.1c1.1,0.1,2.1,1,2.1,2.1\r\n c0,1.2-0.9,2.1-2,2.2C27,12.2,27,12.2,26.9,12.2” />\r\n \r\n \r\n \r\n \r\n \r\n <script type=“text/javascript” src=“dist/runtime.7c89f211f76412a3f486.js”>\r\n <script type=“text/javascript” src=“dist/scripts.6475865f89df29497a49.js”>\r\n <script type=“text/javascript” src=“dist/polyfills-es5.c5bc0c891a605781b960.js” nomodule>\r\n <script type=“text/javascript” src=“dist/main.02367a2cd6311f4abac1.js”>\r\n\r\n\r\n",
“level”: “Information”,
“logType”: “User”,
“timeStamp”: “05:43:03”,
“processVersion”: “1.0.0”,
“jobId”: “68539b58-544f-428b-b0b5-fc957ef50069”,
“robotName”: “ceivmadas0123”,
“machineId”: 241,
“organizationUnitId”: 33
}

@GBK @Lahiru.Fernando …anyone…please support

@som17 - pls try below …

  • add json.net package to your project dependency
  • create a variable like jsonOut type as JObject
  • jsonOut = JOjbect.Parse(JSONResponseVariable)

to get robotName -" write like jsonOut(“robotName”).ToString
for machineId -" write like jsonOut(“machineId”).ToString

i already have JSON package installed…but the challenge is the above string format that i am getting…it doesn’t contain any of the queue indormation that i am trying to get via Orchestrator HTTP request actvity…

Relative endpoint being passed is : “/coxinc/coxTestgokb300096/odata/QueueItems”

@som17 -

  • get all queue lists from orchestrator api ( {{url}}/odata/QueueDefinitions )
  • get the queue list of items
    {{url}}/odata/QueueItems?$filter=QueueDefinitionId eq 12345 (12345 - queuedefinitionid)

pls check below link for api impementation reference – https://postman.uipath.rocks/?version=latest

i tried to pass it like “/{coxinc/coxTestgokb300096}/odata/QueueItems” but the output is like this :
{
“message”: “\r\n\r\n<html lang=“en”>\r\n\r\n <meta charset=“utf-8” />\r\n <meta http-equiv=“X-UA-Compatible” content=“IE=edge” />\r\n <meta name=“viewport” content=“width=device-width, initial-scale=1” />\r\n <meta name=“description” content=”" />\r\n <meta name=“author” content="" />\r\n <meta name=“referrer” content=“no-referrer” />\r\n\r\n <base href="/coxinc/coxtest1/" />\r\n\r\n UiPath Orchestrator \r\n <link rel=“shortcut icon” href=“favicon.png” />\r\n <link rel=“manifest” href=“manifest.json”>\r\n\r\n \r\n <script type=“text/javascript” src=“dist/assets/js/preload.js”>\r\n <link rel=“stylesheet” type=“text/css” href=“dist/preloader.theme.c2d710908eec8080f1de.css” />\r\n <link rel=“stylesheet” type=“text/css” href=“dist/default.theme.76ffb34959ce8434bced.css” />\r\n <link rel=“stylesheet” type=“text/css” href=“dist/css/noto/noto-font-jp-zh-woff.css” />\r\n <link rel=“stylesheet” type=“text/css” href=“dist/css/noto/noto-font-jp-zh.css” />\r\n <link rel=“stylesheet” type=“text/css” href=“dist/css/material-icons/material-icons-fontface.css” />\r\n\r\n <script type=“text/javascript” src=“dist/js/mixpanel-init.js”>\r\n\r\n\r\n\r\n<body class=“light”>\r\n \r\n <div class=“loader-container”>\r\n <div class=“loader-logo”>\r\n <svg version=“1.1”\r\n id=“orchestrator-logo-text”\r\n xmlns=“http://www.w3.org/2000/svg”\r\n xmlns:xlink=“http://www.w3.org/1999/xlink”\r\n x=“0px”\r\n y=“0px”\r\n width=“304px”\r\n height=“37px”\r\n viewBox=“0 0 304 37”\r\n enable-background=“new 0 0 304 37”\r\n fill=“currentColor”\r\n xml:space=“preserve”>\r\n <path d=“M26.5,3.6c2.6,1.5,4.8,3.7,6.3,6.3c1.5,2.8,2.3,5.9,2.3,9.1c0.1,3.2-0.7,6.4-2.3,9.2c-1.5,2.7-3.7,4.9-6.3,6.4\r\n c-2.7,1.5-5.8,2.3-9,2.3c-3.1,0.1-6.2-0.7-8.9-2.3C6,33.2,3.8,31,2.4,28.3c-3.1-5.7-3.1-12.6,0-18.3C3.8,7.3,6,5.1,8.7,3.6\r\n c2.7-1.5,5.8-2.3,8.9-2.3C20.7,1.3,23.8,2.1,26.5,3.6z M12.2,9.2c-1.6,0.9-2.8,2.3-3.6,4C7.6,15,7.1,17,7.2,19.1\r\n c0,2.1,0.4,4.1,1.3,6c0.8,1.7,2.1,3.1,3.6,4c3.4,1.9,7.5,1.9,10.8,0c1.6-1,2.8-2.4,3.7-4c1.7-3.8,1.7-8.1,0-11.9\r\n c-0.8-1.6-2.1-3-3.7-4C19.6,7.3,15.5,7.3,12.2,9.2z” />\r\n <path\r\n d=“M55.3,8.8v6.3c-8,0-9.9,2.8-9.9,9.6v11.9h-7V9.2h7v3.5C47.3,10.4,50.5,8.8,55.3,8.8z” />\r\n <path d=“M83.2,19.5h-7.4c-0.6-3-2.9-4.6-6.1-4.6c-4.2,0-7,3.3-7,8s2.9,8,7,8c3.3,0,5.5-1.8,6.1-4.6h7.4C82,33.1,76.9,37,69.9,37\r\n c-8.3,0-14.2-5.6-14.2-14.1c0-8.7,6-14.1,14.2-14.1C77,8.8,82,12.9,83.2,19.5z” />\r\n <path d=“M100.7,8.8c6.5,0,11.6,4.7,11.6,11.9v16h-7V21.5c0-4.2-2.1-6.9-6.3-6.9s-6.6,2.8-6.6,7.5v14.6h-7V0h7v12\r\n C94.2,9.9,96.9,8.8,100.7,8.8z” />\r\n <path d=“M142.3,25.1h-20.7c0.8,4.1,3.5,6.1,6.8,6.1c3,0,5.3-1.2,6.1-3.9h7.5c-1.4,6-6.8,9.6-13.3,9.6c-8.7,0-14.1-5.7-14.1-14.1\r\n c0-8.6,5.5-14,14.1-14c5.3,0,9.7,2.3,12,6.3C142.2,18.2,142.8,21.7,142.3,25.1z M135.1,20c0-2.9-2.8-5.5-6.5-5.5\r\n c-4.2,0-6.3,2.6-7,5.5H135.1z” />\r\n <path d=“M165.5,18h-6.5c-0.2-2.8-1.8-3.8-4.1-3.8c-2.1,0-3.5,1-3.5,2.6c0,1.5,1.9,2.1,5.6,3.5c5.2,2,8.8,4.1,8.8,8.5\r\n c0,5.2-4.5,8.2-10.2,8.2c-7.3,0-11.2-3.9-11.9-9.6h7c0.4,3,2.5,4,4.7,4c2.5,0,3.5-1.2,3.5-2.8c0-2.1-2.3-2.4-7.6-4.6\r\n c-4.5-2-6.4-3.8-6.4-7.3c0-4.4,3.8-8,10.3-8C161,8.7,165.1,12.6,165.5,18z” />\r\n <path d=“M184.6,30.7v6h-3.7c-6.7,0-9.5-3.2-9.5-9.6V15.2h-3.3V9.2h3.3V1.7h7v7.5h6.1v5.9h-6.1v11.9c0,2.4,0.7,3.6,3.4,3.6\r\n L184.6,30.7z” />\r\n <path\r\n d=“M204.7,8.8v6.3c-8,0-9.9,2.8-9.9,9.6v11.9h-7V9.2h7v3.5C196.7,10.4,199.9,8.8,204.7,8.8z” />\r\n <path\r\n d=“M234.2,9.2v27.5h-7.1v-3.1c-1.8,2.2-4.8,3.4-8.9,3.4c-7.5,0-12.7-5.8-12.7-14s5.2-14.1,12.7-14.1c4,0,7,1.4,8.9,3.8V9.2\r\n L234.2,9.2L234.2,9.2z M227.1,22.9c0-4.8-2.8-8-7.2-8s-7.3,3.1-7.3,8c0,4.6,2.5,7.9,7.3,7.9C224.1,30.8,227.1,27.7,227.1,22.9z” />\r\n <path d=“M253.9,30.7v6h-3.7c-6.7,0-9.5-3.2-9.5-9.6V15.2h-3.3V9.2h3.3V1.7h7v7.5h6.1v5.9h-6.1v11.9c0,2.4,0.7,3.6,3.4,3.6\r\n L253.9,30.7z” />\r\n <path d=“M284.3,22.9c0,8.6-5.9,14.1-14.1,14.1c-8.3,0-14.1-5.6-14.1-14.1s5.8-14,14.1-14C278.7,8.8,284.3,14.4,284.3,22.9z\r\n M263.3,22.9c0,4.8,2.7,8.1,7,8.1c4.3,0,6.9-3.4,6.9-8.1c0-4.8-2.7-8-6.9-8C265.9,14.9,263.3,18.2,263.3,22.9z” />\r\n <path\r\n d=“M304,8.8v6.3c-8,0-9.9,2.8-9.9,9.6v11.9h-7V9.2h7v3.5C295.9,10.4,299.1,8.8,304,8.8z” />\r\n \r\n\r\n <div class=“loader-mask”>\r\n\r\n <div class=“loader-logo-wrap”>\r\n <svg version=“1.1”\r\n id=“orchestrator-logo-ui”\r\n xmlns=“http://www.w3.org/2000/svg”\r\n xmlns:xlink=“http://www.w3.org/1999/xlink”\r\n x=“0px”\r\n y=“0px”\r\n width=“37px”\r\n height=“37px”\r\n viewBox=“0 0 37 37”\r\n enable-background=“new 0 0 37 37”\r\n xml:space=“preserve”>\r\n <rect id=“orchestrator-square-logo-blue”\r\n x=“1”\r\n y=“1”\r\n fill="#1976D2"\r\n width=“35”\r\n height=“35” />\r\n <path fill="#FFFFFF"\r\n d=“M22.2,20.6c0,4.8-2.7,7.7-7.3,7.7c-4.5,0-7.2-2.8-7.2-7.7V10h3.6v10.6c0,2.7,1.1,4.3,3.6,4.3\r\n c2.4,0,3.6-1.5,3.6-4.3V10h3.6V20.6z” />\r\n <rect x=“25.1”\r\n y=“13.9”\r\n fill="#FFFFFF"\r\n width=“3.6”\r\n height=“14.2” />\r\n <path fill="#FFFFFF"\r\n d=“M26.9,12.2c-1.2,0.1-2.1-0.8-2.2-2c0-0.1,0-0.1,0-0.2c0.1-1.2,1.1-2.2,2.3-2.1c1.1,0.1,2.1,1,2.1,2.1\r\n c0,1.2-0.9,2.1-2,2.2C27,12.2,27,12.2,26.9,12.2” />\r\n \r\n \r\n \r\n \r\n \r\n <script type=“text/javascript” src=“dist/runtime.7c89f211f76412a3f486.js”>\r\n <script type=“text/javascript” src=“dist/scripts.6475865f89df29497a49.js”>\r\n <script type=“text/javascript” src=“dist/polyfills-es5.c5bc0c891a605781b960.js” nomodule>\r\n <script type=“text/javascript” src=“dist/main.02367a2cd6311f4abac1.js”>\r\n\r\n\r\n",
“level”: “Information”,
“logType”: “User”,
“timeStamp”: “06:42:59”,
“processVersion”: “1.0.0”,
“jobId”: “e81b17e1-6274-4858-a275-67006bf033c0”,
“robotName”: “ceivmadas0123”,
“machineId”: 241,
“organizationUnitId”: 33
}

seems your endpoint is incorrect - pls try to follow above mentioned steps…

1 Like