Magento BI Export API

​ The Magento BI Export API allows you to access some of the raw data behind your Magento BI dashboard.

Before using the export API, make sure you authenticate your connection.

Raw data exports

You need a raw data export before calling the following methods.

List all available raw exports

The GET /export call returns a list of raw exports available. ​ Endpoint:GET /exportRequest:

1
curl -H "X-RJM-API-Key: <your_key>" https://api.rjmetrics.com/0.1/export

Get a specific export

The GET /export/:idcall returns a zip-compressed CSV file containing the raw data of a completed export. ​ Endpoint:GET /export/:idRequest:

1
curl -H "X-RJM-API-Key: <your_key>" https://api.rjmetrics.com/0.1/export/51

Get an export description

The GET /export/:id/info call returns a description of the export with the specified ID. ​ Endpoint:GET /export/:id/infoRequest:

1
curl -H "X-RJM-API-Key: <your_key>" https://api.rjmetrics.com/0.1/export/51/info

Copy an export

Creates a new export with the exact same parameters as the specified export. If you specify the name parameter, the new export will be assigned its value. ​

The API no longer supports modifying the start and end time parameters. ​ Endpoint:POST /export/:id/copy/name=<ExportName>Request:

1
curl -d "name=New Copied Export" -H "X-RJM-API-Key: <your_key>" https://api.rjmetrics.com/0.1/export/51/copy

Data tables

Get a list of tables

The GET /client/:clientId/table call returns a list of tables in the data warehouse of the client corresponding to clientId. ​ Endpoint:GET /client/:clientId/tableRequest:

1
curl -H "X-RJM-API-Key: <your_key>" https://api.rjmetrics.com/0.1/client/12/table

Get a list of table columns

The GET /client/:clientId/table/:tableId call returns a list of table columns in the table corresponding to tableIid. ​ Endpoint:GET /client/:clientId/table/:tableIdRequest:

1
curl -H "X-RJM-API-Key: <your_key>" https://api.rjmetrics.com/0.1/client/12/table/3

Create a raw data export of a table

The POST /client/:clientId/table/:tableId/export call creates a new raw data export of the entire contents of the table corresponding to tableId. ​

Exports are capped at 10 million rows. Do not try this on very large tables. ​ Endpoint:POST /client/:clientId/table/:tableId/exportRequest:

1
curl -d "" -H "X-RJM-API-Key: <your_key>" https://api.rjmetrics.com/0.1/client/12/table/3/export

Figures

Get a list of figures

The GET /figure call returns a list of figures that are available for export. ​ Endpoint:GET /figureRequest:

1
curl -H "X-RJM-API-Key: your\_key" https://api.rjmetrics.com/0.1/figure

Export figure data

The POST /figure/:id/export/format=<FormatType> call outputs the data used to create the figure with the specified ID. Figure IDs can be found in the “Export Figure” dialogue in the Magento BI dashboard interface.

The user can specify an output format of either .csv or .json. ​ Endpoint:POST /figure/:id/export/format=<FormatType>Request:

1
curl -d "format=csv&includeColumnHeaders=1" -H "X-RJM-API-Key: your\_key" https://api.rjmetrics.com/0.1/figure/360531/export

Get a figure description

The POST /figure/:id/info call returns a description of the specified figure. Figure IDs can be found in the “Export Figure” dialogue in the Magento BI dashboard interface. ​ Endpoint:POST /figure/:id/infoRequest:

1
curl -H "X-RJM-API-Key: your\_key" https://api.rjmetrics.com/0.1/figure/360531/info

Charts

Export Specific Reports (created by cohort report builder)

Get a list of charts

The GET /chart call returns a list of charts that are available for export. ​ Endpoint:GET /chartRequest:

1
curl -H "X-RJM-API-Key: your\_key" https://api.rjmetrics.com/0.1/chart

Export chart data

The POST /chart/:id/export/format=<FormatType>\] call outputs the data used to create the specified chart. Chart IDs can be found in the “Export Chart” dialogue in the Magento BI dashboard interface.

The user can specify an output format of either .csv or .json. ​ Endpoint:POST /chart/:id/export/format=<FormatType>\]Request:

1
curl -d "format=csv&includeColumnHeaders=1" -H "X-RJM-API-Key: your\_key" https://api.rjmetrics.com/0.1/chart/2038112/export

Get a chart description

The POST /chart/:id/info call returns a description of the specified chart or a 404 if the chart does not exist. Chart IDs can be found in the “Export Chart” dialogue in the Magento BI dashboard interface. ​ Endpoint:POST /chart/:id/infoRequest:

1
curl -H "X-RJM-API-Key: your\_key" https://api.rjmetrics.com/0.1/chart/2038112/info