Set up our sample integration with the basic data your users need to perform print REST API calls by pressing the NiceLabel Print button in D365SCM.
In D365SCM, go to System administration > Setup > NiceLabel Printing Integration
![]() |
Opening NiceLabel Printing Integration setup in D365SCM.
Configure the following 3 setup tabs:
-
General
-
Printers
-
Templates
Before you begin, carefully configure any data you use to perform print REST API calls.
![]() |
The General setup tab includes your account information necessary for every REST API call.
-
Set Service URL to the REST API location https://labelcloudapi.onnicelabel.com.
-
Set Subscription key to your developer portal subscription key. Use the subscription key for your primary production environment.
![]() |
Configuring the Printers setup tab for D365SCM users.
The Printers setup tab allows your users to retrieve a list of printers connected to NiceLabel Cloud and makes them available to select on the printing form.
On the Printers tab, click Refresh so you can:
-
Get an updated list of printers connected to NiceLabel Cloud.
-
Save your list of printers to your D365SCM database.
If you configure your General tab correctly, you get a successful response:
![]() |
If you configure your General tab incorrectly, you get an error:
![]() |
Clicking Printers > Refresh calls the NLPIntegrationParameters.RefreshButton_OnClicked method. This method has 3 main functions:
-
Deleting existing printer lists from the NLPPrinterParameters table.
-
Getting new printer lists from REST APIs.
-
Saving new printers list into the NLPPrinterParameters table.
Note the NLPrinting class in this method. To get lists of connected printers, call its associated NLGetPrinters method.
public static void RefreshButton_OnClicked(FormControl sender, FormControlEventArgs e) { // delete previous printers list ... NLPrinting NLPrint = new NLPrinting(); System.String[] listOfPrinters = NLPrint.NLGetPrinters(); int numOfPrinters = listOfPrinters.Length; ... // save new printers list }
NLPrinting is a C# wrapper for NLApiClient.dll. Customize your integration by changing the value of the useCloudPrinting parameter to print on cloud printers with Cloud Print API or classic printers connected to NiceLabel Automation with predefined Cloud Trigger API configurations (.misx).
-
To use Cloud printers, set useCloudPrinting to true.
-
To use Classic printers, set useCloudPrinting to false.
class NLPrinting { private boolean useCloudPrinting = true; public boolean configValid; private str NLPrintServiceURL; private str NLPrintSubscriptionKey; private NLApiClient.BaseIntegrator obj; ... }
The NLPrinting class constructor reads your Service URL and Subscription Key from the NLPGeneralParameters table and makes sure they are present. You save both of these required parameters in the Integration Setup > General tab. The check validates your instance of cloud integrator class based on the useCloudPrinting parameter. Your class instance is responsible for all REST API calls.
class NLPrinting { ... void new() { this.NLPrintGetURLAndKey(); if(configValid) { if (useCloudPrinting) { obj = new NLApiClient.CloudPrintIntegrator(NLPrintServiceURL); } else { obj = new NLApiClient.CloudTriggerIntegrator(NLPrintServiceURL); } } else { obj = null; } } ... }
You call the REST API based on your UseCloudPrinting configuration:
-
For Cloud Printers, use GET Printers REST API. You can test this call on the developer portal: https://developerportal.onnicelabel.com/docs/services/cloud-print/operations/get-printersfunction
-
For Classic printers, use PUT Cloud Trigger REST API with the trigger name Api-CloudIntegrationDemo-Printers. You can test this call on the developer portal: https://developerportal.onnicelabel.com/docs/services/cloud-trigger/operations/put-cloudtriggerfunction
public System.String[] NLGetPrinters() { if (configValid) { if (useCloudPrinting) { return (obj as NLApiClient.CloudPrintIntegrator).GetPrintersArray(NLPrintSubscriptionKey); } else { return (obj as NLApiClient.CloudTriggerIntegrator).GetPrintersArray(NLPrintSubscriptionKey); } } else { return null; } }
Printing from D365SCM with REST APIs uses label templates stored in NiceLabel Cloud > Documents. To make selecting templates easier for your users, you create a list of label templates and assign each template a user-friendly name in the Templates setup tab.
![]() |
Adding and naming label templates from Control Center to use in D365SCM.
Add label template paths from your files stored in Control Center > Documents.
-
Right-click a label template file you want to include and choose Get info. The File info window opens:
-
Copy the file path after your NiceLabel Cloud URL:
-
Paste the path in the Template Path field for a new template in the D365SCM > NiceLabel Printing Integration Setup > Templates tab.
-
Type a unique user-friendly Template Name for each template you add so your users know which labels to select and print from D365SCM.