Workbook Schema API
The following article covers Sigma’s developer API for workbook schemas. A workbook’s schema defines the structure and high-level content of the workbook.
For Sigma’s baseline workbook API, visit Workbook API.
The Workbook Schema API will be deprecated on July 31, 2023. This endpoint is no longer compatible with the new Grid Layouts. Workflows that use this endpoint need to be replaced with the new endpoints listed below. The components in Workbook Schema API are available through individual endpoints to minimize the retrieval of unnecessary data.
GET v2/workbooks/{workbookId}/pages
GET v2/workbooks/{workbookId}/pages/{pageId}/elements
GET v2/workbooks/{workbookId}/queries
GET v2/workbooks/{workbookId}/elements/{elementId}/query
Endpoints
GET /v2/workbooks/{workbookId}/schema
Returns a workbook schema object based on a workbookId.
Try it in Swagger
The Workbook Schema Object
Attributes
workbookId string
The workbook’s unique identifier.
pages object
An object that maps workbook pageIds to their matching page object.
{ : { An object that maps workbook sheetIds to their matching sheet object. A sheet refers to a structured table underlying any data element. { : { An object that maps workbook variableIds to their matching variable object. Variables refer to control elements. { : { An object that maps workbook elementIds to their matching element object. { : { Example { Returns a workbook schema object based on a workbookId. GET /v2/workbooks/{workbookId}/schema When true, the returned Workbook Schema Object will include "sqlQueries," a list of key value pairs where the key is the query id and the value is a sql string. curl --location --request GET 'https://api.sigmacomputing.com/v2/workbooks/{workbookId}/schema?includeSql=**{boolean}**' \ { Example Request: curl --location --request GET 'https://api.sigmacomputing.com/v2/workbooks/6tWWojYtpnpJqdqkNKAwS5/schema?includeSql=true' \ Example Response: {
"id": string,
"title": string,
"hidden": boolean,
"body": Array<{
"id": string,
"type": string,
"children": Array
}>,
"sortIndex": number
}
sheets object
"id": string,
"columns": { : Object },
"base": {
"columns": Array
},
"type": string,
"levels": Array
}}
"id": string,
"defaultValue": {
"type": string,
"value": Object | null
},
}}
Elements refer to all element types.
"id": string,
"type": string,
"displayName": string | undefined // only included if includeSQL is true in the request ... // additional attributes vary depending on element type
}}
"workbookId": "6tWWojYtpnpJqdqkNKAwS5",
"pages": {
"page1": "[Object Page_t]"
},
"sheets": {
"sheet1": "[Object Sheet_t]"
},
"variables": {
"variable1": "[Object Variable_t]"
},
"elements": {
"element1": "[Object Element_t]"
}
}
--header 'Authorization: Bearer {access_token}' \
--header 'Content-Type: application/json' \
"workbookId": "6tWWojYtpnpJqdqkNKAwS5",
"pages": {
"page1": "[Object Page_t]"
},
"sheets": {
"sheet1": "[Object Sheet_t]"
},
"variables": {
"variable1": "[Object Variable_t]"
},
"elements": {
"element1": "[Object Element_t]"
}, "sqlQueries": {
"query1": "[sql]"
}
--header 'Authorization: Bearer {access_token}' \
--header 'Content-Type: application/json' \
"workbookId": "t75b8368-4988-4253-a6rt-7869dc2fmoat",
"pages": {
"r1ZNi32OnN": {
"id": "r1ZNi32OnN",
"title": "Page 1",
"body": {
"id": "o7JfOaznU2",
"type": "body",
"sections": Array
},
...
},
"sheets": {
"9YOAVajdAPzyTEa2frCTpt": {
"id": "9YOAVajdAPzyTEa2frCTpt",
"columns": Array,
"type": "levelTable",
"levels": Array
},
...
},
"variables": {
"New-Control-1": {
"name": "New-Control-1",
"defaultValue": {
"type": "date",
"value": null
},
...
},
"elements": {
"F8YtuFIyuDQ": {
"id": "F8YtuFIyuDQ",
"type": "viz",
"height": {
"type": "ratio",
"value": "auto"
},
"viz": {
"workbookId": "t75b8368-4988-4253-a6rt-7869dc2fmoat",
"sheetId": "9YOAVajdAPzyTEa2frCTpt"
}
},
...
}, "sqlQueries": {
"34nHIz3pwNK7pwlxAs4sTa": "select ORDER_NUMBER_39 \"Order Number\" ..."
}
}
Updated 6 months ago