View on GitHub

analyticsapi-engines-dotnet-sdk

FactSet.AnalyticsAPI.Engines.Api.PACalculationsApi

All URIs are relative to https://api.factset.com

Method HTTP request Description
CancelCalculationById DELETE /analytics/engines/pa/v3/calculations/{id} Cancel PA calculation by id
GetAllCalculations GET /analytics/engines/pa/v3/calculations Get all calculations
GetCalculationParameters GET /analytics/engines/pa/v3/calculations/{id} Get PA calculation parameters by id
GetCalculationStatusById GET /analytics/engines/pa/v3/calculations/{id}/status Get PA calculation status by id
GetCalculationUnitResultById GET /analytics/engines/pa/v3/calculations/{id}/units/{unitId}/result Get PA calculation result by id
PostAndCalculate POST /analytics/engines/pa/v3/calculations Create and Run PA calculation
PutAndCalculate PUT /analytics/engines/pa/v3/calculations/{id} Create or Update PA calculation and run it.

CancelCalculationById

void CancelCalculationById (string id)

Cancel PA calculation by id

This is the endpoint to cancel a previously submitted calculation.

Example

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 CancelCalculationByIdExample
    {
        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";
            // Configure Bearer token for authorization: Bearer
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new PACalculationsApi(config);
            var id = id_example;  // string | from url, provided from the location header in the Create and Run PA calculation endpoint

            try
            {
                // Cancel PA calculation by id
                apiInstance.CancelCalculationById(id);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PACalculationsApi.CancelCalculationById: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
id string from url, provided from the location header in the Create and Run PA calculation endpoint  

Return type

void (empty response body)

Authorization

Basic, Bearer

HTTP request headers

HTTP response details

| 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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]

GetAllCalculations

CalculationsSummaryRoot GetAllCalculations (int? pageNumber = null)

Get all calculations

This endpoints returns all calculation requests.

Example

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 GetAllCalculationsExample
    {
        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";
            // Configure Bearer token for authorization: Bearer
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new PACalculationsApi(config);
            var pageNumber = 56;  // int? |  (optional)  (default to 1)

            try
            {
                // Get all calculations
                CalculationsSummaryRoot result = apiInstance.GetAllCalculations(pageNumber);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PACalculationsApi.GetAllCalculations: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
pageNumber int?   [optional] [default to 1]

Return type

CalculationsSummaryRoot

Authorization

Basic, Bearer

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| | 200 | List of calculation requests. | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
| | 400 | Invalid page number. | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
| | 404 | No calculation found. | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
| | 406 | Unsupported Accept header. Header needs to be set to application/json. | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
| | 429 | Rate limit reached. Wait till the time specified in Retry-After header value to make further requests. | * 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.
* 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. | * 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]

GetCalculationParameters

PACalculationParametersRoot GetCalculationParameters (string id)

Get PA calculation parameters by id

This is the endpoint that returns the calculation parameters passed for a calculation.

Example

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 GetCalculationParametersExample
    {
        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";
            // Configure Bearer token for authorization: Bearer
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new PACalculationsApi(config);
            var id = id_example;  // string | from url, provided from the location header in the Create and Run PA calculation endpoint

            try
            {
                // Get PA calculation parameters by id
                PACalculationParametersRoot result = apiInstance.GetCalculationParameters(id);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PACalculationsApi.GetCalculationParameters: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
id string from url, provided from the location header in the Create and Run PA calculation endpoint  

Return type

PACalculationParametersRoot

Authorization

Basic, Bearer

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| | 200 | Expected response, returns the PA calculation parameters. | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
| | 404 | Calculation id not found | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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]

GetCalculationStatusById

CalculationStatusRoot GetCalculationStatusById (string id)

Get PA calculation status by id

This is the endpoint to check on the progress of a previously requested calculation. If the calculation has finished computing, the location header will point to the result url. Otherwise, the calculation is still running and the X-FactSet-Api-PickUp-Progress header will contain a progress percentage.

Example

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 GetCalculationStatusByIdExample
    {
        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";
            // Configure Bearer token for authorization: Bearer
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new PACalculationsApi(config);
            var id = id_example;  // string | from url, provided from the location header in the Create and Run PA calculation endpoint

            try
            {
                // Get PA calculation status by id
                CalculationStatusRoot result = apiInstance.GetCalculationStatusById(id);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PACalculationsApi.GetCalculationStatusById: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
id string from url, provided from the location header in the Create and Run PA calculation endpoint  

Return type

CalculationStatusRoot

Authorization

Basic, Bearer

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| | 200 | Expected response once calculation is completed. | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
| | 202 | Expected response returned if the calculation is not yet completed, should contain X-FactSet-Api-PickUp-Progress header. | * X-FactSet-Api-PickUp-Progress - FactSet's progress header.
* Cache-Control - Standard HTTP header. Header will specify max-age in seconds. Polling can be adjusted based on the max-age value.
* 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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 | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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]

GetCalculationUnitResultById

ObjectRoot GetCalculationUnitResultById (string id, string unitId)

Get PA calculation result by id

This is the endpoint to get the result of a previously requested calculation. If the calculation has finished computing, the body of the response will contain the requested document in JSON.

Example

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 GetCalculationUnitResultByIdExample
    {
        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";
            // Configure Bearer token for authorization: Bearer
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new PACalculationsApi(config);
            var id = id_example;  // string | from url, provided from the location header in the Get PA calculation status by id endpoint
            var unitId = unitId_example;  // string | from url, provided from the location header in the Get PA calculation status by id endpoint

            try
            {
                // Get PA calculation result by id
                ObjectRoot result = apiInstance.GetCalculationUnitResultById(id, unitId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PACalculationsApi.GetCalculationUnitResultById: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
id string from url, provided from the location header in the Get PA calculation status by id endpoint  
unitId string from url, provided from the location header in the Get PA calculation status by id endpoint  

Return type

ObjectRoot

Authorization

Basic, Bearer

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| | 200 | Expected response once calculation is completed, returns JSON in the format specified in the Calculation parameters. | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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 | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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]

PostAndCalculate

CalculationStatusRoot PostAndCalculate (int? xFactSetApiLongRunningDeadline = null, string cacheControl = null, PACalculationParametersRoot pACalculationParametersRoot = null)

Create and Run PA calculation

This endpoint runs the PA calculation specified in the POST body parameters. It can take one or more calculation units as input. Remarks: * Any settings in POST body will act as a one-time override over the settings saved in the PA template. * Account identifiers must have .ACCT or .ACTM extension or BENCH: prefix. Holdings mode can be optionally set for every account. Possible values for holdings mode are B&H (Buy and Hold), TBR (Transaction based returns), OMS (Order Management System), VLT (Vaulted returns) or EXT (External Returns Data). Default holdings mode value is B&H. * If we are overriding the grouping with a frequency, we will be overriding the grouping saved to the original component and also overriding the default frequency of the Beginning of Period to whatever we pass in the request body. * If we are overriding grouping frequency without overriding the group id it will not be applied to the default groupings saved to the original component. * Componentdetail supports securities, groups, groupsall, and totals levels of granularity. However, if no value is passed, the default value is ‘securities’. Additionally, while ‘groupsall’ returns all the group levels in the PA component, setting componentdetail to ‘groups’ only returns the expanded or collapsed group levels within the PA component.

Example

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 PostAndCalculateExample
    {
        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";
            // Configure Bearer token for authorization: Bearer
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new PACalculationsApi(config);
            var xFactSetApiLongRunningDeadline = 10;  // int? | Long running deadline in seconds when only one unit is passed in the POST body. Example value is set to 10s. Please update it as per requirement before triggering a calculation. (optional) 
            var cacheControl = cacheControl_example;  // string | Standard HTTP header.  Accepts max-stale. (optional) 
            var pACalculationParametersRoot = new PACalculationParametersRoot(); // PACalculationParametersRoot | Calculation Parameters (optional) 

            try
            {
                // Create and Run PA calculation
                CalculationStatusRoot result = apiInstance.PostAndCalculate(xFactSetApiLongRunningDeadline, cacheControl, pACalculationParametersRoot);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PACalculationsApi.PostAndCalculate: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
xFactSetApiLongRunningDeadline int? Long running deadline in seconds when only one unit is passed in the POST body. Example value is set to 10s. Please update it as per requirement before triggering a calculation. [optional]
cacheControl string Standard HTTP header. Accepts max-stale. [optional]
pACalculationParametersRoot PACalculationParametersRoot Calculation Parameters [optional]

Return type

CalculationStatusRoot

Authorization

Basic, Bearer

HTTP request headers

HTTP response details

| 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-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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
| | 201 | Expected response if the calculation has one unit and is completed in a short span, returns JSON in the format specified in the Calculation parameters. | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
| | 200 | Expected response, if the calculation has one unit and is completed with an error. | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
| | 400 | Invalid calculation parameters. | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
| | 404 | One or more calculation settings were unavailable. | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
| | 415 | Missing/Invalid Content-Type header. Header needs to be set to application/json. | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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. | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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. | * 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]

PutAndCalculate

CalculationStatusRoot PutAndCalculate (string id, int? xFactSetApiLongRunningDeadline = null, string cacheControl = null, PACalculationParametersRoot pACalculationParametersRoot = null)

Create or Update PA calculation and run it.

This endpoint updates and run the PA calculation specified in the PUT body parameters. This also allows creating new PA calculations with custom ids. It can take one or more calculation units as input. Remarks: * Any settings in PUT body will act as a one-time override over the settings saved in the PA template. * Account identifiers must have .ACCT or .ACTM extension or BENCH: prefix. Holdings mode can be optionally set for every account. Possible values for holdings mode are B&H (Buy and Hold), TBR (Transaction based returns), OMS (Order Management System), VLT (Vaulted returns) or EXT (External Returns Data). Default holdings mode value is B&H. * If we are overriding the grouping with a frequency, we will be overriding the grouping saved to the original component and also overriding the default frequency of the Beginning of Period to whatever we pass in the request body. * If we are overriding grouping frequency without overriding the group id it will not be applied to the default groupings saved to the original component. * Componentdetail supports securities, groups, groupsall, and totals levels of granularity. However, if no value is passed, the default value is ‘securities’. Additionally, while ‘groupsall’ returns all the group levels in the PA component, setting componentdetail to ‘groups’ only returns the expanded or collapsed group levels within the PA component.

Example

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 PutAndCalculateExample
    {
        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";
            // Configure Bearer token for authorization: Bearer
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new PACalculationsApi(config);
            var id = id_example;  // string | from url, provided from the location header in the Create and Run PA calculation endpoint
            var xFactSetApiLongRunningDeadline = 10;  // int? | Long running deadline in seconds when only one unit is passed in the PUT body. Example value is set to 10s. Please update it as per requirement before triggering a calculation (optional) 
            var cacheControl = cacheControl_example;  // string | Standard HTTP header.  Accepts max-stale. (optional) 
            var pACalculationParametersRoot = new PACalculationParametersRoot(); // PACalculationParametersRoot | Calculation Parameters (optional) 

            try
            {
                // Create or Update PA calculation and run it.
                CalculationStatusRoot result = apiInstance.PutAndCalculate(id, xFactSetApiLongRunningDeadline, cacheControl, pACalculationParametersRoot);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PACalculationsApi.PutAndCalculate: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
id string from url, provided from the location header in the Create and Run PA calculation endpoint  
xFactSetApiLongRunningDeadline int? Long running deadline in seconds when only one unit is passed in the PUT body. Example value is set to 10s. Please update it as per requirement before triggering a calculation [optional]
cacheControl string Standard HTTP header. Accepts max-stale. [optional]
pACalculationParametersRoot PACalculationParametersRoot Calculation Parameters [optional]

Return type

CalculationStatusRoot

Authorization

Basic, Bearer

HTTP request headers

HTTP response details

| 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-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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
| | 200 | Expected response, if the calculation has one unit and is completed with an error. | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
| | 201 | Expected response if the calculation has one unit and is completed in a short span, returns JSON in the format specified in the Calculation parameters. | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
| | 400 | Invalid Calculation Parameters. | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
| | 404 | One or more calculation settings were unavailable. | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
| | 409 | Duplicate calculation exists with same parameters. | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-RateLimit-Reset - Number of seconds remaining till rate limit resets.
| | 415 | Missing/Invalid Content-Type header. Header needs to be set to application/json. | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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. | * 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-FactSet-Api-RateLimit-Limit - Number of allowed requests for the time window.
* X-FactSet-Api-RateLimit-Remaining - Number of requests left for the time window.
* X-FactSet-Api-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. | * 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]