Skip to content

Export Report

This endpoint generates a report for a portfolio and returns it as a downloadable file.

For the JSON response, see Generate Report.

Endpoint

File export

GET https://cloud-gateway.dmo.app.pantaindex.com/api/v1/report-service/report/generate/portfolio/{portfolioId}/export

Authentication

This endpoint requires authentication. See Authentication for details on how to obtain an access token.

Required headers

Header Required Description
Authorization Yes Bearer access token
X-CLIENT-ID Yes Your tenant/client ID

Path parameter

Name Type Required Description
portfolioId Integer Yes Portfolio identifier

Query parameters

Parameter Type Required Description
reportType String Yes Type of report to generate. Supported values: index, constituent.close, constituent.open, constituent.proforma
date Date (YYYY-MM-DD) Yes Report date
format String No Output format. Supported values: json, csv. Default: json

Export response

format=json

Returns a downloadable .json file with content type application/json.

Example JSON export:

[
  {
    "effectiveDate": "2023-06-29",
    "indexId": "63b8tt12-d342-4b42-9bb8-0b535f4b197b",
    "indexName": "Example 600 OG JPY",
    "indexValue": 1312.318451,
    "currency": "JPY",
    "closeMarketValue": 2044221906.06,
    "openMarketValue": 2044221906.06,
    "closeDivisor": 1366099.984339,
    "openDivisor": 1366099.984339,
    ...
  }
  ...
]

Example file output:

2023-06-29_Example_600_OG_index.json

format=csv

Returns a downloadable .zip archive with content type application/zip.

Example CSV content inside the ZIP:

Effective Date,ISIN,Security Name,Security Ticker,Exchange Code,Closing Price,Currency,Closing Fx,Index Shares,Index Weighting
2023-06-30,CH0102878927,STOXX EXAMPLE 600 OIL & GAS GROSS EUR,SXEGR Index,,242.76633,EUR,1,13417.402222,0.25
2023-06-30,EU0001674791,STOXX EXAMPLE 600 OIL & GAS NET EUR,SXER Index,,996.57944,EUR,1,6536.947018,0.5

Example file output:

2023-06-29_Example_600_OG_index.zip

If there is no data, the endpoint returns 200 OK with an empty body.

Full workflow (cURL)

TOKEN=$(curl -s -X POST \
  "https://login.dmo.app.pantaindex.com/realms/panta-technology/protocol/openid-connect/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "client_id=YOUR_CLIENT_ID" \
  -d "client_secret=YOUR_CLIENT_SECRET" \
  -d "grant_type=password" \
  -d "username=YOUR_USERNAME" \
  -d "password=YOUR_PASSWORD" \
  | jq -r .access_token)

curl --request GET \
  --url "https://cloud-gateway.dmo.app.pantaindex.com/api/v1/report-service/report/generate/portfolio/1/export?reportType=index&date=2023-06-26&format=json" \
  --header "X-CLIENT-ID: YOUR_TENANT_ID" \
  --header "Authorization: Bearer $TOKEN" \
  --output report.json

Export examples

Export JSON file

curl --request GET \
  --url "https://cloud-gateway.dmo.app.pantaindex.com/api/v1/report-service/report/generate/portfolio/1/export?reportType=index&date=2023-06-26&format=json" \
  --header "X-CLIENT-ID: YOUR_TENANT_ID" \
  --header "Authorization: Bearer $TOKEN" \
  --output report.json

Export CSV ZIP

curl --request GET \
  --url "https://cloud-gateway.dmo.app.pantaindex.com/api/v1/report-service/report/generate/portfolio/1/export?reportType=index&date=2023-06-26&format=csv" \
  --header "X-CLIENT-ID: YOUR_TENANT_ID" \
  --header "Authorization: Bearer $TOKEN" \
  --output report.zip

JavaScript / TypeScript example

This example is intended to run as a Node.js script.

const fs = require("fs");

async function exportPantaReport(clientId, portfolioId, format = "json") {
  const authResponse = await fetch(
    "https://login.dmo.app.pantaindex.com/realms/panta-technology/protocol/openid-connect/token",
    {
      method: "POST",
      headers: { "Content-Type": "application/x-www-form-urlencoded" },
      body: new URLSearchParams({
        client_id: "YOUR_CLIENT_ID",
        client_secret: "YOUR_CLIENT_SECRET",
        grant_type: "password",
        username: "YOUR_USERNAME",
        password: "YOUR_PASSWORD",
      }),
    }
  );

  if (!authResponse.ok) {
    throw new Error(`Authentication failed: ${authResponse.status}`);
  }

  const { access_token: token } = await authResponse.json();

  const exportResponse = await fetch(
    `https://cloud-gateway.dmo.app.pantaindex.com/api/v1/report-service/report/generate/portfolio/${portfolioId}/export?reportType=index&date=2023-06-26&format=${format}`,
    {
      method: "GET",
      headers: {
        "X-CLIENT-ID": clientId,
        "Authorization": `Bearer ${token}`,
      },
    }
  );

  if (!exportResponse.ok) {
    throw new Error(`Export request failed: ${exportResponse.status}`);
  }

  const arrayBuffer = await exportResponse.arrayBuffer();
  const buffer = Buffer.from(arrayBuffer);

  const fileName = format === "csv" ? "report.zip" : "report.json";
  fs.writeFileSync(fileName, buffer);

  console.log(`Saved as: ${fileName}`);
}

exportPantaReport("YOUR_TENANT_ID", 1, "json").catch(console.error);

Error handling

Status Code Meaning Action
200 OK Success Download the exported file
400 Bad Request Malformed request Check request parameters and request format
401 Unauthorized Invalid or expired token Re-authenticate to obtain a new access token
403 Forbidden Insufficient permissions Verify your tenant ID and account permissions
404 Not Found Resource not found Check the portfolio ID or endpoint path
500 Internal Server Error Server-side issue Retry after a short delay; contact support if persistent

Support

If you have any questions about your integration or encounter issues not covered in this guide, please reach out to your Panta account manager or contact:

support@pantaindex.com

Notes

  • Supported export formats: json and csv.
  • json returns a .json file.
  • csv returns a .zip file.
  • For the generated contract and schemas, see API Reference.