Data Table Rows Actions
https://api.losant.com/applications/APPLICATION_ID
/data-tables/DATA_TABLE_ID
/rows
Below are the various requests that can be performed against the Data Table Rows resource, as well as the expected parameters and the potential responses.
Delete
Delete rows from a data table
Method And Url
POST https://api.losant.com/applications/APPLICATION_ID
/data-tables/DATA_TABLE_ID
/rows/delete
Authentication
A valid API access token is required to access this endpoint. The token must
include at least one of the following scopes:
all.Application
, all.Organization
, all.User
, dataTableRows.*
, or dataTableRows.delete
.
Request Path Components
Path Component | Description | Example |
---|---|---|
APPLICATION_ID | ID associated with the application | 575ec8687ae143cd83dc4a97 |
DATA_TABLE_ID | ID associated with the data table | 575ed78e7ae143cd83dc4aab |
Request Query Parameters
Name | Required | Description | Default | Example |
---|---|---|---|---|
limit | N | Limit number of rows to delete from data table | 1000 | limit=10 |
Request Headers
Name | Required | Description | Default |
---|---|---|---|
Authorization | Y | The token for authenticating the request, prepended with Bearer |
Request Body
The body of the request should be serialized JSON that validates against the Advanced Query schema. For example, the following would be a valid body for this request:
{
"$or": [
{
"level": {
"$ne": "myValue"
}
},
{
"level": 5
}
]
}
Curl Example
curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
https://api.losant.com/applications/APPLICATION_ID/data-tables/DATA_TABLE_ID/rows/delete
Successful Responses
Code | Type | Description |
---|---|---|
200 | Data Table Rows Delete | If request successfully deletes a set of Data Table rows |
Error Responses
Code | Type | Description |
---|---|---|
400 | Error | Error if malformed request |
404 | Error | Error if data table was not found |
Export
Request an export of the data table's data
Method And Url
POST https://api.losant.com/applications/APPLICATION_ID
/data-tables/DATA_TABLE_ID
/rows/export
Authentication
A valid API access token is required to access this endpoint. The token must
include at least one of the following scopes:
all.Application
, all.Application.read
, all.Organization
, all.Organization.read
, all.User
, all.User.read
, dataTableRows.*
, or dataTableRows.export
.
Request Path Components
Path Component | Description | Example |
---|---|---|
APPLICATION_ID | ID associated with the application | 575ec8687ae143cd83dc4a97 |
DATA_TABLE_ID | ID associated with the data table | 575ed78e7ae143cd83dc4aab |
Request Headers
Name | Required | Description | Default |
---|---|---|---|
Authorization | Y | The token for authenticating the request, prepended with Bearer |
Request Body
The body of the request should be serialized JSON that validates against the Data Table Rows Export schema. For example, the following would be a valid body for this request:
{
"email": "email@example.com",
"query": {
"$or": [
{
"myColumn1": {
"$ne": "myValue"
}
},
{
"myColumn2": 5
}
]
},
"queryOptions": {
"limit": 10000
}
}
Curl Example
curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
-d '{"email":"email@example.com","query":{"$or":[{"myColumn1":{"$ne":"myValue"}},{"myColumn2":5}]},"queryOptions":{"limit":10000}}' \
https://api.losant.com/applications/APPLICATION_ID/data-tables/DATA_TABLE_ID/rows/export
Successful Responses
Code | Type | Description |
---|---|---|
202 | Job Enqueued API Result | If request was successfully queued |
Error Responses
Code | Type | Description |
---|---|---|
400 | Error | Error if malformed request |
404 | Error | Error if data table was not found |
Get
Returns the rows for a data table
Method And Url
GET https://api.losant.com/applications/APPLICATION_ID
/data-tables/DATA_TABLE_ID
/rows
Authentication
A valid API access token is required to access this endpoint. The token must
include at least one of the following scopes:
all.Application
, all.Application.cli
, all.Application.read
, all.Organization
, all.Organization.read
, all.User
, all.User.cli
, all.User.read
, dataTableRows.*
, or dataTableRows.get
.
Request Path Components
Path Component | Description | Example |
---|---|---|
APPLICATION_ID | ID associated with the application | 575ec8687ae143cd83dc4a97 |
DATA_TABLE_ID | ID associated with the data table | 575ed78e7ae143cd83dc4aab |
Request Query Parameters
Name | Required | Description | Default | Example |
---|---|---|---|---|
sortColumn | N | Column to sort the rows by | sortColumn=myColumnName | |
sortDirection | N | Direction to sort the rows by. Accepted values are: asc, desc | asc | sortDirection=asc |
limit | N | How many rows to return | 1000 | limit=0 |
offset | N | How many rows to skip | 0 | offset=0 |
includeFields | N | Comma-separated list of fields to include in resulting rows. When not provided, returns all fields. | includeFields=id,createdAt |
Request Headers
Name | Required | Description | Default |
---|---|---|---|
Authorization | Y | The token for authenticating the request, prepended with Bearer |
Curl Example
curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X GET \
https://api.losant.com/applications/APPLICATION_ID/data-tables/DATA_TABLE_ID/rows
Successful Responses
Code | Type | Description |
---|---|---|
200 | Data Table Rows | Collection of data table rows |
Error Responses
Code | Type | Description |
---|---|---|
400 | Error | Error if malformed request |
404 | Error | Error if data table was not found |
Post
Inserts a new row(s) into a data table
Method And Url
POST https://api.losant.com/applications/APPLICATION_ID
/data-tables/DATA_TABLE_ID
/rows
Authentication
A valid API access token is required to access this endpoint. The token must
include at least one of the following scopes:
all.Application
, all.Organization
, all.User
, dataTableRows.*
, or dataTableRows.post
.
Request Path Components
Path Component | Description | Example |
---|---|---|
APPLICATION_ID | ID associated with the application | 575ec8687ae143cd83dc4a97 |
DATA_TABLE_ID | ID associated with the data table | 575ed78e7ae143cd83dc4aab |
Request Headers
Name | Required | Description | Default |
---|---|---|---|
Authorization | Y | The token for authenticating the request, prepended with Bearer |
Request Body
The body of the request should be serialized JSON that validates against the Data Table Row Insert schema. For example, the following would be a valid body for this request:
{
"myColumn1": "myValue"
}
Curl Example
curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
-d '{"myColumn1":"myValue"}' \
https://api.losant.com/applications/APPLICATION_ID/data-tables/DATA_TABLE_ID/rows
Successful Responses
Code | Type | Description |
---|---|---|
201 | Data Table Row Insert Result | Successfully created data table row, or bulk insert count |
Error Responses
Code | Type | Description |
---|---|---|
400 | Error | Error if malformed request |
404 | Error | Error if data table was not found |
Query
Queries for rows from a data table
Method And Url
POST https://api.losant.com/applications/APPLICATION_ID
/data-tables/DATA_TABLE_ID
/rows/query
Authentication
A valid API access token is required to access this endpoint. The token must
include at least one of the following scopes:
all.Application
, all.Application.read
, all.Organization
, all.Organization.read
, all.User
, all.User.read
, dataTableRows.*
, or dataTableRows.query
.
Request Path Components
Path Component | Description | Example |
---|---|---|
APPLICATION_ID | ID associated with the application | 575ec8687ae143cd83dc4a97 |
DATA_TABLE_ID | ID associated with the data table | 575ed78e7ae143cd83dc4aab |
Request Query Parameters
Name | Required | Description | Default | Example |
---|---|---|---|---|
sortColumn | N | Column to sort the rows by | sortColumn=myColumnName | |
sortDirection | N | Direction to sort the rows by. Accepted values are: asc, desc | asc | sortDirection=asc |
limit | N | How many rows to return | 1000 | limit=0 |
offset | N | How many rows to skip | 0 | offset=0 |
includeFields | N | Comma-separated list of fields to include in resulting rows. When not provided, returns all fields. | includeFields=id,createdAt |
Request Headers
Name | Required | Description | Default |
---|---|---|---|
Authorization | Y | The token for authenticating the request, prepended with Bearer |
Request Body
The body of the request should be serialized JSON that validates against the Advanced Query schema. For example, the following would be a valid body for this request:
{
"$or": [
{
"level": {
"$ne": "myValue"
}
},
{
"level": 5
}
]
}
Curl Example
curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
https://api.losant.com/applications/APPLICATION_ID/data-tables/DATA_TABLE_ID/rows/query
Successful Responses
Code | Type | Description |
---|---|---|
200 | Data Table Rows | Collection of data table rows |
Error Responses
Code | Type | Description |
---|---|---|
400 | Error | Error if malformed request |
404 | Error | Error if data table was not found |
Truncate
Delete all data in the data table
Method And Url
POST https://api.losant.com/applications/APPLICATION_ID
/data-tables/DATA_TABLE_ID
/rows/truncate
Authentication
A valid API access token is required to access this endpoint. The token must
include at least one of the following scopes:
all.Application
, all.Organization
, all.User
, dataTableRows.*
, or dataTableRows.truncate
.
Request Path Components
Path Component | Description | Example |
---|---|---|
APPLICATION_ID | ID associated with the application | 575ec8687ae143cd83dc4a97 |
DATA_TABLE_ID | ID associated with the data table | 575ed78e7ae143cd83dc4aab |
Request Headers
Name | Required | Description | Default |
---|---|---|---|
Authorization | Y | The token for authenticating the request, prepended with Bearer |
Curl Example
curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
https://api.losant.com/applications/APPLICATION_ID/data-tables/DATA_TABLE_ID/rows/truncate
Successful Responses
Code | Type | Description |
---|---|---|
200 | Success | If request successfully deleted all rows in the data table, this will not send workflow data table deletion triggers |
Error Responses
Code | Type | Description |
---|---|---|
400 | Error | Error if malformed request |
404 | Error | Error if data table was not found |
Schemas
Advanced Query
Schema for advanced filters and queries
Advanced Query Schema
- ▶{} 5 keys
- "http://json-schema.org/draft-07/schema#"
- "object"
- ▶{} 3 keys
- ▶{} 3 keys
- ▶{} 3 keys
- ▶{} 3 keys
- ▶{} 1 key
- false
Advanced Query Example
- ▶{} 1 key
- ▶[] 2 items
Data Table Row Insert
Schema for inserting a data table row or rows
Data Table Row Insert Schema
- ▶{} 2 keys
- "http://json-schema.org/draft-07/schema#"
- ▶[] 2 items
Data Table Row Insert Example
- ▶{} 1 key
- "myValue"
Data Table Row Insert Result
Schema for a the result of a single or multiple row insert
Data Table Row Insert Result Schema
- ▶{} 2 keys
- "http://json-schema.org/draft-07/schema#"
- ▶[] 2 items
Data Table Row Insert Result Example
- ▶{} 5 keys
- "596fbb703fc088453872e609"
- "2016-06-13T04:00:00.000Z"
- "2016-06-13T04:00:00.000Z"
- "myValue"
- 5
Data Table Rows
Schema for a collection of Data Table Rows
Data Table Rows Schema
- ▶{} 3 keys
- "http://json-schema.org/draft-07/schema#"
- "object"
- ▶{} 10 keys
- ▶{} 2 keys
- ▶{} 1 key
- ▶{} 1 key
- ▶{} 1 key
- ▶{} 1 key
- ▶{} 1 key
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 1 key
Data Table Rows Example
- ▶{} 9 keys
- ▶[] 1 item
- 1
- 4
- 0
- 1
- "myColumn1"
- "asc"
- "596e6ce831761df4231708f1"
- "575ec8687ae143cd83dc4a97"
Data Table Rows Delete
Schema for response to data table rows removal
Data Table Rows Delete Schema
- ▶{} 3 keys
- "http://json-schema.org/draft-07/schema#"
- "object"
- ▶{} 1 key
- ▶{} 1 key
Data Table Rows Delete Example
- ▶{} 1 key
- 100
Data Table Rows Export
Schema for the body of a data table export
Data Table Rows Export Schema
- ▶{} 4 keys
- "http://json-schema.org/draft-07/schema#"
- "object"
- ▶{} 4 keys
- ▶{} 3 keys
- ▶{} 6 keys
- ▶{} 3 keys
- ▶{} 2 keys
- false
Data Table Rows Export Example
- ▶{} 3 keys
- "email@example.com"
- ▶{} 1 key
- ▶{} 1 key
Error
Schema for errors returned by the API
Error Schema
- ▶{} 3 keys
- "http://json-schema.org/draft-07/schema#"
- "object"
- ▶{} 2 keys
- ▶{} 1 key
- ▶{} 1 key
Error Example
- ▶{} 2 keys
- "NotFound"
- "Application was not found"
Job Enqueued API Result
Schema for the result of a job being queued
Job Enqueued API Result Schema
- ▶{} 3 keys
- "http://json-schema.org/draft-07/schema#"
- "object"
- ▶{} 3 keys
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 2 keys
Job Enqueued API Result Example
- ▶{} 3 keys
- true
- "clnHvJbyVkOWAZwYAwLP4"
- true
Success
Schema for reporting a successful operation
Success Schema
- ▶{} 3 keys
- "http://json-schema.org/draft-07/schema#"
- "object"
- ▶{} 1 key
- ▶{} 2 keys
Success Example
- ▶{} 1 key
- true
Was this page helpful?
Still looking for help? You can also search the Losant Forums or submit your question there.