Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Export Data from Flex Insights via API


Learn how to export reports from within Insights to store the data in a warehouse of your own with this guide.

The export process consists of the following steps:


Prerequisites

prerequisites page anchor

Before you start exporting data you will need to have:


Ensure that you are authenticated against the Flex Insights API by having a valid TT (temporary token).

The procedure is detailed at API General Usage


Exporting the raw report is useful for getting machine-friendly data from any report created from your Flex Insights Analytics Portal(link takes you to an external page). You will need the ID of the workspace and ID of the report object to export the data.

Workspace ID: Log in to the Analytics Portal(link takes you to an external page) and check the URL in the browser address bar. For example:

Workspace ID.

The workspace ID is the string appearing between the #s=/gdc/workspaces/ segment and the vertical bar. In this case, the workspace ID qx8vgewnj2hyemje8f6bkrkbyqk8psrf.

Object ID: Within Analytics Portal navigate to the report you'd like to export, and check the URL in the address bar. It may look like this:

Object ID.

Object ID is the numerical expression at the very end of the URL and is typically preceded by obj/ segment. In the example above, Object ID is 643040.

(warning)

Warning

The maximum report size for raw exports is 1GB. Exporting a report of this size may take minutes.

flex-insights---get-link-of-the-raw-report page anchor
curl

_10
curl --location --request POST 'https://analytics.ytica.com/gdc/app/projects/{workspace_id}/execute/raw' \
_10
--header 'Accept: application/json' \
_10
--header 'Content-Type: application/json' \
_10
--header 'Cookie: GDCAuthTT=XXXXX-XXXXX-XXXXX' \
_10
--data-raw '{
_10
"report_req": {
_10
"report": "/gdc/md/{workspace_id}/obj/{object_id}"
_10
}
_10
}'

Output

_10
{
_10
"uri": "/gdc/projects/{workspace_id}/execute/raw/{download_id}"
_10
}


Download the report by using URI from previous export.

(information)

Info

If you receive 202 response from API, it means that the request is accepted, but not ready to be delivered (still computing or preparing the CSV).
Since the export API can take several seconds, or minutes in edge cases, depending on the volume of data and number of columns, you need to add a retry in case the server returns 202. The data is only ready to download when the server returns 200.

Flex Insights - Download the report

flex-insights---download-the-report page anchor
curl

_10
curl --location --request GET 'https://analytics.ytica.com/{URI}' \
_10
--header 'Cookie: GDCAuthTT=XXXXX-XXXXX-XXXXX'

Output

_10
# CSV format
_10
Agent,Date,Amount
_10
Jack,02/15,45
_10
Emma,02/16,123
_10
Ludwig,02/25,13


Rate this page: