API Call Returns Response In HTML Instead Of JSON

API Call 'Get Queue Items' returns HTML response instead of JSON.

When making the following call: GET ​/odata​/QueueItems with $filter on Key, the response body is HTML and not JSON:

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="utf-8" />

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="description" content="" />

<meta name="author" content="" />

<meta name="referrer" content="no-referrer" />

<base href="/almatotest/DefaultTenant/orchestrator_/" />

<title>UiPath Orchestrator </title>

<link rel="shortcut icon" href="favicon.ico" />

<script type="text/javascript" src="js/redirect.js" nomodule></script>

<script type="text/javascript" src="dist/assets/js/preload.js?version=2021.11.0-s83.1587"></script>

<link rel="stylesheet" type="text/css" href="dist/preloader.theme.4b792a8854d81d73.css?version=2021.11.0-s83.1587" />

<link rel="stylesheet" type="text/css" href="dist/default.theme.3fdd828d81a1609a.css?version=2021.11.0-s83.1587" />

<link rel="stylesheet" href="/portal_/apollo/packages/apollo-fonts/1/font.css?spaceName=orchestrator" />

<script type="module" src="/portal_/apollo/packages/portal-shell/2/portal-shell.esm.js?spaceName=orchestrator"></script>

</head>

<body class="light apollo-design">

<portal-sheet>

<ui-app>

<div class="loader-container">

<svg class="loader-animation"

width="400"

height="400"

viewBox="0 0 400 400"

xmlns="http://www.w3.org/2000/svg">

<path class="animated-path"

d="M32,48H352V368"

fill="none"></path>

<path class="animated-path"

d="M368,352H48V32"

fill="none"></path>

</svg>

</div>

<span class="material-icons-outlined" style="position:absolute; font-size: .1px; color: transparent">people</span>

</ui-app>

</portal-sheet>

<script type="text/javascript" src="dist/runtime.04ff80010682a865.js?version=2021.11.0-s83.1587"></script>

<script type="text/javascript" src="dist/polyfills-es5.js?version=2021.11.0-s83.1587" nomodule></script>

<script type="text/javascript" src="dist/main.b70eee6c87d2d3d2.js?version=2021.11.0-s83.1587"></script>

</body>

</html>

Root Cause: Most likely there was an issue with the endpoint that was being used as the issue can be reproduced when misspelling the endpoint - note that the underscore "_" after "orchestrator" is missing.

5.jpg

6.jpg

And when using the correct endpoint:
7.jpg

This has been tested with other endpoints with the same results, for instance:
8.jpg




Resolution:

  • Delete the endpoint and write it by hand or copy it directly from Swagger to make sure there are no encoding issues.