Results
Use these endpoints to retrieve calculation output after submission.
GET /results is the drill-down: the full calculation detail for one account. GET /results/accounts is the current state of your whole book. To read the output of one batch, use GET /portfolios/batch/{batch_id}/results instead.
Get results by request ID
Fetch the stored result of a calculation, including the per-engine breakdowns, the priced positions and the exceptions.
Query parameters
- Name
request_id- Type
- string
- Description
Required. The
request_idreturned byPOST /portfolios, or the one on an account's row inGET /portfolios/batch/{batch_id}/results.
- Name
portfolio_id- Type
- string
- Description
Restrict the response to a single account. This is
md5(account_code), ormd5(account_code + sub_account_code)for a sub-account, so you can address a known account without a lookup. Omit it to return every account stored under thatrequest_id.
The response is the same per-account result object POST /portfolios
returns synchronously.
Coming from a batch
A batch splits its portfolio into chunks and stores each under its own
request_id. Take both the request_id and the portfolio_id from the
account's row in GET /portfolios/batch/{batch_id}/results.
A request_id you supply in the request body is honoured by
POST /portfolios but not by POST /portfolios/batch, which assigns its
own to each chunk.
Request
curl -sSX GET "$C9_API_ENDPOINT/results?request_id=$REQUEST_ID&portfolio_id=$PORTFOLIO_ID" \
-H "Authorization: Bearer $C9_API_SECRET"
Always pass portfolio_id when you want one account. Without it the response
contains every account calculated under that request_id, which for a large
book can run to tens of megabytes.
Get account results
Returns one row per live account you own, carrying each account's most recent calculation whatever produced it.
Use this to read the current state of a book: the latest figures per
account, with the request_id and submitted_time of the calculation that
produced them.
This endpoint is not scoped to a batch. It reflects whatever ran last for each account, which may be a later submission than the one you are interested in.
To read the output of a specific batch, use
GET /portfolios/batch/{batch_id}/results, which is scoped to that
submission and tells you, per account, whether its figures have since been
superseded.
Request
curl -sSX GET "$C9_API_ENDPOINT/results/accounts" \
-H "Authorization: Bearer $C9_API_SECRET"