Get Worksheet Data
- To get data from a worksheet, you need the following 3 parameters:
- 1.Token
- 2.Worksheet Id
- 3.App Id
POST
https://api.tablesprint.com/api/platform/worksheet/data/{appId}/{worksheetId}
URL Parameters​
Parameter | Type | Required | Description |
---|---|---|---|
appId | string | Yes | The unique identifier of the application |
worksheetId | string | Yes | The unique identifier of the worksheet |
To get URL parameters follow these steps:
- 1.Click on the downward arrow beside the worksheet name.
- 2.A dialog box with options will open
- 3.Click on More Info, and you'll see the worksheetId and AppId.
Request Body Parameters​
Parameter | Type | Required | Description |
---|---|---|---|
view | string | No | Name of the view to filter worksheet data |
sort | array | No | An array of objects specifying the sorting order for multiple columns. Each object must include a column name and an order (asc for ascending or desc for descending) |
View :
{
"view": "your-view-name-here"
}
Sort:
"sort": [
{
"column": "Name",
"order": "asc"
},
{
"column": "City",
"order": "desc"
}
],
Filter :
"filter": [
{
"condition": "where",
"columnId": "Product Id",
"operator": "=",
"operand1": {
"type": "value",
"value": "2"
}
}
]
Example :
- If you pass view and sort, you will get all columns from the specified view, along with the main view results sorted accordingly.
{
"view":"viewName",
"sort": [
{
"column": "Name",
"order": "asc"
},
{
"column": "City",
"order": "desc"
}
],
},
- If you pass view and filter, you will get all columns from the specified view, along with filtered results from the main view.
{
"view":"viewName",
"filter": [
{
"condition": "where",
"columnId": "Product Id",
"operator": "=",
"operand1": {
"type": "value",
"value": "2"
}
}
]
},
- If you pass sort and filter, you will get all filtered columns in ascending or descending order from the main view.
{
"sort": [
{
"column": "text",
"order": "asc"
},
{
"column": "email",
"order": "desc"
}
],
"filter": [
{
"condition": "where",
"columnId": "Product Id",
"operator": "=",
"operand1": {
"type": "value",
"value": "2"
}
}
]
}
- If you pass all three parameters (sort, filter, and view), you will get all filtered columns in ascending or descending order, along with all results from the specified view.
{
"view":"sheetviewapi",
"sort": [
{
"column": "text",
"order": "asc"
},
{
"column": "indianmobile",
"order": "desc"
}
],
"filter": [
{
"condition": "where",
"columnId": "Product Id",
"operator": "=",
"operand1": {
"type": "value",
"value": "2"
}
}
]
}
Request Headers
Header | Value |
---|---|
Authorization | Bearer YOUR_ACCESS_TOKEN |
Content-Type | application/json |
Example Request​
Here's an example of how to make this request:
curl --request POST \
--url https://api.example.com/worksheet/data/app123/worksheet456 \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"view": "your-view-name-here"
}'
Response​
A successful request returns the HTTP 200 OK
status code and JSON response body.
- In case you get other error codes: Refer here
{
"results": {
"data": [
{
"Product ID": "2",
"Product Name": "LEGO Star Wars Set",
"Description": "Fun building set for Star Wars fans.",
"Price": 150,
"_id": "859ca3dea4"
},
{
"Product ID": "2",
"Product Name": "Running Shoes",
"Description": "Comfortable running shoes for all terrains.",
"Price": 80,
"_id": "dcc213beb6"
}
],
"total": "2",
"summary": {
"rowcount": "2"
}
},
"success": true
}
Response Headers
Header | Description |
---|---|
Content-Type | application/json |