The following article covers Sigma’s developer API for workbook exports. Depending on the parameters passed, the workbook export endpoint can be used to export full workbooks, single workbook pages, and individual elements.
Assuming a successful request, Sigma will respond with a queryId to be associated with your workbook export request. To access this query and download your requested export, use Sigma’s query download endpoint.
For Sigma’s baseline workbook API, visit Workbook API

Summary of Content

Endpoints
The Workbook Export Object
      Attributes
Generate a Workbook Export Query
      Permissions
      Parameters
      cURL Request
      Response
      Example
Related Resources

Endpoints

POST /v2/workbooks/{workbookId}/export

      Returns a workbook schema object based on a workbookId. Learn more.
      Try it in Swagger

The Workbook Schema Object

Attributes

jobComplete boolean

True if the job has completed prior to Sigma’s response. A falsy value DOES NOT mean that the job has failed; it means that the job is not yet complete. 

queryid string 

A unique identifier for the resulting query. QueryId can be used with Sigma’s query endpoint to download the workbook export.

{
 "jobComplete": false,
  "queryId": "b4841ad9-8d6f-4074-cf6e-afcbff6c390a"
}

 

Generate a Workbook Export Query

Returns a workbook schema object based on a workbookId.

POST /v2/workbooks/{workbookId}/export

Try it in Swagger

Permissions 

  • The user account associated with the API token must have permission to export the workbook, workbook page, or workbook element.
    Note: If you encounter a permission error for the given endpoint, check with your organization Admin to verify your account type and permissions associated with your API token.

Parameters

elementId string

The unique identifier of the element you want to export.

This parameter is only used when exporting a specific element.

pageId string

The unique identifier of the page you want to export.

This parameter is only used when exporting a specific page.

format object 

The export format you wish to use:

  • Workbook pages can be exported to pdf or png.
  • Workbook elements can be exported to csv, json, jsonl, or xlsx

If type equals “pdf”, also include layout (i.e. portrait or landscape).

{ "type": "pdf", "layout": "landscape" }

 

timeout number [optional]

The time limit, in seconds, that you would like to set on your request.

This is used for json exports only. If your export format is not json, or if timeout is excluded, a response will be returned immediately.  

parameters object [optional]

A mapping of control ids to your intended input values.

filters object [optional]

A mapping of control ids to your intended input values.

cURL Request

curl --location --request POST 'https://api.sigmacomputing.com/v2/workbooks/{workbookId}/export \
--header 'Authorization: Bearer {access_token}' \
--header 'Content-Type: application/json' \

 

Response

{
  "jobComplete": boolean,
  "queryId": string
}

 

Example

Example Request:

curl --location --request POST 'https://api.sigmacomputing.com/v2/workbooks/6tWWojYtpnpJqdqkNKAwS5/export' \
--header 'Authorization: Bearer {access_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
   "elementId": "Mkaex5leIGcjlkQa5PqEw",
  "format": {
     "type": "csv"
   },
  "filters": {
    "region": "East"
  }
}'

 

Example Response:

{
 "jobComplete": false,
  "queryId": "b4841ad9-8d6f-4074-cf6e-afcbff6c390a"
}

 

Related Resources

API Documentation

Get Started with Sigma's API
Create an API Token and Client Id
Workbook API
Workbook Schema API

Product Documentation

Send and Schedule Workbooks
Download a Data Element