Hey guys,
i am trying to implement a post method on our webpage to start the roboter.
i cant get the token and then go further.
I tried it with postman → No problems. Got the token and i can start the roboter via postman.
But in Nodejs via axios i just get status 200 and in the data object a html page as a return.
I tried using grant_type as “client_credentials” and many other.
What am i doing wrong?
const { default: axios } = require('axios');
axios
.post(
'http://cloud.uipath.com/quantjljabnl/Quantum/identity/connect/token',
{
grant_type: 'refresh_token',
client_id: '998dc874-7f0f-463e-a4a1-XXXXXXXXXXXX',
client_secret: '5!sI^M!KXXXXXXXX',
scope:
'OR.Administration OR.Analytics OR.Assets OR.Audit OR.BackgroundTasks OR.Execution OR.Folders OR.Hypervisor OR.Jobs OR.License OR.Machines OR.ML OR.Monitoring OR.Queues OR.Robots OR.Settings OR.Tasks OR.TestDataQueues OR.TestSetExecutions OR.TestSets OR.Users OR.Webhooks',
},
{
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Security-Policy': '*',
'Access-Control-Allow-Origin': '*',
},
}
)
.then((data) => {
console.log('Data: ', data);
})
.catch((err) => {
console.error('Error: ', err);
});
That is what i get back
data: '<!DOCTYPE html>\n' +
'<html lang="en">\n' +
'<head>\n' +
' <meta charset="utf-8" />\n' +
' <meta http-equiv="X-UA-Compatible" content="IE=edge" />\n' +
' <meta name="viewport" content="width=device-width, initial-scale=1" />\n' +
' <meta name="description" content="" />\n' +
' <meta name="author" content="" />\n' +
' <meta name="referrer" content="no-referrer" />\n' +
'\n' +
' <base href="/quantjljabnl/Quantum/orchestrator_/" />\n' +
'\n' +
' <title>UiPath Orchestrator </title>\n' +
' <link rel="shortcut icon" href="favicon.ico" />\n' +
' <script type="text/javascript" src="js/redirect.js" nomodule></script>\n' +
'\n' +
'\n' +
' <script type="text/javascript" src="https://orch-cdn.uipath.com/client/dist/assets/js/preload.js"></script>\n' +
'\n' +
' <link rel="stylesheet" href="/portal_/apollo/packages/apollo-fonts/1/font.css?spaceName=orchestrator" />\n' +
' <script type="module" src="/portal_/apollo/packages/portal-shell/2/portal-shell.esm.js?spaceName=orchestrator"></script>\n' +
'\n' +
'</head>\n' +
'<body class="light apollo-design" data-cdn-url="https://orch-cdn.uipath.com/client" data-build-version="2022.5.0-s95.1752">\n' +
' <portal-sheet>\n' +
' <ui-app>\n' +
' <div class="loader-container">\n' +
' <svg class="loader-animation"\n' +
' width="400"\n' +
' height="400"\n' +
' viewBox="0 0 400 400"\n' +
' xmlns="http://www.w3.org/2000/svg">\n' +
' <path class="animated-path"\n' +
' d="M32,48H352V368"\n' +
' fill="none"></path>\n' +
' <path class="animated-path"\n' +
' d="M368,352H48V32"\n' +
' fill="none"></path>\n' +
' </svg>\n' +
' </div>\n' +
'\n' +
' <span class="material-icons-outlined" style="position:absolute; font-size: .1px; color: transparent">people</span>\n' +
' </ui-app>\n' +
' </portal-sheet>\n' +
' <script type="text/javascript" src="dist/assets/cdn.js?version=2022.5.0-s95.1752"></script>\n' +
'</body>\n' +
'</html>\n'
}