Skip to main content
Solved

Error 500 when I specify tenant with REST API login in Visual studio

  • November 17, 2023
  • 1 reply
  • 154 views

  • Freshman II
  • 10 replies

I’m using this nuget in visual studio: https://github.com/Acumatica/AcumaticaRESTAPIClientForCSharp/

Trying to set up a very basic bambooHR - Acumatica integration to create leave requests from bamboo as timeEntries in Acumatica.

When I log in with just a username and password, everything works and it logs me into our live tenant. When I use my local offline demo vm I have no tenants to test with also.

I want to log into our test tenant, but when I specify the test tenant and branch I get a Server error 500 - internal server error. 

Has anyone else run into this before?

 In my main program I have:

 myAcumaticaStuff.Login(AcumaticaBaseUrl, "ApiLogin", "******", "Staging", "Edmonton", "en-CA")

The sub in the module:

(myauthApi is from: Imports Acumatica.Auth.Api)

Public Shared Sub Login(siteURL As String, username As String, password As String, Optional tenant As String = Nothing, Optional branch As String = Nothing, Optional locale As String = Nothing)
            myauthApi = New AuthApi(siteURL)

            Try
                Dim loginRequest As New Credentials(username, password, "", tenant, branch, locale)
                myauthApi.LogIn(loginRequest)
                Console.WriteLine("Login successful!")
            Catch ex As ApiException
                Console.WriteLine("An error occurred: " + ex.Message)
            End Try

End Sub

 

I’ve tried to use the tenant ID instead of its name but I get the same error.

Best answer by Cecil

I’m an idiot (and the documentation is clear as mud) 
We cannot use the tenant ID or Tenant Name field to log in.
I needed to use the “Login Name” field.

In hindsight it’s kinda obvious but everything else refers to the tenant name not the tenant LOGIN name.

Hopefully this helps someone else in the future.

View original
Did this topic help you find an answer to your question?

1 reply

  • Author
  • Freshman II
  • 10 replies
  • Answer
  • November 17, 2023

I’m an idiot (and the documentation is clear as mud) 
We cannot use the tenant ID or Tenant Name field to log in.
I needed to use the “Login Name” field.

In hindsight it’s kinda obvious but everything else refers to the tenant name not the tenant LOGIN name.

Hopefully this helps someone else in the future.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings