Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 97 additions & 13 deletions modules/ROOT/pages/data-report-v2-api.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,92 @@ To download a personalized view of the Liveboard, specify the view name in the `
* Attempting to override existing filter values with runtime filters while exporting a Liveboard will result in an error.
====

==== File Format
==== File Formats

The default `file_format` is PDF. For PDF downloads, you can specify additional parameters to customize the page orientation and include or exclude the cover page, logo, footer text, and page numbers. You can also download the report in PNG format.
The default `file_format` is *CSV*.

For PNG downloads, you can now define
[NOTE]
If you do not have .csv downloads enabled for your ThoughtSpot instance, select either `PDF` or `PNG` `file_format` to successfully download the report. Using any other format will cause the API to return an error.


For *CSV* downloads [earlyAccess eaBackground]#Early Access#,

* Each visualization is exported as a separate .csv file.
* If multiple visualizations are selected, the downloaded report is a single compressed .zip file containing all .CSV files.
* It does not support any additional parameters to customize the page orientation and `include_cover_page`, `include_filter_page`, logo, footer text, and page numbers.
* Charts are exported as tabular data. Downloaded reports may include columns not seen in the visualization if they were used as tokens in the underlying search query.

===== Sample API payload for CSV downloads

[source,cURL]
----
curl -X POST \
--url 'https://{ThoughtSpot-Host}/api/rest/2.0/report/liveboard' \
-H 'Authorization: Bearer {access-token}'\
-H 'Content-Type: application/json' \
--data-raw '{
"metadata_identifier": "416052fd-ad22-4d48-be0a-e43b53109957",
"file_format": "CSV",
"tab_identifiers": [
"bc6d6fb8-1e06-4617-b02f-51745e6933a6"
]
}'
----

For *XLSX* downloads [earlyAccess eaBackground]#Early Access#,

* Visualization is exported as an Excel workbook (.xlsx).
* If multiple visualizations are selected, the downloaded report is a single Excel workbook (.xlsx) containing each visualization in their individual tab.
* A maximum of 255 tabs per .xlsx workbook are allowed.
* It does not support any additional parameters to customize the page orientation and `include_cover_page`, `include_filter_page`, logo, footer text, and page numbers.
* Charts are exported as tabular data. Downloaded reports may include columns not seen in the visualization if they were used as tokens in the underlying search query.
* Unlike the pivot tables that are downloaded for any pivot table Answer in the ThoughtSpot UI, pivot tables generated in .xlsx workbooks using this API endpoint are exported as their underlying raw data. The .xlsx currently does not support the pivot table format.

===== Sample API payload for XLSX downloads

[source,cURL]
----
curl -X POST \
--url 'https://{ThoughtSpot-Host}/api/rest/2.0/report/liveboard' \
-H 'Authorization: Bearer {access-token}'\
-H 'Content-Type: application/json' \
--data-raw '{
"metadata_identifier": "416052fd-ad22-4d48-be0a-e43b53109957",
"file_format": "XLSX",
"visualization_identifiers": [
"254c6e30-680c-41ea-aa4d-bb059f745462"
]
}'
----

For *PDF* downloads, you can specify additional parameters to customize the page orientation and include or exclude the cover page, logo, footer text, and page numbers.

===== Sample API payload for XLSX downloads

[source,cURL]
----
curl -X POST \
--url 'https://{ThoughtSpot-Host}/api/rest/2.0/report/liveboard' \
-H 'Authorization: Bearer {access-token}'\
-H 'Content-Type: application/json' \
--data-raw '{
"metadata_identifier": "416052fd-ad22-4d48-be0a-e43b53109957",
"file_format": "PDF",
"visualization_identifiers": [
"254c6e30-680c-41ea-aa4d-bb059f745462"
],
"pdf_options": {
"include_cover_page": true,
"include_custom_logo": true,
"include_filter_page": true,
"include_page_number": true,
"page_orientation": "LANDSCAPE",
"page_footer_text": "Sample footer text"
}
}'
----

For *PNG* downloads, you can now define

* `image_resolution` [earlyAccess eaBackground]#Early Access#
* `image_scale` [earlyAccess eaBackground]#Early Access#
Expand All @@ -250,37 +331,40 @@ Contact ThoughtSpot support to enable these settings for PNG downloads on your T
[IMPORTANT]
====
* If the above settings are enabled on your instance or you are using a ThoughtSpot release 10.9.0.cl or later,
** You will no longer be able to use the `include_cover_page`,`include_filter_page` within the `png_options`.
** You will no longer be able to use the `include_cover_page`, `include_filter_page` within the `png_options`.
** PNG download will support exporting only one tab at a time. If the `tab_identifier` is not specified, the first tab will be downloaded.
* Due to UI limitations in the REST API Playground, you'll notice that some parameters are automatically included in the PNG options JSON. This may cause your API request to fail. As a workaround, click *View JSON* next to the `png_options`, review the parameters, remove additional parameters, and then click *Try it out*.

====

==== Example
===== Sample API payload for PNG downloads

[source,cURL]
----
curl -X POST \
--url 'https://{ThoughtSpot-Host}/api/rest/2.0/report/liveboard' \
-H 'Authorization: Bearer {access-token}'\
-H 'Content-Type: application/json' \
--data-raw '{
"metadata_identifier": "9bd202f5-d431-44bf-9a07-b4f7be372125",
"metadata_identifier": "416052fd-ad22-4d48-be0a-e43b53109957",
"file_format": "PNG",
"visualization_identifiers": [
"9bd202f5-d431-44bf-9a07-b4f7be372125",
"9bd202f5-d431-44bf-9a07-b4f7be372125",
"9bd202f5-d431-44bf-9a07-b4f7be372125"
"tab_identifiers": [
"bc6d6fb8-1e06-4617-b02f-51745e6933a6"
],
"png_options": {
"include_cover_page": true,
"include_filter_page": true
"include_cover_page": null,
"include_filter_page": null,
"personalised_view_id": null,
"image_resolution": 1920,
"image_scale": 100,
"include_header": true
}
}'
----

==== Override filters

If the Liveboard has filters applied and you want to override the filters before downloading the Liveboard, you can specify the filters in the `override_filters` array.
If the Liveboard has filters applied, and you want to override the filters before downloading the Liveboard, you can specify the filters in the `override_filters` array.

[source,JSON]
----
Expand Down
12 changes: 10 additions & 2 deletions modules/ROOT/pages/rest-api-v2-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -896,11 +896,19 @@ ThoughtSpot Software: __9.5.1.sw or later__ a| +++<a href="{{navprefix}}/restV2-

a|`POST /api/rest/2.0/system/preferences/communication-channels/configure` +
Allows configuring communication channel preferences.
ThoughtSpot Cloud: __10.14.0.cl or later__ a| +++<a href="{{navprefix}}/restV2-playground?apiResourceId=http%2Fapi-endpoints%2Fsystem%2Fconfigure-communication-channel-preferences" id="preview-in-playground">Try it out </a>+++
a|ThoughtSpot Cloud: __10.14.0.cl or later__ a| +++<a href="{{navprefix}}/restV2-playground?apiResourceId=http%2Fapi-endpoints%2Fsystem%2Fconfigure-communication-channel-preferences" id="preview-in-playground">Try it out </a>+++

a|`POST /api/rest/2.0/system/preferences/communication-channels/search` +
Allows searching communication channel preferences.
ThoughtSpot Cloud: __10.14.0.cl or later__ a| +++<a href="{{navprefix}}/restV2-playground?apiResourceId=http%2Fapi-endpoints%2Fsystem%2Fsearch-communication-channel-preferences" id="preview-in-playground">Try it out </a>+++
a|ThoughtSpot Cloud: __10.14.0.cl or later__ a| +++<a href="{{navprefix}}/restV2-playground?apiResourceId=http%2Fapi-endpoints%2Fsystem%2Fsearch-communication-channel-preferences" id="preview-in-playground">Try it out </a>+++

a|`POST /api/rest/2.0/system/security-settings/configure` +
Allows configuring security settings.
a|ThoughtSpot Cloud: __26.2.0.cl or later__ a| +++<a href="{{navprefix}}/restV2-playground?apiResourceId=http%2Fapi-endpoints%2Fsystem%2Fconfigure-security-settings" id="preview-in-playground">Try it out </a>+++

a|`POST /api/rest/2.0/system/security-settings/search` +
Allows fetching security settings.
a|ThoughtSpot Cloud: __26.2.0.cl or later__ a| +++<a href="{{navprefix}}/restV2-playground?apiResourceId=http%2Fapi-endpoints%2Fsystem%2Fsearch-security-settings" id="preview-in-playground">Try it out </a>+++

|=====

Expand Down
Loading