You can download a Pinboard, or specific visualizations from the Pinboard, as a PDF.

This API enables you to programmatically download Pinboards or certain visualizations from the Pinboards as a PDF.

You can also download an embedded Pinboard with unsaved changes.

This feature is the API version of the download a Pinboard as a PDF UI feature. The API parameters refer to options in the UI. To see these options in the UI, refer to Download a Pinboard as a PDF.

Resource URL

post /tspublic/v1/export/pinboard/pdf

Request Parameters

Form Parameter Data Type Description Mandatory? Default
id string ID (GUID) of the Pinboard to download Yes, unless using the transient_pinboard_content parameter. None
layout_type string [PINBOARD/VISUALIZATION] For PINBOARD, the PDF looks like the Pinboard does in the UI. For VISUALIZATION, the PDF has one visualization for each page. Yes PINBOARD
orientation string [PORTRAIT/LANDSCAPE] Specifies portrait or landscape mode. Yes LANDSCAPE
truncate_tables boolean If set to true, displays only the first page of the tables. Only applicable in Visualization layout. Yes, if layoutType is VISUALIZATION false
visualization_ids string Only select specific visualizations to include. Only applicable in Visualization layout. Yes, if layoutType is VISUALIZATION none
include_logo boolean Include customized wide logo if available in the footer Yes true
footer_text string Any footer text to be included in the footer of each page of the PDF No none
include_page_number boolean Whether to include a footer with the page number Yes true
include_cover_page boolean Whether to inclue a cover page displaying the Pinboard title Yes true
include_filter_page boolean Whether to include a second page with a list of all applied filters Yes true
transient_pinboard_content string For use when embedding ThoughtSpot. If the Pinboard has unsaved changes, pass this parameter, and use the JavaScript API. Yes, unless using the id parameter. none

Request Example

cURL

curl --location --request POST 'http://<instance>/callosum/v1/tspublic/v1/export/pinboard/pdf' \
--header 'Accept: application/octet-stream' \
--header 'X-Requested-By: ThoughtSpot' \
--header 'Cookie: JSESSIONID=71cc2672-7ead-4480-be7d-b6ad52023e98; userGUID=59481331-ee53-42be-a548-bd87be6ddd4a; Callosum-Download-Initiated=false' \
--form 'id="061457a2-27bc-43a9-9754-0cd873691bf0"' \
--form 'layout_type="PINBOARD"' \
--form 'orientation="LANDSCAPE"' \
--form 'truncate_tables="false"' \
--form 'include_logo="true"' \
--form 'include_page_number="true"' \
--form 'include_filter_page="true"' \
--form 'include_cover_page="true"'
Request URL
https://<instance>/callosum/v1/tspublic/v1/export/pinboard/pdf

Response Example

The response appears in the form of a raw pdf file. The response type is application/octet-stream.

Runtime filters

You can modify the API’s output by appending runtime filters at the end of the resource URL, with a specific syntax. For example:

https://<instance>/callosum/v1/tspublic/v1/export/pinboard/pdf?col1=COL_NAME1&op1=OP_TYPE1&val1=VALUE1&coln=COL_NAMEn&opn=OP_TYPEn&valn=VALUEn

You can add more than one filter by specifying col2, op2, val2, and so on.

Parameter Definition
coln Name of the column to filter on
opn {IN, EQ, NE, LT, LE…}
valn Value of the column to filter on.

Runtime filter operators

Operator Description Number of Values
EQ equals 1
NE does not equal 1
LT less than 1
LE less than or equal to 1
GT greater than 1
GE greater than or equal to 1
CONTAINS contains 1
BEGINS_WITH begins with 1
ENDS_WITH ends with 1
BW_INC_MAX between inclusive of the higher value 2
BW_INC_MIN between inclusive of the lower value 2
BW_INC between inclusive 2
BW between non-inclusive 2
IN is included in this list of values multiple

Embedded Pinboard with unsaved changes

If your ThoughtSpot environment is embedded, and you want to download Pinboards with unsaved changes as PDFs, you must use the JavaScript API and pass the transient_pinboard_content parameter in the browser fetch request, using the getExportRequestForCurrentPinboard method.

The signature for this API method is as follows:

function getExportRequestForCurrentPinboard(frame: HTMLIframeElement): Promise<string>;

The promise returned resolves with a string that contains, encoded as JSON, the transient pinboard content which to send to the /callosum/v1/tspublic/v1/export/pinboard/pdf endpoint under the key transient_pinboard_content. This content resembles the current Pinboard as is, including any changes, saved or not.

Sample browser fetch request

<iframe src="http://ts_host:port/" id="ts-embed"></iframe>
<script src="/path/to/ts-api.js"></script>
<script>
const tsFrame = document.getElementById("ts-embed");
async function downloadPDF() {
  const transientPinboardContent = await thoughtspot.getExportRequestForCurrentPinboard(tsFrame);
  const pdfResponse = await fetch("http://ts_host:port/callosum/v1/tspublic/v1/export/pinboard/pdf", {
    method: "POST",
    body: createFormDataObjectWith({
      "layout_type": "PINBOARD",
      "transient_pinboard_content": transientPinboardContent,
    }),
  });
  // Do something with pdfResponse.blob()
}
</script>

Response Example

The response appears in the form of a raw pdf file. The response type is application/octet-stream.

HTTP status codes

You may receive the following status codes in your output. These HTTP status codes have the following meanings:

Status code Meaning
200 Streaming output for pinboard pdf
400 Invalid parameter values
403 No read access for pinboard
404 Object not found