App-API
Architecture
Each end user application must have its own dedicated back-end service. This is essential because the App-API does not provide direct user authentication. Instead, the app’s back-end is responsible for:
- Authenticating the end user.
- Interfacing with the TandemDrive App-API on behalf of the authenticated user.
By separating authentication from the API, the architecture allows each app to manage user sessions while the App-API handles data and actions related to those authenticated users. The app back-end can also provide services not offered by the TD App-API.
The API automatically restricts the data returned to only what the end user is authorized to access. If the user attempts to access or modify unauthorized data, the system will return an appropriate error (bad request).
Most endpoints require the end user identifier as part of the URL path to ensure that operations are tied to the correct user.
Offset Pagination
The app API uses offset-based pagination, in contrast to the
seek-based pagination used by the admin API. Offset-based
pagination is straightforward because the client does not need to track the ID
of the last item and can navigate to any page by specifying the page number.
Page numbering starts from 1.
Page Parameter
The optional page query parameter specifies the page to retrieve.
It defaults to the first page (page=1).
Page Size Parameter
The optional page_size query parameter adjusts the number of items returned
per page, with a default of 50. Check the specifications for the maximum
allowed value of this parameter.
Example Response
The following json data is an example of an offset-based pagination response:
{
"items": [...],
"page": 1,
"page_size": 50,
"has_next_page": true
}
items: Contains the list of items returned by the request, with a maximum number of items equal topage_size.page: Shows the current page number.page_size: Shows the number of items on the current page.has_next_page: Returnstrueif there is a page after the current one with at least one item, making it useful for “Next Page” buttons in user interfaces.