Installing and Configuring SAPI

The SAPI component provides REST API access to CA Automic Automation Engine workflows published as services. This topics covers the installation and configuration of SAPI for SNSC.

Prerequisites:

You have completed all the installation steps through Adding the OAuth Configuration to AE Clients

To Install the Service API (SAPI)

  1. Go to wherever you have your downloaded Automic Automation installation package .
  2. Open the folder <Automic Automation Installation>\Tools\Sapi.
  3. Copy sapi.war and paste it in the webapps folder in your Tomcat installation (for example, <Tomcat installation path>\webapps).
  4. Configure the connection between the Automation Engine (AE) and SAPI. You do this in the uc4config.xml file.

    In installations with Tomcat, you find uc4config.xml in the <Tomcat installation path>\webapps\sapi\WEB-INF\classes\config\ folder.

    The parameters for configuring the connection between the AE and SAPI are the same that you use to define the connection between the AE and AWI. For SAPI, adapt the uc4config.xml as per your environment as follows:

    Sample configuration

    <configuration>
      <connections >
        <connection name="UC4" system="UC4">
           <cp ip="vviecapam01" port="8443"/>
        </connection>
        <trustedCertFolder>C:\AWA\truststore</trustedCertFolder>
      </connections>
    </configuration>
    

    For more information, see uc4config.xml - Configuring the Connection Between AWI and AE.

    Note: You can also find the Automic Automation product documentation on docs.automic.com.

  5. To configure the SAPI, modify the values in the sapiConfig.xml file to describe the various components that SAPIcommunicates with. See the table that follows for a description of the parameters in this file.
  6. Optionally, you can check your Tomcat manager to confirm whether both OAuth and SAPI are indeed running now after you installed them both.
    1. Login to the Tomcat Application Manager.
    2. Check the table of applications, to see that OAuth and SAPI are listed and running.

sapiConfig.xml file

Configuration of Service API (SAPI) is done in the sapiConfig.xml file.

Section

Parameter

Type

Description

Environment

absoluteUrl

Boolean

Flags whether links are returned as relative or as absolute links:

  • True: absolute links
  • False: relative links

baseUrl

String

REST API root URL

Note: Only used if parameter absoluteUrl is set to true.

AutomationEngine

saraFolderPath

String

Name of REST API root folder

Default value: /SERVICES

OauthServer

validationUrl

String

OAuth validation endpoint URL

Format: <protocol>://<OAuth_serverHost>:<Port>/<Name_of_deployed_OAuth_WAR_file>/internal/oauth2/validate

Example:https://oauthsrv:8080/oauth-server/internal/oauth2/validate

Important! A protocol indication (http/https) is required.

username

String

User name for the basic authentication of the OAuth validation endpoint

Note: This must be the same user name as specified in OAuth configuration file configuration.properties for OAuth for parameter ValdidationEndpoint.Username.

password

String

Password for the basic authentication of the OAuth validation endpoint

Note: This must be the same password as specified in OAuth configuration file configuration.properties for OAuth for parameter ValdidationEndpoint.Password.

Example

<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
 
    <AutomationEngine saraFolderPath="/SERVICES" />
 
    <OAuthServer
        validationUrl="http://oauthsrv/oauth2/validate"
        username="User1"
        password="PWord" />
 
    <Environment
        mode="development"
        absoluteUrl="false"
        baseUrl="http://url_to_sapi_root" />
 
</Configuration>