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.
Reply
  • 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.
Children