TIBCO Spotfire Statistics Services URL API
Users can send R expressions or functions (from TIBCO® Enterprise Runtime for R (TERR™) or open-source R) and manage jobs stored in TIBCO Spotfire® Statistics Services by way of HTTP URL requests.
- Sending TERR expressions that perform I/O to the file system or the internet.
- Spawning new OS processes by calling the
systemfunction. - Calling into Java using the terrJava package, or using functions in the parallel package.
- Loading new packages, except for those included with TERR.
- Calling
.Cor.Fortran. - Send expressions to the server using the Expression Service.
- Calling
ExtendedServerInfoor sending other expressions that read from, or write to, your server. - Sending potentially malicious expressions to the server using the URL API.
An HTTP URL request returns an SPXML string containing the results of the expression or function (or, in the case of an asynchronous request, it contains the job Id and job status). See SPXML output string for a description of the results.
The server receives and returns strings encoded in the format that the SPXML library can handle. They can be either simple SPXML strings or SPXML-encoded objects, which can be long and complex. For more information about SPXML, see the section "Interpret and use returned objects" in the TIBCO Spotfire® Statistics Services User's Guide (located at http://docs.tibco.com).
You can use the URL API to verify that the server is healthy by executing simple expressions using either function or expression services, and then verifying that the server has processed the expressions using the administration service.
By default, the server port is set to 8080, and the server WebApp name is set to SplusServer. Where appropriate, examples in this documentation show those default settings, or refer to the server name as the placeholder server_name. The server administrator can set both the port number and the WebApp name to different values. See your serve administrator if you have questions about these values.
The following table lists the service URL APIs. Click an API name to display more information and a list of functions for that API.
| Service API | Description |
|---|---|
| Administration Service API | Defines the URL Application Program Interface (API) for Spotfire Statistics Services administration tasks. These tasks might be restricted to login credentials; however, this API contains useful functions that you can apply to results obtained by calls using the Expression Service API or the Function service API. |
| Expression Service API | Defines the URL Expression Service Application Program Interface (API) forSpotfire Statistics Services. The Expression Service provides functions to send expressions directly to the R engine and retrieve the resulting SPXML string. |
| Function Service API | Defines the URL Function Service Application Program Interface (API) for Spotfire Statistics Services. The Function Service provides the functions to send TERR or open-source R functions (which are in packages or libraries on the server) to the engine and retrieve the resulting SPXML string. |
| Public Service API | Provides functions for discovering information about the server. |
Service versioning
As of Spotfire Statistics Services version 3.1, all services exposed by Spotfire Statistics Services include the actual version as part of the URL used to access them. To get the current server version, call the public ServerVersion service. The current version of the API is v8. You must include this value in any URL referring to non-public services (expression, function, and administration).
- Server access error code
If you try to use the URL APIs on a system with authentication enabled, but you do not provide credentials, or if the session has timed out, then the service returns a server access error (403). - Administration Service API
Use the Administration Service API for job management tasks, such as locating jobs on the server, retrieving a job, interrupting a running job, removing a job, or retrieving information about the server. - 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. - Function Service API
You can use the Function Service API to send a function and its arguments to the engine on the server. - Public Service API
The Public Service API defines simple functions for discovering information about the server. - jobs
jobsreplaces the deprecated non-RESTful functionsgetJobDetailsandgetJobs. - Special characters
Certain reserved and special characters can cause problems when they appear in a URL. - Output SPXML string
The server receives and returns strings encoded in the format that the SPXML library can handle. - Exceptions and errors
The server can either throw an exception or return an error. When you use the URL API, and you encounter a problem, you see an error code. - Response codes
Certain APIs can return response codes.