StatPro Revolution Web API


The Portfolio Analysis Controller Resource


Overview

The Portfolio Analysis Controller resource represents a controller that allows the caller to trigger actions on a portfolio analysis. Currently only a single action can be performed which is to trigger the calculation of a Custom Time Period Portfolio Analysis resource (and optionally any reporting component alternative settings portfolios linked to the portfolio). This resource requires a simple Xml query to be included in the message body of a POST request. Further details of formulating this query can be found in the Portfolio Analysis Controller link relation.

For further details of what a Custom Time Period Portfolio Analysis represents refer to the resource page.

Calculating results for Custom Time Period Portfolio Analyses is not an action that can return results immediately on-the-fly and so for this reason we have the Portfolio Analysis Controller resource as a trigger mechanism to enqueue the request within the Revolution platform. Upon triggering the calculation of a Custom Time Period Portfolio Analysis this controller resource emits one of the following responses:

  • Bad Request (400): This could be returned for a variety of reasons including a badly formed / semantically invalid Xml POST body, an unrecognized portfolio identifier/analysis type or an excessive number of custom time periods (currently limited to 100 per request).
  • Forbidden (403): There is a limit of 10 Custom Time Period Portfolio Analyses that can be triggered per portfolio analysis per analysis type (i.e. default / awaiting sign-off / signed-off) per authenticated user within a one hour period. If triggering the calculation would cause this limit to be exceeded then this response will be returned. The caller will need to hold off for a period of time until they are no longer in breach of this limit.
  • OK (200): In this instance the request has been parsed and the request to calculate the Custom Time Period Portfolio Analysis has been successfully enqueued. The response includes a link to the Custom Time Period Portfolio Analysis resource. This link can then be used to test the status of the Custom Time Period Portfolio Analysis just like any other Portfolio Analysis resource. When the Custom Time Period Portfolio Analysis resource has one of the completed states, then results can be extracted in exactly the same way as other portfolio analysis resources.

In order to understand how to trigger a Custom Time Period Portfolio Analysis using the Portfolio Analysis Controller resource it is necessary to formulate a query which is described in more detail in the Portfolio Analysis Controller link relation.

See the annotated representations below detailing the responses of the Portfolio Analysis Controller in XML and JSON representations of the resource for the 200 (= OK) response.


Media types

The Portfolio Analysis Controller resource is exposed via XML and JSON representations, which have the following media type names:-

application/vnd.statpro.revolution.api.portfolio-analysis-controller+xml

application/vnd.statpro.revolution.api.portfolio-analysis-controller+json

When a response is received from the web service with status 200 (= OK), the fact that the response contains a Portfolio Analysis Controller resource representation is indicated by the presence of one of these two response headers:-

Content-Type: application/vnd.statpro.revolution.api.portfolio-analysis-controller+xml; charset=utf-8

Content-Type: application/vnd.statpro.revolution.api.portfolio-analysis-controller+json; charset=utf-8


Related resources

The Portfolio Analysis Controller resource links to the Custom Time Period Portfolio Analysis resource. To do so, its resource representations use link relations:-

  • custom-time-period-portfolio-analysis

The custom-time-period-portfolio-analysis link relation identifies the link that allows the caller to access the resulting triggered custom time period portfolio analysis.

All related resources are accessed using the HTTP GET method.


Update history

  • Initial Version - June 2017

Annotated Representations (JSON)

Legend

{
  "links": {
    "service": {
      "rel": "service",
      "href": "...",
      "type": "application/vnd.statpro.revolution.api.service+json"
    },
    "self": {
      "rel": "self",
      "href": "...",
      "type": "application/vnd.statpro.revolution.api.portfolio-analysis-controller+json"
    },
    "portfoliosQuery": {
      "rel": "portfolios-query",
      "href": "...?$filter={filter}&$orderby={orderby}&$skip={skip}&$top={top}&includePublishedPortfolios=false&portfolioClassifierCode=",
      "type": "application/vnd.statpro.revolution.api.portfolios+json"
    },
    "customTimePeriodPortfolioAnalysis": {
      "rel": "custom-time-period-portfolio-analysis",
      "href": "...",
      "type": "application/vnd.statpro.revolution.api.custom-time-period-portfolio-analysis+json"
    }
  },
  "reportingComponents": [
    {
      "customTimePeriodPortfolioAnalysis": {
        "rel": "custom-time-period-portfolio-analysis",
        "href": "...",
        "type": "application/vnd.statpro.revolution.api.custom-time-period-portfolio-analysis+json"
      },
      "name": "Top Down By Country",
      "code": "ASP1",
      "reportingTag": {
        "group": "Default",
        "name": "TD By Country"
      }
    },
    {
      "customTimePeriodPortfolioAnalysis": {
        "rel": "custom-time-period-portfolio-analysis",
        "href": "...",
        "type": "application/vnd.statpro.revolution.api.custom-time-period-portfolio-analysis+json"
      },
      "name": "Top Down By Asset Class",
      "code": "ASP2",
      "reportingTag": {
        "group": "Default",
        "name": "TD By AssetClass"
      }
    }
  ]
}


Annotated Representations (XML)

Legend

<?xml version="1.0" encoding="utf-8"?>
<portfolioAnalysisController xmlns="http://statpro.com/2012/Revolution">
  <link rel="service"
        href="..."
        type="application/vnd.statpro.revolution.api.service+xml" />
  <link rel="self"
        href="..."
        type="application/vnd.statpro.revolution.api.portfolio-analysis-controller+xml" />
  <link rel="portfolios-query"
        href="...?$filter={filter}&amp;$orderby={orderby}&amp;$skip={skip}&amp;$top={top}&amp;includePublishedPortfolios=false&amp;portfolioClassifierCode="
        type="application/vnd.statpro.revolution.api.portfolios+xml" />
  <link rel="custom-time-period-portfolio-analysis"
        href="..."
        type="application/vnd.statpro.revolution.api.custom-time-period-portfolio-analysis+xml" />
  <reportingComponents>
    <reportingComponent>
      <link rel="custom-time-period-portfolio-analysis"
            href="..."
            type="application/vnd.statpro.revolution.api.custom-time-period-portfolio-analysis+xml" />
      <name>Top Down By Country</name>
      <code>ASP1</code>
      <reportingTag>
        <group>Default</group>
        <name>TD By Country</name>
      </reportingTag>
    </reportingComponent>
    <reportingComponent>
      <link rel="custom-time-period-portfolio-analysis"
            href="..."
            type="application/vnd.statpro.revolution.api.custom-time-period-portfolio-analysis+xml" />
      <name>Top Down By Asset Class</name>
      <code>ASP2</code>
      <reportingTag>
        <group>Default</group>
        <name>TD By AssetClass</name>
      </reportingTag>
    </reportingComponent>
  </reportingComponents>
</portfolioAnalysisController>


Last updated: June 2017


To Top