Authenticate API happen HTTP Error 404

orchestrator
api

#1

hello,
we get an HTTP Error 404 from API’s methods
after we update the orchestrator to v2018.2 (from v2017.1).

ex. original Authenticate API URL such as https://XX.XX.XX.XXX/api/Account/Authenticate

API methods has been running 6 months,
now we got this error after update the orchestrator to v2018.2
Could anyone encounter this issue?
Please help us, thank you!


#2

@arivu96
@Indrajit_Banerjee


#3

POST /api/Account/Authenticate (which was an alias) is no longer available in 2018.2
Please use POST /api/Account.

Swagger for reference: https://platform.uipath.com/swagger/ui/index#!/Account/Account_Authenticate


#4

hello, i had already try to use POST /api/Account ,
but it does not work, i get the same error http 404,

In fact, i also had try to call the test api
https://platform.uipath.com/api/account/authenticate
and i get token successfully,
however when i use the same website code to call our orchestrator API,
it will happen http 404 error.
I really have no idea… Please help us! thank you!

website code to call authenticate API as follows (C#):

        string stoken = "";
        string urlAuthenticateAPI = "https://" + strServerIP + "/api/Account/Authenticate";
        //string urlAuthenticateAPI = "https://" + strServerIP + "/api/Account";
        //string urlAuthenticateAPI = "https://platform.uipath.com/api/account/authenticate";
        string strex = "";

        System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
        HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(urlAuthenticateAPI);
        string param = "TenancyName=XXX&UsernameOrEmailAddress=XXX&Password=XXX";
        
        try
        {
            req.Method = "POST";
            req.ContentType = "application/json";
            using (var streamWriter = new StreamWriter(req.GetRequestStream()))
            {
                string json = "{\"tenancyName\": \"XXX\",  \"usernameOrEmailAddress\": \"XXX\", \"Password\": \"XXX\"}";
                //string json = "{\"tenancyName\": \"YYY\",  \"usernameOrEmailAddress\": \"YYY\", \"Password\": \"UipathYYYY\"}";
                streamWriter.Write(json);
            }
            using (WebResponse wr = req.GetResponse()) //http error (404)。
            {
                StreamReader sr = new StreamReader(wr.GetResponseStream());
                string Alljson = sr.ReadToEnd();
                stoken = JObject.Parse(Alljson)["result"].ToString();
                sr.Close();
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "test", "alert('" + stoken + "!');", true);
            }
        }
        catch (Exception ex)
        {
            strex = ex.Message.ToString();
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "test", "alert('" + strex + "!');", true);
        }
        finally
        {
        }

#5

Is there any possible such that we could called authenticate API from https://platform.uipath.com/api/account/authenticate, but we could not call the authenticate API from our orchestrator at our website??
ps. we use the same website code but just replace URL & Account

however, we couid get token from the http-request activity in Uipath Studio.


#6

Could you check the server log for verifying the request did reach the server?


#7

hi, i found that the logs does not contain any API record after we updated the Orchestrator. But there it is before we updated. And, I had already check the port 80, 443, 1433 both was opened now. Should i open any port for API serviece?


#8

double check with infra team who installed the orchestrator see if they assigned a different port.
if it isn’ tthe network issue, you should be able to see this if u put in to the address in client browser

https://{your site}/api/Account

{“message”:“The requested resource does not support http method ‘GET’.”}


#9

hi when i put http://IP/api/Account/ in client browser,
we just get http error as follows:

Not Found
HTTP Error 404. The requested resource is not found.

and, i had already check the port of our orchestrator website in iis was set as 443.


#10

Any solution for this?