Unable to make a GET call using Sage 300 Web API

Recently I've installed the Sage 300 Web Screens in order to try the Sage 300 Web API, the wed interface (Web Screens) is working fine, I'm able to enter orders, look up for customers, items etc. But, when I try to make a call using the Swagger UI, the browser ask for login credentials I'm using the Sage 300 credentials and got this error: { "error": { "code": "PermissionNone", "message": { "lang": "en-US", "value": "Insufficient security rights for user." } } }.

Any one have any idea what I'm doing wrong.

Thanks in advance.

  • Hey,

    A few things to be aware of:

    • Have you enabled the "Sage 300 Web API" Group Rights to the login you are using?
    • Are you entering the credentials for the Sage 300 user in upper case? This is not our login dialog in Swagger and therefore does not force upper case. So, you have to enter in upper case.
    • Are you using admin as a user? If so, by default the ADMIN user is disabled from the web api. There are two web.config files that have a property to allow the admin user access in the web api. They are in the ...\Online\Web and ...\Online\WebApi folders. Set the flag to true and reset IIS.

    Thanks,

  • in reply to John Thomas

    Hi John,

    As you said setting the property on the web.config to allow admin access, worked just perfect.

    Thank you so much!

  • in reply to John Thomas

    Thank you John. On a new CRM 2018R3 integrated with Sage 300 2019, I couldn't get users to promote CRM companies into 300. It worked after enabling Web API group rights in Sage 300. I don't remember this coming up in training.

  • in reply to Shahzad Mustafa

    Hey, that is likely because the Security Group was already assigned. With the new CRM integration, certain aspects of this integration use the Web API to move data (import, promotion, etc,). The use of the Web API is subject to access rights (Security Groups) assigned to that user. Therefore, the proper group must be assigned to the user per module to allow this portion of the integration to work. This is also true for our SIRC integration (Sage Intelligence Reporting Cloud) where we use our Web API to populate the SIRC in-memory database. Therefore, if these rights are not assigned, SIRC and CRM integration will have issues.

    I hope this answers your question.

  • in reply to John Thomas

    Dear Thomas,

    Even after doing the above settings in my case the same error is prompting,

    1. I have created a seperate user in Sage CRM as well in Sage 300 as CRM for the synchronisation.

    2. Enabled the Sage 300 Web api group in all the modules

    3. Edited the web.config setting true to admin, even though i have seperate user called CRM.

    What else could be the issue.

    Environment - Windows Server 2012 R2 Standard, IIS 8, Sage Crm 2018 R3, Sage 300 2019.

    Could you please help me on this.

  • in reply to John Thomas

    hi

    I have a similar issue  - I m trying to call sage 300 erp webapi - arcustomer, but I m getting dblinkerror

     I just trying to make a call using swagger 

    http://10.10.0.12/Sage300WebApi/v1.0/-/SAMLTD/AR/ARCustomers using proper credentials 

    but I get the error below, upon a couple of web readings and blog posts, this error comes using SDK on the third-party app, but this prod, my sage is working fine, just when I call the API via swagger I get this error, I check the app pool settings even hosting a test API to check if all is working fine.

    since swagger can list all sage API endpoints I m not sure what could be the issue, please assist

    stacktrace registered the following error 

    (Inner Exception)
    Exception Source: ACCPAC.Advantage.COMSVR.Interop
    Exception Type: System.Runtime.InteropServices.COMException
    Exception Message: Error HRESULT E_FAIL has been returned from a call to a COM component.
    ---- Stack Trace ----
    AccpacCOMSVR.AccpacSvrDBLinkClass.ExOpenViewInstance(String ViewID, AccpacSvrView& ppView, Int32 OpenModes, Int32 OpenDirectives, Object OpenExtra, AccpacSvrProcessServerSetup ProcessServer) in ACCPAC.Advantage.COMSVR.Interop.dll
    ACCPAC.Advantage.Server.DBLink.OpenView(String viewID, ViewOpenModes openModes, Int32 prefetch, ViewOpenDirectives openDirectives, Object openExtra, ProcessServerSetup processServerSetup, ViewInfo& viewInfo) in ACCPAC.Advantage.Server.dll

    swagger API response 

    erorr is:

    {

      "error": {

        "code": "DBLinkError",

        "message": {

          "lang": "en-US",

          "value": "Unable to access the requested application due to an installation or configuration problem."

        }

      }

    }