API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

Connect as administrator

0
Hi,

I am trying to connect as an administrator, however I keep getting an User is not authenticated. Access denied. {id=1413082244} error.

Are there any special privilliges which needs to be enabled on my administrator account?

I have already enabled API for the customer which I wish to connect to.

Thanks!
created Mar 30, 2011 by marj
0% Accept Rate
Q 5 A 13 C 0

6 Answers

0
Hi,

Please post your code, marking _exactly_ which line causes this error.

From our logs, the error ID you mention is not from ConnectAsAdministrator(), but rather for a session.Company.Get() being invoked without you being connected first.


Best regards,
answered Mar 31, 2011 by Christian Estrup
0
The code I use for establishing the connection


    Public Function fnConnEconomic(ByVal ConnAdmin As Boolean, ByVal ConnAgreementId As Int64, ByVal ConnUsername As String, ByVal ConnPassword As String, Optional ByVal CustomerNumber As Int64 = 10) As Boolean
        Try
            If ConnAdmin = True Then
                strEcoConnSessionId = objEcoSessionConnectAsAdministratorWithCustomerNumber( _
                    ConnAgreementId, ConnUsername, ConnPassword, CustomerNumber)
            Else
                strEcoConnSessionId = objEcoSessionConnect( _
                    ConnAgreementId, ConnUsername, ConnPassword)
            End If
        Catch ex As Exception
            frmConnectionDetailslblStatusForeColor = DrawingColorRed
            frmConnectionDetailslblStatusText = exMessage

            fnConnEconomic = False
        End Try
    End Function



Since this is the first function called after the connection has been established this is where the error is generated

    Public Sub subCompany()
        Try
        'The single line underneath generates the error
            Company = objEcoSessionCompanyGet()
        Catch ex As Exception
            MsgBox(exMessage)
            Exit Sub
        End Try
    End Sub
answered Mar 31, 2011 by marj
0
I have still not been able to solve this issue. Any kind of help would be appreciated.

Thanks.
answered Aug 21, 2011 by marj
0
Hi,

Please try again, and post the (new) error ID you receive back.

We'll then check our logs again to validate the exact command flow we're receiving from your session.

(If you don't get an error when connecting, yet still get an error when subsequently Get'ing the Company, my guess is your session isn't being maintained properly - but we should be able to validate that from the error ID).


Best regards,
answered Aug 22, 2011 by Christian Estrup
0
Hi,

Thank you for the quick reply.

The error ID: 1726902214

Best regards
answered Aug 22, 2011 by marj
0
Hi,

The Company.Get request is the only one we receive from that particular session.

In other words, if you ARE actually connecting before, you're somehow losing your session between calls.

Please send  the administrator agreement number you're connecting with to our API support team (api@e-conomic.com), referencing this thread.


Best regards,
answered Aug 22, 2011 by Christian Estrup
Visma e-conomic A/S
...