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.
- 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.
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- eval
The API eval sends an expression to the server to be evaluated either synchronously, asynchronously, or at a scheduled time. - getJobDetails
Deprecated. see jobs. Returns the results of the specified job.