Solved

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

  • 17 November 2023
  • 1 reply
  • 65 views

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.

icon

Best answer by Cecil 17 November 2023, 16:50

View original

1 reply

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


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved