How to select particular columns on data table for API actions?

We have a new use case , in which we will need to filter on a particular column from a data table.

Data table example-


{
“query”: {},
“limit”: 1000,
“offset”: 0,
“sortDirection”: “asc”,
“sortColumn”: “id”,
“items”: [
{
“HUB”: “EMEA1”,
“Capacity”: 54,
“TotalOccupancy”: 20,
“Space”: “PLKC0100”,
“Building”: “PLKC01”,
“Location”: “PLKC”,
“updatedAt”: “2023-06-21T10:16:48.411Z”,
“createdAt”: “2023-06-19T07:11:14.163Z”,
“id”: “648fff920984ee7c845838af”
},
{
“HUB”: “EMEA1”,
“Capacity”: 163,
“TotalOccupancy”: 34,
“Space”: “PLKC0101”,
“Building”: “PLKC01”,
“Location”: “PLKC”,
“updatedAt”: “2023-06-21T10:16:48.861Z”,
“createdAt”: “2023-06-19T07:11:14.672Z”,
“id”: “648fff920984ee7c845838b1”
},
{
“HUB”: “EMEA1”,
“Capacity”: 163,
“TotalOccupancy”: 62,
“Space”: “PLKC0102”,
“Building”: “PLKC01”,
“Location”: “PLKC”,
“updatedAt”: “2023-06-21T10:16:49.301Z”,
“createdAt”: “2023-06-19T07:11:15.285Z”,
“id”: “648fff930984ee7c845838b6”
},
{
“HUB”: “EMEA1”,
“Capacity”: 163,
“TotalOccupancy”: 44,
“Space”: “PLKC0103”,
“Building”: “PLKC01”,
“Location”: “PLKC”,
“updatedAt”: “2023-06-21T10:16:49.743Z”,
“createdAt”: “2023-06-19T07:11:15.964Z”,
“id”: “648fff930984ee7c845838b9”
},
{
“HUB”: “EMEA1”,
“Capacity”: 103,
“TotalOccupancy”: 73,
“Space”: “PLKC0104”,
“Building”: “PLKC01”,
“Location”: “PLKC”,
“updatedAt”: “2023-06-21T10:16:50.031Z”,
“createdAt”: “2023-06-19T07:11:16.615Z”,
“id”: “648fff940984ee7c845838bb”
}
],
“count”: 5,
“totalCount”: 5,
“applicationId”: “5f05879d599cfa00069dc8be”,
“dataTableId”: “648ffb5346cd3e889a4c6187”
}

Here I want only to select one row , filtering on space , eg I want to get only one row whose space is PLKC0100.

Are there any APIs for this ?

I used below APIs , but received the entire set of data .

Get-https://api.losant.com/applications/5f05879d599cfa00069dc8be/data-tables/648ffb5346cd3e889a4c6187/rows

https://api.losant.com/applications/5f05879d599cfa00069dc8be/data-tables/648ffb5346cd3e889a4c6187/rows?items.Space=PLKC0100

Also query API returned all the rows instead of 1.

https://api.losant.com/applications/5f05879d599cfa00069dc8be/data-tables/648ffb5346cd3e889a4c6187/rows/query?items.Space=PLKC0100

Data Table Rows: Query is the endpoint you want. Per the documentation for that endpoint …

  • Include the query you want to execute in the body of the request - so in your case, a body of {"Space": "PLKC0100" }.
  • limit is a query param, so that needs to be appended to the request URL: ?limit=1

The Losant API is fully documented with URLs, accepted parameters, schemas for request bodies, and example requests at docs.losant.com. I recommend starting there when interacting with our API directly.

Hi Dylan,

Thanks a lot.
This works for us.