Common Scenarios
...
Postman Collections
Management API Collection
10 min
management api base url all management api requests use the domain https //saas licensespring com https //saas licensespring com do not use https //api licensespring com for management api requests that domain is reserved for the license api required authentication key the management api requires the following key managementapikey the keys below are not valid for the management api apikey sharedkey these keys apply exclusively to the license api and cannot be used for management api authentication these settings are accessible in the licensespring development environment, which must be selected in postman select environment management api variables the management api collection uses several environment variables that are automatically populated by running the corresponding list requests inside each folder these variables allow patch, delete, and get by id operations to work without manual input automatically populated variables when you run the first request in a folder (e g , list customers , list products , list licenses ), the script extracts the id of the first returned item and stores it in the environment variable description customer id set by running get customers product id set by running get products license id set by running get licenses labels id set by running get labels features id set by running the corresponding list features request user id set by running list users order id set by running list orders accounts id set by running list accounts activation id set by running list activations installation id set by running list installations … all other variables are set by their respective list requests if a list request returns an empty array, it means no resources exist yet you can either create the resource in the licensespring ui, or use the post request provided in the same folder how the management api collection works each folder in the management api collection follows a consistent workflow run the list request retrieves all resources of that type automatically stores the id of the first item in the environment variable example get products → sets {{product id}} run other requests (show, patch, delete, etc ) these requests automatically read the id from the environment variable no need to manually replace values simplifies testing and minimizes errors why the first resource in the list? for convenience and automation if you want to target a different resource, you can simply change the environment variable manually (see below) manual variable adjustment (optional) if you prefer to use an id other than the automatically selected one, you can manually set a value in the environment copy the id from the ui (e g , from https //saas licensespring com/orders/order id/license \<id>) paste it into the matching environment variable (e g , license id) run any request in the folder — it will now use your manually selected id add your license id or set it up from using post/create request inside request body add value to existing variable important script will override your product id if you run again list request in that folder, please delete/remove the post response script as shown on picture oauth folders inside the management api collection some folders include oauth based management api endpoints these require license id, or customer id, or customer account code these variables are populated automatically by running the corresponding list requests if you want oauth requests to target different resources, update these variables manually if your organization has enabled oauth scoping (customer level, license level, or account level), the ids must match the scope assigned on your licensespring platform example workflow products folder example run get products → sets {{product id}} run get product (show) → uses {{product id}} run patch product → updates the same product run delete product → deletes the same resource every folder works the same way common issues 1\ 404 not found you ran patch/delete but no id was set run the folder’s list request first 2\ 401 unauthorized your managementapikey is missing or has a trailing space 3\ invalid url your management api url has a trailing slash or extra space note always ensure there are no extra spaces in any environment variable
