Sage 200 - Creating a Custom Connector for Microsoft Power Apps or Power Automate
Description

Prerequisites

Before following this article, you must have set up the Microsoft Entra enterprise application. 
Note: Microsoft Entra ID was formerly known as Azure Active Directory.

If you have not done this, check and follow this article first before you continue: Sage 200 - Create the Microsoft Entra enterprise application for Power Automate / Power Apps.

You will need a copy of your subscription key which is part of your Sage API ID. To get this:

  1. Go to developer.columbus.sage.com.
  2. Select UK.
  3. Select your version of Sage 200, either Sage 200 Professional or Sage 200 Standard Online.
  4. Select Sign In, and sign in using your Sage ID account.
  5. Select to show your Primary Key in the Your Subscriptions section.
  6. Make a note of the Primary Key somewhere, for example copy and paste it into notepad. You'll need to enter this as your subscription key later.

You should see a screen that looks like this:

You will also need the flows folder associated with your version of Sage 200. This contains the Swagger.json file to create the custom connector, as well as two examples flows to import and test.

Before continuing, make sure you unzip the download folder and place the contents in an accessible folder.

  • You can download the swagger file/flow examples for Standard/Sage for Education here.
  • You can download the swagger file/flow examples for Professional 2024 R2 here.
  • You can download the swagger file/flow examples for Professional 2024 R1 here.
  • You can download the swagger file/flow examples for Professional 2023 R2 here.
  • You can download the swagger file/flow examples for Professional 2023 R1 here.
  • You can download the swagger file/flow examples for Professional 2022 R2 here.
  • You can download the swagger file/flow examples for Professional 2022 R1 here.
  • You can download the swagger file/flow examples for Professional 2021 R1 here.
  • You can download the swagger file/flow examples for Professional 2020 R2 here.
  • You can download the swagger file/flow examples for Professional Summer 2019 here.
  • You can download the swagger file for Professional Winter 2018 and Spring 2019 here.

NOTE: To understand the support boundaries associated with Microsoft Power Automate and PowerApps, see Microsoft 365 and Sage Support Boundaries / Definitions.

Cause
Resolution

Creating a custom connector

NOTE: We have a video on how to create a custom connector. Click here to watch.

This custom connector facilitates the link between Power Apps / Power Automate and Sage 200.

To set this custom connector up, visit make.powerautomate.com and sign in using the Microsoft 365 account you used when creating the Microsoft Entra enterprise application (Azure Active Directory application).

Note: you can also set this up from powerapps.microsoft.com. The custom connector will be shared between both Power Apps and Power Automate.

After logging in, go to Data then Custom Connectors on the left hand side.

In the top right hand corner, select 'New customer connector', then select Import an Open API file.


Give the connecter a name, such as Sage 200 Custom Connector.

Select Import and browse to the Custom connectors folder from the zip file you downloaded. Select the Sage 200.PowerApps.swagger.json file, select Open, then select Continue.

Once the file has uploaded, you’ll see the General Information page:

  • Give the connector a description, such as Sage 200 custom connector.
  • Leave the Scheme as HTTPS.
  • The host will be api.columbus.sage.com.
  • The Base URL will be different depending on whether you are setting this up for Sage 200 Standard/Education or Sage 200 Professional:

    Sage 200 Standard/Education – /uk/sage200/accounts/v1


    Sage 200 Professional - /uk/sage200extra/accounts/v1

Note: You must have the leading / in the Base URL. Do not leave this out.

Next, choose Security. Set the authentication type to OAuth 2.0.

In the OAuth 2.0 settings:

  • Set the Identity provider to Azure Active Directory.
  • The Client id will be the application (client) id you copied when setting up the Microsoft Entra enterprise application (Azure Active Directory application).
  • The Client secret will be the secret key you copied when setting up the Microsoft Entra enterprise application (Azure Active Directory application).
  • Set the Resource URL to https://SageCSPEU.onmicrosoft.com/6ce3bbc5-d381-4d11-b079-50accd62241a
  • Do not change the Login URL, Tenant ID and Scope.

Once you’ve finished, click on Create connector at the top. Allow a few minutes for the connector to be created.

You must then copy the Redirect URL and make sure you record this somewhere like a notepad file. Keep this safe, as you’ll need to update the Microsoft Entra enterprise application (Azure Active Directory application) you created before with this Redirect URL. It should look like this:

To update the Redirect URL, go to entra.microsoft.com.

Log in with your Microsoft 365 email address and password.

Go to Identity > Applications > App Registrations.

Select the application you created before, then choose Authentication.

Click on Add a platform, choose Web and paste the Redirect URI in the relevant field.

Click Configure, then Save the application.

Now, go back to your Customer Connector and go to the Test tab. From here click on New Connection, then click on Create.

NOTE: You may be asked to sign in with your Microsoft 365 account. You must accept the terms and conditions.


Your custom connector will be listed here. Select custom connectors and click on the pencil icon. Now move to the test tab and select the option of GetSites from the list of operations on the left hand side.

Once this has been highlighted, copy your subscription key into the ocp-apim-subscription-key field. Click on test operation. This may take a couple of minutes to complete.

Look at the test response field. You should see the following:

  • The status is OK (200)
  • The body will show details of your companies in Sage 200.
  • At this point, copy the company_id and site_id for each company listed. You’ll need these details when setting the flows up. An example of what you should see is below.

If you get a status of OK (200) but the body is empty this may be due to:

  • Sage 200 Professional server is not running.
  • You have not set up 200 to connect with Microsoft 365 and assigned a Microsoft email address to a user within Sage 200.
  • The Native API application has not been created in Microsoft Entra ID (Azure Active Directory).

NOTE: To assign a user API access, see Set up user email addresses in Sage 200 (Sage 200 Professional) or Set up user email addresses in Sage 200 (Sage 200 Standard / Sage for Education). 

You can now click Close.

You have now successfully set up the custom connector.

For more details of Power Automate setup, see Set up Microsoft Power Automate with Sage 200 (Professional) or Set up Microsoft Power Automate with Sage 200 (Sage 200 Standard / Sage for Education).

To see how to import and set up one of the demonstration Flow, see Sage200 - Power Automate Demonstration Application.

To see how to import and set up the demonstration PowerApp, see Sage 200 - Power Apps Demonstration Application.


Sage Business Partners can now log new cases online!

If you're unable to find the help you require from our online resources, log a new case with us without having to use phone or email. Simply select 'Manage your cases' from the dashboard or visit my.sage.co.uk/cases.

[BCB:19:UK - Sales message :ECB]










Steps to duplicate
Related Solutions