Skip to content
Developerhome

Disabling and Enabling API

  Less than to read

This guide shows the process of disabling and re-enabling the Sage 200 API.

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.

:

Note: Sage recommends buying a 1 user Microsoft 365 tenant for testing purposes with the correct licence applied. Please see the supported licences. This makes the move from UAT to Live a straightforward process. If this is not possible and you will be using the same tenant for both test and live, please follow the steps below.

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.

Image

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.

Image

Click on Edit, then untick the option to enable the API.

Image

You will then see the message below. Click Yes then OK.

Image

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.

Image

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.
:

Caution: Do not delete the Sage Business Centre application. Doing this will offboard your tenant from Microsoft 365 and cause issues if you try to onboard again.

Image

Once selected you will see this screen:

Image

Select Properties and then click on Delete at the top of the page.

Image

This will delete the application. Repeat this for the other application you have not yet deleted.

:

Caution: Do not delete the Sage Business Centre application. Doing this will offboard your tenant from Microsoft 365 and cause issues if you try to onboard again.

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.

:

Caution: Should you need to take this step, do not restore the configuration database back into the live setup. Doing so will break the live site connection to the API, which will require further work to repair. Any changes you need to make to the live configuration database should be done in the form of a script.

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.