Architecture
Lists
Backstack provides three types of lists: record
, collection
, and select
. Each having different use cases and properties. See the specific endpoint for the type of list provided.
Record list
A searchable, filterable, and paginated list of records.
GET /account/users
Returns page one of a list with 20 (default) records nested under the list
property.
{
"success": true,
"message": "",
"payload": {
"list": [
{
"id": "usr_1234567890",
...
},
...
],
"total": 32,
"search": null,
"filter": "all",
"sort": "name",
"more": "...",
"pagination": {
...
}
}
}
Search, filter and sort
Search, filter and sort records in a list by providing the corresponding search
, filter
ans sort
parameters in the request query.
GET /account/users
?search=doe&filter=active&sort=name
Returns a sorted list of records that match the search term and filter.
{
"success": true,
"message": "",
"payload": {
"list": [
{
"id": "usr_1234567890",
"name": "Jahe Doe",
...
},
{
"id": "usr_2345678901",
"name": "John Doe",
...
}
],
"total": 2,
"search": "doe",
"filter": "active",
"sort": "name",
"more": null,
"pagination": {
...
}
}
}
Active filters and sorts are indicated by the filter
and sort
properties. See the specific endpoint for available filters and sorts.
Pagination
Paginate list responses by providing the records
and/or page
parameters in the query.
GET /account/users
?page=1&records=25
Response:
{
"success": true,
"message": "",
"payload": {
"list": [
{
"id": "usr_1234567890",
...
},
...
],
"total": 30,
"search": "",
"filter": "all",
"sort": "name",
"more": "?records=25&filter=all&sort=name&search=&page=2",
"current": "?records=25&filter=all&sort=name&search=&page=1",
"pagination": {
"pages": [
{
"label": 1,
"query": "?records=25&filter=all&sort=name&search=&page=1",
"current": true
},
...
],
"previous": null,
"next": "?records=25&filter=all&sort=name&search=&page=2"
}
}
}
The list.pagination.pages
value in the JSON response is an array of up to seven elements of page objects used for pagination. Each page object has the following properties:
label
: The page number or an ellipsis (...
) if applicable.query
: The query to request the page. The query includes the current search, filter, and sort parameters.current
: A boolean indicating if this is the current page.
The list.pagination.previous
property contains the query
to the previous page, or null
if unavailable.
The list.pagination.next
property contains the query
to the next page, or null
if unavailable.
Collection list
A complete list of records with necessary details for a specific use case. They're not nested under a list property and cannot be searched or filtered.
GET /app/optional-features
Response:
{
"success": true,
"message": "",
"payload": [
{
"id": "fea_1234567890",
"title": "Extended Reporting",
"description": "Get more information out of the standard reports.",
"more_info": "Detailed transactions|Visual graphs|Extended metrics",
"image": "<svg>...</svg>",
"fee": 1234,
"active": true
},
...
]
}
Select list
A complete list of records with the ID as the key and the title (or equivalent) as the value.
Use this list type for HTML inputs like dropdowns, radio buttons, and checkboxes. They're not nested under a list property and cannot be searched or filtered.
GET /account/users
Response:
{
"success": true,
"message": "",
"payload": {
"usr_1234567890": "John Doe",
...
}
}
Extended select list
Selections may also include additional data for more complex input elements.
GET /app/domains
Response:
{
"success": true,
"message": "",
"payload": [
{
"dom_1234567890": {
"title": "Government Agency",
"description": "Government agency account type",
"signup_help": "Select this account type..."
}
},
...
]
}