Toggle a product's endpoints
A given product can exist at the same time as a visualized version and an installed version. Each version can have its own LOB-specific endpoints. However, only one version of the product can be active at a given time.
You can toggle the active set of endpoints through the user interface. For more information, see Toggle a product's active endpoints through the user interface.
You can also use the following endpoints to toggle the active set of endpoints:
- POST
/productdefinition/v1/product-templates/{productId}/enable
- Makes the visualized product's endpoints active
- POST
/productdefinition/v1/product-templates/{productId}/disable
- Makes the installed product's endpoints active
The request does not require a body. The response contains information about the product
template, including an enabled
field, which is set to either
true
(the visualized product's endpoints are active) or
false
(the installed product's endpoints are active).
For example, for the Workers' Compensation product (WorkersComp
), the
following request makes the installed version's endpoints active.
Command
/productdefinition/v1/product-templates/WorkersComp/disable
Request body
<none>
Response body
{
"data": {
"attributes": {
"abbreviation": "WC",
"codeIdentifier": "WorkersComp",
"description": "Workers' Compensation",
"enabled": false,
...
},
Determining which endpoints are active
You can use the following endpoints to determine whether REST API endpoints are active for a particular product or product version:
- GET
/productdefinition/v1/products
- GET
/productdefinition/v1/products/{productId}
Included in the response for these endpoints are two properties that specify which product endpoints are active:
visualized
: Boolean value specifying whether the product is visualized (true) or installed (false).restAPIsEnabledAndActive
: Boolean value specifying whether the product endpoints are enabled for that version of the product.
The following table describes the various states a product can be in and the flag settings used to determine each state.
visualized |
restAPIsEnabledAndActive |
Product state |
---|---|---|
true |
false |
|
true |
true |
|
false |
false |
|
false |
true |
|
For each product, it's possible to have both a visualized and an installed version of the product. However, the REST APIs can be enabled for only one of those versions.
In this example, there are two products listed. One is the visualized version of product TST Product, the other is the installed version of the same product. In this example, the REST APIs for the installed version of the product are enabled.
Command
GET /productdefinition/v1/products
Response
{
"count": 2,
"data": [
{
"attributes": {
…
"description": "TST Product",
"descriptionKey": "Product_TST.Description",
"id": "TST",
"name": "TST Product",
"nameKey": "Product_TST.Name",
…
"restAPIsEnabledAndActive": false,
"visualized": true
},
…
},
{
"attributes": {
…
"description": "TST Product",
"descriptionKey": "Product_TST.Description",
"id": "TST",
"name": "TST Product",
"nameKey": "Product_TST.Name",
…
"restAPIsEnabledAndActive": true,
"visualized": false
},
…
]