All URIs are relative to https://api.factset.com
| Method | HTTP request | Description |
|---|---|---|
| CancelSPARCalculationById | DELETE /analytics/engines/spar/v2/calculations/{id} | Cancel SPAR calculation |
| GetSPARCalculationById | GET /analytics/engines/spar/v2/calculations/{id} | Get SPAR calculation by id |
| RunSPARCalculation | POST /analytics/engines/spar/v2/calculations | Run SPAR Calculation |
void CancelSPARCalculationById (string id)
Cancel SPAR calculation
This is the endpoint to cancel a previously submitted calculation. Instead of doing a GET on the polling URL, cancel the request by doing a DELETE
using System.Collections.Generic;
using System.Diagnostics;
using FactSet.AnalyticsAPI.Engines.Api;
using FactSet.AnalyticsAPI.Engines.Client;
using FactSet.AnalyticsAPI.Engines.Model;
namespace Example
{
public class CancelSPARCalculationByIdExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.factset.com";
// Configure HTTP basic authorization: Basic
config.Username = "YOUR_USERNAME";
config.Password = "YOUR_PASSWORD";
var apiInstance = new SPARCalculationsApi(config);
var id = id_example; // string | from url, provided from the location header in the Run Calculation endpoint
try
{
// Cancel SPAR calculation
apiInstance.CancelSPARCalculationById(id);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SPARCalculationsApi.CancelSPARCalculationById: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| id | string | from url, provided from the location header in the Run Calculation endpoint |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | Expected response, calculation was canceled successfully. | * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 400 | Invalid identifier provided. | * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 401 | Missing or invalid authentication. | * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. |
| 403 | User is forbidden with current credentials | * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 404 | There was no request for the calculation identifier provided, or the request was already canceled for the provided identifier. | * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 500 | Server error. Log the X-DataDirect-Request-Key header to assist in troubleshooting. | * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. |
| 503 | Request timed out. Retry the request in sometime. | * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Object GetSPARCalculationById (string id)
Get SPAR calculation by id
This is the endpoint to check on the progress of a previously requested calculation. If the calculation has finished computing, the body of the response will contain the requested document in JSON.
using System.Collections.Generic;
using System.Diagnostics;
using FactSet.AnalyticsAPI.Engines.Api;
using FactSet.AnalyticsAPI.Engines.Client;
using FactSet.AnalyticsAPI.Engines.Model;
namespace Example
{
public class GetSPARCalculationByIdExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.factset.com";
// Configure HTTP basic authorization: Basic
config.Username = "YOUR_USERNAME";
config.Password = "YOUR_PASSWORD";
var apiInstance = new SPARCalculationsApi(config);
var id = id_example; // string | from url, provided from the location header in the Run Calculation endpoint
try
{
// Get SPAR calculation by id
Object result = apiInstance.GetSPARCalculationById(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SPARCalculationsApi.GetSPARCalculationById: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| id | string | from url, provided from the location header in the Run Calculation endpoint |
Object
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Expected response once calculation is completed, returns JSON in the format specified in the Run Calculations endpoint. | * Cache-Control - Standard HTTP header. Header will specify max-age in seconds. Polling can be adjusted based on the max-age value. * Content-Encoding - Standard HTTP header. Header value based on Accept-Encoding Request header. * Content-Type - Standard HTTP header. * Transfer-Encoding - Standard HTTP header. Header value will be set to Chunked if Accept-Encoding header is specified. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 202 | Expected response returned if the calculation is not yet completed. | * Cache-Control - Standard HTTP header. Header will specify max-age in seconds. Polling can be adjusted based on the max-age value. * Content-Encoding - Standard HTTP header. Header value based on Accept-Encoding Request header. * Content-Type - Standard HTTP header. * Transfer-Encoding - Standard HTTP header. Header value will be set to Chunked if Accept-Encoding header is specified. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 400 | Invalid identifier provided. | * Cache-Control - Standard HTTP header. Header will specify max-age in seconds. Polling can be adjusted based on the max-age value. * Content-Encoding - Standard HTTP header. Header value based on Accept-Encoding Request header. * Content-Type - Standard HTTP header. * Transfer-Encoding - Standard HTTP header. Header value will be set to Chunked if Accept-Encoding header is specified. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 401 | Missing or invalid authentication. | * Cache-Control - Standard HTTP header. Header will specify max-age in seconds. Polling can be adjusted based on the max-age value. * Content-Encoding - Standard HTTP header. Header value based on Accept-Encoding Request header. * Content-Type - Standard HTTP header. * Transfer-Encoding - Standard HTTP header. Header value will be set to Chunked if Accept-Encoding header is specified. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. |
| 403 | User is forbidden with current credentials | * Cache-Control - Standard HTTP header. Header will specify max-age in seconds. Polling can be adjusted based on the max-age value. * Content-Encoding - Standard HTTP header. Header value based on Accept-Encoding Request header. * Content-Type - Standard HTTP header. * Transfer-Encoding - Standard HTTP header. Header value will be set to Chunked if Accept-Encoding header is specified. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 404 | Calculation was already returned, provided id was not a requested calculation, or the calculation was cancelled | * Cache-Control - Standard HTTP header. Header will specify max-age in seconds. Polling can be adjusted based on the max-age value. * Content-Encoding - Standard HTTP header. Header value based on Accept-Encoding Request header. * Content-Type - Standard HTTP header. * Transfer-Encoding - Standard HTTP header. Header value will be set to Chunked if Accept-Encoding header is specified. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 500 | Server error. Log the X-DataDirect-Request-Key header to assist in troubleshooting | * Cache-Control - Standard HTTP header. Header will specify max-age in seconds. Polling can be adjusted based on the max-age value. * Content-Encoding - Standard HTTP header. Header value based on Accept-Encoding Request header. * Content-Type - Standard HTTP header. * Transfer-Encoding - Standard HTTP header. Header value will be set to Chunked if Accept-Encoding header is specified. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. |
| 503 | Request timed out. Retry the request in sometime. | * Cache-Control - Standard HTTP header. Header will specify max-age in seconds. Polling can be adjusted based on the max-age value. * Content-Encoding - Standard HTTP header. Header value based on Accept-Encoding Request header. * Content-Type - Standard HTTP header. * Transfer-Encoding - Standard HTTP header. Header value will be set to Chunked if Accept-Encoding header is specified. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Object RunSPARCalculation (SPARCalculationParameters sPARCalculationParameters = null)
Run SPAR Calculation
This endpoint runs the SPAR calculation specified in the POST body parameters. It must be used first before polling or cancelling endpoints. A successful response will contain the URL to poll for the result of the calculation. Remarks: * Any settings in POST body will act as a one-time override over the settings saved in the SPAR template.
using System.Collections.Generic;
using System.Diagnostics;
using FactSet.AnalyticsAPI.Engines.Api;
using FactSet.AnalyticsAPI.Engines.Client;
using FactSet.AnalyticsAPI.Engines.Model;
namespace Example
{
public class RunSPARCalculationExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.factset.com";
// Configure HTTP basic authorization: Basic
config.Username = "YOUR_USERNAME";
config.Password = "YOUR_PASSWORD";
var apiInstance = new SPARCalculationsApi(config);
var sPARCalculationParameters = new SPARCalculationParameters(); // SPARCalculationParameters | (optional)
try
{
// Run SPAR Calculation
Object result = apiInstance.RunSPARCalculation(sPARCalculationParameters);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SPARCalculationsApi.RunSPARCalculation: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| sPARCalculationParameters | SPARCalculationParameters | [optional] |
Object
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 202 | Expected response, contains the poll URL in the Location header. | * Location - URL to poll for the resulting calculation * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 201 | Expected response if calculation is completed within 30 seconds, returns JSON in the format specified in the Run Calculations endpoint. | * Location - URL to poll for the resulting calculation * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 400 | Invalid POST body. | * Location - URL to poll for the resulting calculation * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 401 | Missing or invalid authentication. | * Location - URL to poll for the resulting calculation * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. |
| 403 | User is forbidden with current credentials | * Location - URL to poll for the resulting calculation * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 404 | One or more calculation settings were unavailable. | * Location - URL to poll for the resulting calculation * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 415 | Missing/Invalid Content-Type header. Header needs to be set to application/json. | * Location - URL to poll for the resulting calculation * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 429 | Rate limit reached. Cancel older requests using Cancel Calculation endpoint or wait for older requests to finish/expire. | * Location - URL to poll for the resulting calculation * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. * Retry-After - Time to wait in seconds before making a new request as the rate limit has reached. |
| 500 | Server error. Log the X-DataDirect-Request-Key header to assist in troubleshooting. | * Location - URL to poll for the resulting calculation * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. |
| 503 | Request timed out. Retry the request in sometime. | * Location - URL to poll for the resulting calculation * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]