Orchestrator API - Getting error while Authenticating ("loginModel must not be null")

I am trying to write a Node.js code to call orchestrator API for Authentication. I am getting the below error,
Response: {“message”:“loginModel must not be null”,“errorCode”:0,“resourceIds”:null}
any help is really appreciated.

==============Node.js Code====================
var http = require(‘https’);
exports.handler = function(event, context){

    var params = {
      "tenancyName": "tenantName",
      "usernameOrEmailAddress": "emailId",
      "password": "password"
    };

   var req = http.request({
        host: "platform.uipath.com",
        port: 443,
        path: "/api/account/authenticate",            
        method: "POST",
        dataType: "json",
        headers: {
                    "Content-Type": "application/json",
                    "Accept": "application/json"
                  },
        data: JSON.stringify(params)
    }, function (response) {
        response.on('data', function(data) {
       console.log('Response: ' + data);
   });
   
});
req.setTimeout(5000, function() {
   console.log('Request timed out.');
});
req.on('error', function(ex){
       console.log('Request was a failure. ' + ex.message);
});
req.write('');
req.end();

};

Please check this thread, we’re working on a fix: UiPath Orchestrator APIs not working since Cloud Platform Release

1 Like

Still the same error “loginModel must not be null”.

And you have already tried calling it from a service such as postman, just to check if you actually have a connection?

I am getting same error while hitting the “https://platform.uipath.com/api/account/authenticate” in postman
how should i authenticate???

Running “https://platform.uipath.com/api/Account/Authenticate” in postman and getting the same error
{
“message”: “loginModel must not be null”,
“errorCode”: 0,
“resourceIds”: null
}
Is there any fix for this?

2 Likes

We are trying to connect to on premise Orchestrator API from OSB Middleware and getting this error. We are able to connect using Postman as well as Python script. Any solutions?

I have the same issue, unable to autenticate via Swagger or Postman
Same error:
{
“message”: “loginModel must not be null”,
“errorCode”: 0,
“resourceIds”: null
}

I am working on an On-Premise orchestartor and I can access it just fine.
However, I fail to even authenticate using APIs

Hello everyone,

I am facing the same issue, getting back the JSON error:
{
“message”: “loginModel must not be null”,
“errorCode”: 0,
“resourceIds”: null
}

Is this issue fixed?

Thanks,
Jasmin

Hi @Jasmin_Becirevic

http://dealetech.com/the-definitive-guide-to-uipath-cloud-orchestrator-2019-09-rest-api-authentication/#dev

I got this solution for UiPath community Orchestrator from UiPath, Well I was not able to authenticate using this method also.
But if you might try now it might work.

Thanks

Hello everyone,

its working, so please ignore my reply “its not working”.

Didn’t know that the tenant param is mandatory.

I got my token back:

{
“result”: “…”,
“targetUrl”: null,
“success”: true,
“error”: null,
“unAuthorizedRequest”: false,
“__abp”: true
}

Thank you,
Jasmij

Hello,

I am following the documentation here: https://docs.uipath.com/orchestrator/reference/consuming-cloud-api to no avail.

I am setting my headers as in the docs and the body includes those three things:
{
“grant_type”: “refresh_token”,
“client_id”: “8DEv1AMNXczW3y4U15LL3jYf62jK93n5”,
“refresh_token”: “my refresh token value”
}

Sending a POST to https://account.uipath.com/oath/token
I get a response back of 404 Not Found

Please help!