Expression Service API

The Spotfire Statistics Services Expression service API defines the URL Expression Service Application Program Interface (API) for Spotfire Statistics Services. You can use the Expression Service API to send TERR or open-source R expressions directly to the engine on the server.

Important: By default, certain Spotfire Statistics Services capabilities are disabled. If you have functions that you created or used in a previous release, you might find that they no longer work as expected. Additionally, any expression that TERR determines to be potentially malicious is disabled. Below is a non-exhaustive example of some of the capabilities disabled by default in Spotfire Statistics Services.
  • Sending TERR expressions that perform I/O to the file system or the internet.
  • Spawning new OS processes by calling the system function.
  • Calling into Java using the terrJava package, or using functions in the parallel package.
  • Loading new packages, except for those included with TERR.
  • Calling .C or .Fortran.
  • Send expressions to the server using the Expression Service.
  • Calling ExtendedServerInfo or sending other expressions that read from, or write to, your server.
  • Sending potentially malicious expressions to the server using the URL API.
Additionally, the Function Service can execute only one function, which allows a connection from Spotfire. If you have functions that you want to have enabled on Spotfire Statistics Services, or if you have additional questions about the configuration settings that control these capabilities, see your server administrator.
Note: Open-source R is available under separate open source software license terms and is not part of TIBCO Spotfire Statistics Services. As such, open-source R is not within the scope of your license for TIBCO Spotfire Statistics Services. Open-source R is not supported, maintained, or warranted in any way by TIBCO Software Inc. Download and use of open-source R is solely at your own discretion and subject to the free open source license terms applicable to open-source R.

If you are working with a server on which authentication is implemented, then your calls to the server need to include the username and password parameters. The example below demonstrates how this parameter is passed in such a request.

Caution

The Expression Service API can be used for quick evaluations or large batch jobs. It is useful when security is not a concern. Because you can send any expression to the engine to be evaluated, you should consider using the Function Service API instead of the Expression Service API when security is a concern.

Example

The following link shows an expression that just calculates 6 * 7.

http://servername:8080/SplusServer/api/v8/expression/eval?cmd=6*7&username=rd&password=rd

The job runs synchronously by default and is returned in an SPXML string. You send the same job request, setting it to run asynchronously, in which case the SplusDataResult returned to you in the SPXML string contains details about the job, including the jobId. You can use this jobId to retrieve details about the job using getJobDetails.

http://servername:8080/SplusServer/api/v8/expression/eval?cmd=6*7&async=true&username=rd&password=rd

Expression Service API functions