Calculation Run (Master and Analytic Models)
  • 1 Minute to read
  • Dark
    Light
  • PDF

Calculation Run (Master and Analytic Models)

  • Dark
    Light
  • PDF

Article summary

Calculation Run (Master and Analytic Models)

Use this API to run a Calculation defined on a Master or Analytic model. Only one Calculation can be invoked per API invocation. Only those Calculations that are enabled to run in the background can be invoked with this API. Invoking any other type will result in an error.

You can also optionally pass variables and values for variables into the calculation.

POST /modeling/model/calcscript/run HTTP/1.1
Content-Type: application/xml
Accept: application/xml
X-ACCESS-TOKEN:
 
<?xml version="1.0" encoding="UTF-8"?>
<run-calcscript-payload>
<model-name>$ModelName</model-name>
<calcscript-name>$CalcScriptName</calcscript-name>
<runtime-values>
<entry>
<key> @calcvariablename@ </key>
<value> VariableValue </value>
</entry>
<entry>
<key> @calcvariablename@ </key>
<value> VariableValue </value>
</entry>
</runtime-values>
</run-calcscript-payload>

Parameters

  1. $ModelName: (type: string) Name of the model

  2. $CalcScriptName: (type: string) Name of the Calculation

Sample Payload with Variables

<?xml version="1.0" encoding="UTF-8"?>
<run-calcscript-payload>
<model-name>My Model</model-name>
<calcscript-name>My Calcscript</calcscript-name>
<runtime-values>
<entry>
<key>@Scenario@</key>
<value>Budget 2018</value>
</entry>
<entry>
<key>@CurYear@</key>
<value>2018</value>
</entry>
</runtime-values>
</run-calcscript-payload>

Response

Success Response

HTTP/1.1 200/204 OK

Error Responses

Service Not Available (possibly due to maintenance)

HTTP/1.1 503 Service Unavailable

One or more HTTP headers were missing

HTTP/1.1 412 Precondition Failed

Unauthorized Access (access key lookup failed)

HTTP/1.1 401 Unauthorized

Invalid XML (bad request)

HTTP/1.1 400 Bad Request

Not Found (model/calculation not found)

HTTP/1.1 404 Not Found


Was this article helpful?