API Test Tool Error - "No Sites Returned"
Less than to read
If you have setup the API and Sage 200 API test tool and recieving the error message “No sites returned”, this guide will go through how to troubleshoot these issues. Please review the checklist of areas to check to make sure the API has been correctly configured:
This error message can also manifests itself in Postman when you query the sites endpoint, you will get a ‘200 OK’ response but a blank body.
Is your Sage server turned on?
Make sure that the Sage 200 server is turned on. When you have installed the Azure Application Proxy tunnel, there are services which communicate with Azure and allow the API to communicate with Sage.
Did you receive an error message when installing the Azure Application Proxy tunnel?
It may have been that when you have attempted to install the tunnel to connect Sage 200 and Office 365, you received the following error message:
“AADST650052
: The app needs access to a service that your organization has not subscribed to or enabled. Contact your IT Admin to review the configuration or your service subscriptions.”
If you have received this error message, this means that the Microsoft 365 account you are logging in with has not yet been associated with the Sage Business Centre. You should have received an email from [email protected] detailing how to onboard your Office 365 subscription.
If you have not received this email:
- Sage 200 Standard Customer: Please contact Technical Support on 0191 479 5955 and ask to check the email address the onboarding email went to.
- Sage 200 Professional Customer: Speak to your Sage Accredited Business Partner.
- Sage 200 Business Partner: Raise a case through Case Management, or call 0191 479 5933 with your clients details and the correct email address they want the onboarding email sent to.
Check the API tab within System Administration
There are 3 states that the API tab will show Disabled, PendingAuthorisation or Enabled.
Please see the following steps to resolve:
-
Disabled: This means the API has not been set up. Please make sure you have followed this guide on setting the API up and that your Office 365 registration has been onboarded.
-
PendingAuthorisation: This means that you have used an email address that is not an admin@***.onmicrosoft.com email address. To utilise the API, this must be enabled by our Technical Support team.
- Sage 200 Professional Customer: Inform your Business Partner your API registration needs to be enabled.
- Sage 200 Business Partner: Raise a case through Case Management, or call 0191 479 5933 with the following information: Site Name, Site URL & the email used to set the API up.
Once this has been enabled by Technical Support, you can go to Action > Refresh and the API will show as Enabled immediately.
- Enabled: The API tab is populated automatically when running the Application Proxy Tunnel installer. If you have received a message from the installer stating that the installation was completed, move on to the next step. If you have edited this tab and input your details manually, click on Edit and untick the API enabled box. This will remove all API entries, allowing you to onboard correctly using this article.
“An error has occured! Please see log files for more details” when attempting to add a Sage ID in for a user in System Administration
This error occurs when you are trying to add a Sage ID in the API for a user in System Administration. You would need to go to
inetpub/Sage 200 App Services/Sage200SecuredServices/logs
to view the detail of the error.
The most likely reason for this error is that you have entered the same email address twice for 2 different users in the Sage ID tabs, or you have unticked the Azure AD tickbox against the user who has set up the API initially.
The quickest way to resolve this error and to correct any mistakes is to disable the API, and uninstall the Application Proxy Installer. This guidewill talk you through how to do this.
System Administration crashes when you are attempting to open the API tab
It has been seen when incorrect credentials have been entered into the login box that is prompted when trying to access the API tab, this will cause the entire of System Administration to close unexpectedly. This will continue to do so every time you select the API tab.
The quickest resolution would be to speak to our Technical Support team, who can advise you which email address the API was initially set up with. When you have this email address, install System Administration on another PC on the network and attempt to log in and access the API tab. This should then allow you to successfully disable the API.
The Native API application is missing from within Azure Active Directory
As part of the installation of the Azure Active Directory Tunnel, the installer will talk you through how to create an on-premise gateway which is required to allow the API to communicate to your Sage server via the Azure Tunnel. The application can be found by logging into aad.portal.azure.com, Enterprise Applications, All applications and should look like this:
If you cannot see this application:
- Re-open the AppProxyInstaller.exe file from within the installer folder.
- There will be an option to click on Reconfigure at the top. Click this.
- When prompted, log in with the same Microsoft 365 account used when you set the API up.
The form will now populate in step 8 with the Native Name and Native Internal URL required to create the application. Leave the installer open and follow the steps documented above to create the application.
Are the Azure Active Directory Services running on your Sage server?
When you install the Azure Active Directory Proxy tunnel, there are 2 services which are created:
These services can be found in services.msc.
You can type services.msc into Window’s search box in the bottom left hand corner, this will open the Windows Services. If these services are stopped, right click on them and choose Start.
If they are missing, this means the Application Proxy Tunnel has not been installed. Please see this guide on setting up the Native API.
The Application Proxy is disabled
On very rare occasions it has been seen that the Application Proxy has been disabled on the Azure Active Directory side. To determine whether this is the problem:
- Visit aad.portal.azure.com
-
Log in and go to Enterprise Applications Application proxy and you should see this screen:
- If the proxy is disabled, the status will be Inactive and there should be an option to Enable application proxy at the top.
There is a problem with your Microsoft 365 tenant
When the API has been successfully configured, you should be able to return a 1
in your browser by typing in the following URL: (The below URL requires you to replace yourtenantname
with your tenant name)
https://sage200nativeapi-yourtenantname.msappproxy.net/Sage200NativeAPI/internal/api_status
If everything has been configured correctly as above, and you receive any error when accessing this URL outside your network, you will need to consult with Microsoft about what could be wrong with the tenant. Once Microsoft have resolved any issues that may have arisen, please revisit this article to work back through the steps again.