Skip to main content

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.Application.bounded, all.Organization, all.Organization.bounded, all.User, all.User.bounded, dataTableRows.*, or dataTableRows.delete.

Request Path Components​

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97
DATA_TABLE_IDID associated with the data table575ed78e7ae143cd83dc4aab

Request Query Parameters​

NameRequiredDescriptionDefaultExample
limitNLimit number of rows to delete from data table1000limit=10

Request Headers​

NameRequiredDescriptionDefault
AuthorizationYThe 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​

CodeTypeDescription
200Data Table Rows DeleteIf request successfully deletes a set of Data Table rows

Error Responses​

CodeTypeDescription
400ErrorError if malformed request
404ErrorError 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.bounded, all.Application.read, all.Organization, all.Organization.bounded, all.Organization.read, all.User, all.User.bounded, all.User.read, dataTableRows.*, or dataTableRows.export.

Request Path Components​

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97
DATA_TABLE_IDID associated with the data table575ed78e7ae143cd83dc4aab

Request Headers​

NameRequiredDescriptionDefault
AuthorizationYThe 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​

CodeTypeDescription
202Job Enqueued API ResultIf request was successfully queued

Error Responses​

CodeTypeDescription
400ErrorError if malformed request
404ErrorError 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.bounded, all.Application.cli, all.Application.read, all.Organization, all.Organization.bounded, all.Organization.read, all.User, all.User.bounded, all.User.cli, all.User.read, dataTableRows.*, or dataTableRows.get.

Request Path Components​

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97
DATA_TABLE_IDID associated with the data table575ed78e7ae143cd83dc4aab

Request Query Parameters​

NameRequiredDescriptionDefaultExample
sortColumnNColumn to sort the rows bysortColumn=myColumnName
sortDirectionNDirection to sort the rows by. Accepted values are: asc, descascsortDirection=asc
limitNHow many rows to return1000limit=0
offsetNHow many rows to skip0offset=0
includeFieldsNComma-separated list of fields to include in resulting rows. When not provided, returns all fields.includeFields=id,createdAt

Request Headers​

NameRequiredDescriptionDefault
AuthorizationYThe 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​

CodeTypeDescription
200Data Table RowsCollection of data table rows

Error Responses​

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if data table was not found

Post​

Creates new row(s) in 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.Application.bounded, all.Organization, all.Organization.bounded, all.User, all.User.bounded, dataTableRows.*, or dataTableRows.post.

Request Path Components​

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97
DATA_TABLE_IDID associated with the data table575ed78e7ae143cd83dc4aab

Request Headers​

NameRequiredDescriptionDefault
AuthorizationYThe 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 Post 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​

CodeTypeDescription
201Data Table Row Post ResultSuccessfully created data table row, or bulk creation information

Error Responses​

CodeTypeDescription
400ErrorError if malformed request
404ErrorError 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.bounded, all.Application.read, all.Organization, all.Organization.bounded, all.Organization.read, all.User, all.User.bounded, all.User.read, dataTableRows.*, or dataTableRows.query.

Request Path Components​

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97
DATA_TABLE_IDID associated with the data table575ed78e7ae143cd83dc4aab

Request Query Parameters​

NameRequiredDescriptionDefaultExample
sortColumnNColumn to sort the rows bysortColumn=myColumnName
sortDirectionNDirection to sort the rows by. Accepted values are: asc, descascsortDirection=asc
limitNHow many rows to return1000limit=0
offsetNHow many rows to skip0offset=0
includeFieldsNComma-separated list of fields to include in resulting rows. When not provided, returns all fields.includeFields=id,createdAt

Request Headers​

NameRequiredDescriptionDefault
AuthorizationYThe 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​

CodeTypeDescription
200Data Table RowsCollection of data table rows

Error Responses​

CodeTypeDescription
400ErrorError if malformed request
404ErrorError 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.Application.bounded, all.Organization, all.Organization.bounded, all.User, all.User.bounded, dataTableRows.*, or dataTableRows.truncate.

Request Path Components​

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97
DATA_TABLE_IDID associated with the data table575ed78e7ae143cd83dc4aab

Request Headers​

NameRequiredDescriptionDefault
AuthorizationYThe 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​

CodeTypeDescription
200SuccessIf request successfully deleted all rows in the data table, this will not send workflow data table deletion triggers

Error Responses​

CodeTypeDescription
400ErrorError if malformed request
404ErrorError 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 Post​

            Schema for the body of request to create one or more data table rows

            Data Table Row Post Schema​

            • ▶
              {} 2 keys
              • "http://json-schema.org/draft-07/schema#"
              • ▶
                [] 2 items

              Data Table Row Post Example​

              • ▶
                {} 1 key
                • "myValue"

              Data Table Row Post Result​

              Schema for the result of a data table row creation request

              Data Table Row Post Result Schema​

              • ▶
                {} 2 keys
                • "http://json-schema.org/draft-07/schema#"
                • ▶
                  [] 2 items

                Data Table Row Post 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"
                                                      • ▶
                                                        {} 3 keys
                                                        • ▶
                                                          {} 1 key
                                                          • ▶
                                                            {} 1 key
                                                            • ▶
                                                              {} 2 keys

                                                          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.