Skip to main content

Introduction to the Template Management API

This page introduces the API for template managementOpens in a new tab in InterSystems Supply Chain Orchestrator™.

Posting a Template

After defining a template, the first step is generally to post the template definition, thus making the template available for use. To do so, call the following endpoint, using the template JSON as the request body:

POST {{IRIS-SERVER-URL}}/api/{NAMESPACE}/scsam/v1/templates

Other Template Basics

Similar endpoints let you retrieve information about, update, or delete templates.

  • Get information about all templates in a namespace:

    GET {{IRIS-SERVER-URL}}/api/{NAMESPACE}/scsam/v1/templates
    
  • Get information about a template:

    GET {{IRIS-SERVER-URL}}/api/{NAMESPACE}/scsam/v1/templates/{templateName}
    
  • Synchronize a template:

    PUT {{IRIS-SERVER-URL}}/api/{NAMESPACE}/scsam/v1/templates/{templateName}
    
  • Update a template:

    PATCH {{IRIS-SERVER-URL}}/api/{NAMESPACE}/scsam/v1/templates/{templateName}
    
  • Delete a template:

    DELETE {{IRIS-SERVER-URL}}/api/{NAMESPACE}/scsam/v1/templates/{templateName}
    

Exporting and Importing Templates

To export a template and all associated code, use the following API call:

GET {{IRIS-SERVER-URL}}/api/{NAMESPACE}/scsam/v1/export/{templateName}

When successful, this call generates a .ZIP file that contains all the following elements:

  • A JSON file containing the template definition

  • For transformation rules: All expressions and preprocessors referenced by the template

  • For validation rules: All validation code referenced by the template

  • For impact rules: All impact calculation code referenced by the template

  • For call actions: All business processes referenced by transformations used in the template

  • For recommendation rules: All business rule classes referenced by the template

This file is written to TempDirectory/namespace>/TemplateExport.zip

Similarly, to export all templates in a namespace, use the following API call:

GET {{IRIS-SERVER-URL}}/api/{NAMESPACE}/scsam/v1/export

To import a template (and all associated code elements), obtain a ZIP file created by template export and use the following API call:

POST {{IRIS-SERVER-URL}}/api/{NAMESPACE}/scsam/v1/import

Use the ZIP file as the request body.

Other Options

The Scenario Analysis API has additional endpoints for posting, updating, or deleting parts of templates. See the API reference for details.

See Also

FeedbackOpens in a new tab