CallAPI

CallAPIs are used to trigger processes in an AE system from external systems by using the Automation Engine scripting language. Use CallAPIs to start executable objects, set or read the contents of Variable objects, or get status details about tasks. As an administrator, you set up the CallAPI and you define the login credentials, the connection data to the AE, and your platform-specific parameters. You can use the CallAPI either with your own program, or with a utility. A CallAPI is limited to 32000 characters, as are all scripts in the Automation Engine scripting language.

Tip: Consider using the REST API instead of the CallAPI in some cases. The REST API has a /scripts endpoint that covers Call API functions. The advantages are that you do not need to use several Service Manager services if you are connecting your own system(s) to several AE systems and/or clients. Also, the REST API does not require a user login whenever it is called. This is very helpful in situations where the workload is high. For more information, see REST API

This page includes the following:

General Information

Log in to the AE system

To log in to the AE system, the CallAPI requires valid user credentials. A user must have the privilege Logon via CallAPI and must have Execute rights.

You can specify your login data (client, user, department, and password) in the INI file of the CallAPI. Alternatively, you specify it when you call the CallAPI.

You can encrypt your password by using the program UCYBCRYP.EXE. The encrypted string must not exceed 64 characters. For details, see Encoding Passwords.

No password verification takes place when you use single logon for your CallAPI. To do so, store the relevant data in the system variable UC_USER_LOGON. For details, see UC_USER_LOGON - Single Logon.

Connect to the Automation Engine

To activate your script in the required AE system, the CallAPI requires connection information for relevant communication processes. Enter this connection information in the INI file (such as 2217=localhost). In CallAPI calls from your own programs, you can directly assign this information.

Messages

If you use a Job object that calls the CallAPI utility, you can see the related messages in the job report.

You can use the script statement :STOP to assign message numbers and texts to the CallAPI. They are stored in script variables and can be read with your own programs. The names of these variables depend on the programming language you are using. Depending on the stop mode that you define in the script statement :STOP, the script either aborts or continues to run.

Use the CallAPI with your Own Program

You can use the CallAPI to process scripts in the AE system from your own programs that are written in C, C++, Cobol, Java, or Visual Basic. Sound knowledge of the programming language in which the program is written is required for this purpose.

Scripts are always activated with the following three steps:

  1. Log in to the AE system.
  2. Transfer the script to the AE system.
  3. Log off from the AE system.

You can log in to several AE systems at the same time and process various scripts.

CallAPI with C, C++

The delivery directory contains sample programs that provide a detailed description of how you call the CallAPI with C or C++. The file uccall3.h provides information about structure and functions.

You need to integrate the files uccall3.h and the respective library for your platform. Note that your program requires access to the required libraries such as ucxbwi3c.dll (Windows), or libucxblx6c.so (Linux) etc.

Functions

You can use the several functions in your programs. They supply return code 0 if the action was successful, or a message number if an error occurred. The data type of all return codes is long.

Variables

Information such as the system name or the RunID of the script is stored in the structure UCCALL_PARAMS. It contains the following variables:

CallAPI with Cobol

You can call the CallAPI by using the command CALL UCCALL3. Return code 0 is supplied if the action was successful or a message number if an error occurred.

Variables

The supplied sample program explains the structure AE-RECORD. It contains the following variables:

CallAPI with Java

To use the CallAPI with Java, you must import the UCCALL3 class to be imported from the com.uc4.uccall3 package.

The delivery directory contains sample programs that show you how to log on, activate scripts, connect to different systems, find connections error, and so on. The supplied CallAPI documentation provides up-to-date information about the Java class, methods and available functions.

CallAPI with Visual Basic

To use the CallAPI with your own Visual Basic programs, you must register the COM object AE.Call3.

Example

regsvr32 c:\AUTOMIC\callapi\windows\bin\ucxbwi3c.dll

Use the sample program that is included in our delivery directory. It provides a detailed description of how you can activate a script.

Methods

In your program, you can use the following functions. These functions supply return code 0 if the action was successful, or a message number if an error has occurred.

Attributes

Information about script execution is automatically stored in the following script variables:

Use the CallAPI Utility (ucxbxxxc)

You can use a CallAPI utility which is provided for each supported platform. No programming knowledge is required for this purpose. Depending on your operating system, you can call this utility from jobs, procedures, executable files or directly from the command line.

Write the script that you want to use in a text file and assign this file when you call the utility. The following syntax applies to all platforms:

CallAPI file SCRIPT=script file [LOGON=client,user,[department[,password]]] [INI=INI file] [QUEUE=Name of Queue object]

Parameters:

(Windows) Example

UCXBXXXC SCRIPT=C:\AUTOMIC\CallAPI\script.txt LOGON=98,SMITH,PASSWORD INI=C:\AUTOMIC\CallAPI\WINDOWS\ucxbxxxc.ini

Notes:

The CallAPI utility supplies several return codes that can be used to monitor the script activation process:

(SAP) The start parameter for the RFC Server is different. -I is the only parameter and it specifies the path to the INI file:

Scripts that are started through a CallAPI are displayed in the Process Monitoring perspective. A statistical record and a report are created.

Tip: Use the Including or Excluding Deactivated Tasks checkbox to search for your script and specify the task type CallAPI, or enter the Task RunID of the CallAPI script.

Platforms for CallAPIs

See also: