Sage 300 API testing

Solved

Hi,

I am getting a way to connect via API. I installed Sage 300 with web screen and database is on the same machine. 

I can logon to webscreen. 

However, when I use swagger just see AP Vendor, I got the following response.  

{ "error": { "code": "Unauthorized", "message": { "lang": "en-US", "value": "Authentication error from invalid credentials." } } }

Where did I make mistake?

Thank you.

Parents
  • Hi  there are a couple of things you might need to do:

    1. Make sure you grant API access to your Sage 300 user by allocating it module Security Groups that have the Sage 300 Web API access role.  For example, if I wanted to setup a Web API account exclusively for API access to AP:
    2. I haven't actually confirmed this but I assume you need to also tick on the permissions you need in addition to the core Sage 300 WEB API permissions e.g. ensure you tick on Invoices Batch Inquiry if you want to retrieve a list of invoices from a batch:
    3. If its a lab environment and you're trying to use the ADMIN account to the API, make sure you set  AllowWebApiAccessForAdmin to true located in Online -> WebAPI -> web dot config file.


      I really don't recommend allowing ADMIN access to the API in the production environment for security reasons hence its set to false by default.  Don't forget to recycle the Sage 300 Pool AppPool in IIS after changing the setting.
  • 0 in reply to Tim - Accsys Consulting

    Tim

    Thank you. Even though I have not solved the issues, this really help. I will update here once I solved the isssue.

    Again thank you!!

  • +1 in reply to Ismo
    verified answer

    Hi  apologies the error I addressed is "Insufficient security rights for user".  The problem you're having is likely authentication method and password.  Please check the following:

    1. Open Administrative Services -> Users -> select your API user.
    2. Make sure your Authentication Method = Sage 300 or Both.
    3. Set a password and verify it.
        OR 
    4. Make sure you can login to Sage 300 with this account, with Windows Authentication unticked if using the classic screens:
    5. If you can succesfully login, and you've allocated access permissions for each module for the API, you should no longer receive the error when attempting to access the API.
    6. Finally you can test your credentials using swagger UI e.g.:
  • 0 in reply to Tim - Accsys Consulting

    Tim

    Thank you very much. This post solved the issue. Really appreciate your help!! I apologize for making a duplicate post.

  • 0 in reply to Ismo

    Hi  don't apologise I was just saving time pointing to this post, its not always easy to find things. All good, glad you had a win Thumbsup

Reply Children
No Data