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",
"column": "columnName",
"operator": "=",
"operand_1": "Narayan"
}
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",
"column": "name",
"operator": "=",
"operand_1": "value"
}
},
- 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": "indianmobile",
"order": "desc"
}
],
"filter":{
"condition": "where",
"column": "text",
"operator": "=",
"operand_1": "Narayana"
}
}
- 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",
"column": "text",
"operator": "=",
"operand_1": "Narayana"
}
}
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": {
"sheet": [
{
"hggffj": "sample1",
"Dropdown": "Data",
"richtext": null,
"Contact2": null,
"dasfa": null,
"pn germany": null,
"email": null,
"dropdowm": null,
"IndianPhone": null,
"_id": "62fc9829bd"
},
],
"view": [
{
"hggffj": "sample2",
"Dropdown": "Data",
"richtext": null,
"Contact2": null,
"Contact": null,
"dasfa": null,
"pn germany": null,
"email": null,
"dropdowm": null,
"IndianPhone": null,
"_id": "62fc9829bd"
}
]
},
"success": true
}
Response Headers
Header | Description |
---|---|
Content-Type | application/json |