To work with the tutorial, we supply two files: one containing the environment variables you require, whose values you will need to set according to your Smart API Server, Smart API Manager, Site and PlantGroup; and the other containing the request collection. The first step to working with the tutorial is to import these files into Postman.
-
Click the gear icon in the top-right corner of Postman and select Manage Environments.
-
In the Manage Environments window, click the Import button.
-
Click the button.
-
Navigate to the supplied JSON file: TrainingEnv.postman_environment.json and click Open.
The file is located in the API server machine where Smart Instrumentation Smart API is installed, under the following folder: <Smart Instrumentation installation folder>\WEB Services\Help
-
Click the TrainingEnv, to see the list of keys and values.
-
Select and fill in the relevant values in the CURRENT VALUE column, as appropriate for your environment. The values displayed are only an example.
-
baseUri — the base address to the hostname/domain. (Must include forward slash (/) after the name.)
-
resourceID — the API resource identifier from SAM (Smart API Manager).
-
samServerUri — the address of the SAM server.
A forward slash (/) must be included after the name.
-
samUserName — the user name of a group allowed to access the API.
-
samPassword — the SAM user password.
-
samClientId — a unique identifier of the Smart Client. Smart Clients are software applications that consume one or more Smart APIs.
-
samClientSecret — used to authenticate the Smart Client (in this case Postman) and authorize it to access a Smart API. The client secret can be generated automatically or set by an Administrator. It must not be shared like a user password.
-
SiteId — the Smart Instrumentation database you connect to. You can supply the SiteId at a later time, based on the Get Sites request.
-
PlantGroupId — the Smart Instrumentation domain name within the selected site. You can supply the PlantGroupId at a later time, based on the Get PlantGroup request.
-
versionNumber — the API’s version number.
-
token — a string supplied by SAM to access the API. The value is generated by a Post request and populated automatically.
-
-
Click the button, and then close the Manage Environments window.
-
Click the drop-down menu in the upper right corner of Postman and select TrainingEnv.
Import a Collection
The sample requests are grouped to create a Collection, which you need to import into Postman.
-
On the Postman tool bar, click the Import button.
-
From the IMPORT window, click , and navigate to the SI_WS_Tutorial.postman_collection.json.
-
Click Open.
A new folder named SI_WS_Tutorial is added to the Collections tab, containing the sample requests.