Disabling and Enabling API
Less than to read
This guide shows the process of disabling and re-enabling the Sage 200 API.
- Uninstall the app proxy
- Disable the API
- Remove Users
- Delete Apps
- Re-install API
- Further Considerations
The following steps are to be carried out when:
- You are moving from a UAT environment into your live environment and are wanting to continue to use the API for the Microsoft 365 tenant that was used during testing.
- You wish to change the email address that was used in the installation of the Native API Tunnel.
Please note there is a section further below for alternative considerations you may wish to take into account when moving a configuration database containing API information.
1. Uninstall the app proxy installer from the server.
Using the App Proxy Installer you used when setting up the Native API tunnel, choose the Uninstall option. Next you need to log in with the Microsoft 365 tenant you originally set the Native API tunnel. Confirm the actions and you should receive a message at the end of the installer stating this has been successful.
2. Disable the API within System Administration.
Open System Administration. Click on the API tab and log in with your Microsoft 365 tenant details. You will then be greeted with a screen that shows the API as enabled with the site name and URL.
Click on Edit, then untick the option to enable the API.
You will then see the message below. Click Yes then OK.
3. Remove any additional API users from System Administration.
Once the API has been disabled, go to Users and right click on any user that was set up as an API user.
Go to the API tab and untick the Azure AD box that contains the user email.
4. Delete the apps you created in Azure Active Directory.
Once the above steps have been completed, go to https://aad.portal.azure.com and log in using your Microsoft 365 credentials.
Go to: Enterprise applications
> All applications
and select one of the following apps:
- Sage200ContractAPI
- Sage200NativeAPI.
Once selected you will see this screen:
Select Properties and then click on Delete at the top of the page.
This will delete the application. Repeat this for the other application you have not yet deleted.
5. Re-install the Azure App Proxy Installer.
Follows the steps in this article to set up the Azure Active Directory tunnel again.
Further considerations when moving from one server to another
There may be further things to consider when thinking about moving a configuration database from one server to another that are listed below:
-
I am taking a copy of the data and configuration database offsite for investigation for a non API related query, but the API is set up in the live system?
If this is the case, you can continue to take a back up of both the company database and the configuration database. Before opening System Administration to load in the existing configuration database, you will need to break the link between this configuration database and the API, so that you can successfully update your users before testing.
To break the link between the offsite configuration database and the API, run the following statement in SQL Server Management Studio:
--delete the entry to the API
DELETE FROM tblParameters where ParameterName = 'APISiteID'
--delete API user entries
DELETE FROM tblExtIdentity where ExtIdentityTypeID IN (1,2)
--remove any API references to existing users
UPDATE tblUser
SET isAPIUser = 0
WHERE isAPIUser = 1
This will break the link and show this configuration database and the API as disabled. You can now continue to test as normal.