Publishing Product Catalogs, Product Offerings, Product Specifications, and Categories,

anthonyvlas
Tera Contributor

Our team has been working to create Product Catalogs, Product Offerings, and Product Specifications using the API - and everything is working.

POST /sn_tmf_api/catalogmanagement/productOffering

POST /sn_tmf_api/catalogmanagement/productSpecification

POST /sn_tmf_api/catalogmanagement/catalog


The problem is - we cannot seem to find a way to publish using the Api.  When we create a Product Specifications - we then need to go in to the UI to publish it.  Then we can create a Product Offering that references the Product Specification.  It seems like there is probably an easier way - but I haven't been able to find it.

Is there a way we can auto-publish or publish using an API call ?  We tried updating the status using a Table Api call - but couldn't seem to get it working.

1 REPLY 1

anthonyvlas
Tera Contributor

I was able to create a background script that updates the status and specification_category of the product specification and it seems to work.  However, I don't seem to be able to do this using the existing API - so I am trying to create a scripted API to do the work.

gs.log("Starting bulk publish for product specifications", "BULK-PUBLISH");
var specs = new GlideRecord('sn_prd_pm_product_specification'); // Replace with the actual table name for product specifications
specs.addQuery('status', 'draft'); // Filter for records in 'Draft' state
specs.query();
gs.log("Found " + specs.getRowCount() + " product specifications to publish.", "BULK-PUBLISH");
while (specs.next()) {
    gs.log("Publishing product specification: " + specs.name, "BULK-PUBLISH");
    specs.status = 'published'; // Update the workflow state to 'Published'
    specs.setValue('specification_category', 'aad57c14c3031000b959fd251eba8fc0');
    specs.update();
}
gs.log("Bulk publishing completed.", "BULK-PUBLISH");