Call API

Call API

Overview

The Call API contains the Profound.js APIs used to run code that lives outside the current module – IBM i programs and ILE service program procedures, other Profound.js modules, IBM i CL commands, operating system processes, and external web services.

The APIs in this section fall into the following groups:

  • Calling programs and procedures - Call an IBM i program, an ILE service program procedure, or another Profound.js module; for example pjs.call(), pjs.callProc(), and pjs.transferControl().

  • Passing parameters - Wrap a value so that it is passed by reference, by read-only reference, or by value; for example pjs.refParm().

  • Loading Profound.js code - Load modules, service programs, and shared definitions into the current scope; for example pjs.require() and pjs.import().

  • Running commands and processes - Run an IBM i CL command, or spawn an operating system process and capture its output; for example pjs.runCommand() and pjs.spawn().

  • Calling web services - Send HTTP requests to REST and other web services; for example pjs.httpRequest().

  • Calling asynchronous code - Call asynchronous JavaScript in a top-down manner; for example pjs.registerAsyncName() and the deprecated Fiber Call/Wrap API pages.

  • Entry points and extensions - Start a module from a command line, register a custom API, or read a parameter from the request that started the module; for example profoundjs.commandLineCall(), profoundjs.registerAPI(), and pjs.getRequestParm().

Where an API has a direct RPG counterpart, the operation code is listed in the RPG Equivalent section of that API’s page.

The APIs that reach IBM i – calling programs, calling procedures, and running CL commands – require the Profound.js Connector module. Each API page lists its own requirements.


Related Pages