Get table rows

GET /hubdb/api/v1/tables/:tableId/rows

Method Details

HTTP Methods:

GET

Response Format:

json

Requires Authentication?

No

Rate Limited?

Yes

Headers

User-Agent

Products:

Marketing

Get the rows for a specific HubDB table. The results can be filtered and ordered using the options detailed below.
Required Parameters How to use Description
Hub/Portal ID portalId={Hub ID}
Used in the request URL
The Hub ID that the table belongs to.
Table Id {tableId}
Used in the request URL
The ID of the table that you're looking for.

Optional Parameters How to use Description
Limit limit={number}
Used in the request URL
The maximum number of rows to return in the response. Defaults to 1000.
Offset offset={number}
Used in the request URL
Used to page through the retults if the number of rows in the table is higher than the limit parameter.
Order By orderBy={column name}
Used in the request URL
Return the rows in the natural order of the specified column. You can reverse the sort by adding a - to the column name: orderBy=-bar. You can include this parameter multiple times to sort by multiple columns.
In addition to ordering by a column, there are three functions that can be used:
  • geo_distance(location_column_name, lattitude, longitude)
    Takes the name of a location column and coordinates, returns the rows ordered by how far away the value of the specified location column are from the provided coordinates.
  • length(column_name)
    Takes the name of a column, returns the rows ordered by the length of the column value (calculated as a string)
  • random()
    Returns the rows in random order.
These functions also support reverse ordering:
orderBy=-geo_distance(location_column,42.37,-71.07)
returns the items that are the farthest away first.

Filtering

In addition to the above parameters, you can filter the retuls by specific data. Filters are applied as query parameters, by adding the column name, followed by two underscores (_), and then the operator. For example, if you have a number column named 'bar', you can filter the results to only include rows where the 'bar' column is greater than 10 using this parameter: &bar__gt=10. Any number of filters can be included as query parameters in the request URL. All filters are ANDed together. ORing filters is not currently supported.

Operators can only be applied to specific column types. For the purposes of these filters, the built in column hs_id is a NUMBER column, the hs_created_at column is a DATETIME, and the hs_path column is a TEXT column.

Filter Name Operator Works with
Equals eq (or none) All column types
This filter is applied if no operator is used
&example_column=value
Not Equal ne All column types
Less Than lt NUMBER, BOOLEAN, DATE, DATETIME
Less Than or Equal lte NUMBER, BOOLEAN, DATE, DATETIME
Greater Than gt NUMBER, BOOLEAN, DATE, DATETIME
Greater Than or Equal gte NUMBER, BOOLEAN, DATE, DATETIME
Null is_null All column types
This filter does not require a value (&example_column__not_null=)
Not Null not_null All column types
This filter does not require a value (&example_column__not_null=)
Like like TEXT, RICHTEXT
Not Like not_like TEXT, RICHTEXT
Contains (case insensitive) icontains TEXT, RICHTEXT
Starts With startswith TEXT, RICHTEXT