Getting Data
Getting Data from a Bloc
Please note: All Bloc Data User Restrictions will apply in these requests. If you are not getting data back or cannot access the bloc, please ensure the user associated with the Auth token has access to the bloc and is not restricted.
Get Data from a Bloc (No Filters)
GET
https://example.mydomain.com/api/get-data⚠️ This endpoint expects a JSON request body even though it uses the GET method.
Request Body
| Name | Type | Description |
|---|---|---|
| blocId* | string | The ID of the bloc. This may be a UUID (e.g. a1489634-4009-4cc0-8a65-9965f5a1bea7) or numeric ID depending on your instance. |
| resultLimit | integer | Number of records to return per request. Defaults to 10 if not provided. |
| currentPage | integer | Pagination index (1-based). Used with resultLimit to retrieve subsequent pages. |
| reverse | boolean | Controls sort order:• false (default) → newest first• true → oldest first |
| fromDate | string | Filters records after this timestamp. Format: YYYY-MM-DD HH:MM:SS |
| toDate | string | Filters records before this timestamp. Format: YYYY-MM-DD HH:MM:SS |
⚠️ Date Filtering Behavior (Important)
fromDatealone → accepts full datetime (YYYY-MM-DD HH:MM:SS)toDatealone → accepts full datetime (YYYY-MM-DD HH:MM:SS)fromDate+toDatetogether:- In some cases, it must be provided as a date-only format (
YYYY-MM-DD)
- In some cases, it must be provided as a date-only format (
Response Structure
The response returns a mixed object, not a pure array.
- Numeric keys (
"0","1", etc.) → records - Additional keys provide metadata
200 Response Example
{
"data": {
"0": {
"created_at": "2026-03-19 13:42:13",
"submitted_status": 1,
"user_id": "exampleuser",
"field_1": "value",
"field_2": "value",
"cartolytics_entry_row_id": 123456
},
"1": {
"created_at": "2026-03-19 13:42:05",
"submitted_status": 1,
"user_id": "exampleuser",
"field_1": "value",
"field_2": "value",
"cartolytics_entry_row_id": 123457
},
"count": 14,
"fieldCounts": {
"field_1": {
"value": 2
}
},
"countLimitInfo": {
"scan_limit": null,
"scan_limit_time_logged": null,
"scans_counted": 14,
"limit_reached": 0
},
"fieldNames": {
"field_1": "Field 1"
}
}
}
Notes on Response
count→ total number of matching records (not just returned page)fieldCounts→ aggregated values across all matching recordscountLimitInfo→ scan tracking metadatafieldNames→ mapping of field slugs to display names
Error Responses
401 Unauthorized
{
"error": "You are not authorized to access this bloc"
}
400 Bad Request
{
"error": "Error message"
}
⚠️ Some errors may return:
{
"message": "Trailing data"
}
(Error response formats are not fully standardized.)
Example Requests
cURL
curl --request GET '{{base_url}}/api/get-data' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json' \
--data '{
"blocId": "a1489634-4009-4cc0-8a65-9965f5a1bea7",
"resultLimit": 2,
"currentPage": 1,
"reverse": false
}'
Node.js (Axios)
const axios = require('axios');
axios({
method: 'get',
url: '{{base_url}}/api/get-data',
headers: {
Authorization: 'Bearer {{token}}',
'Content-Type': 'application/json'
},
data: {
blocId: 'a1489634-4009-4cc0-8a65-9965f5a1bea7',
resultLimit: 2,
currentPage: 1,
reverse: false
}
})
.then(res => console.log(res.data))
.catch(err => console.error(err));
Python
import requests
url = "{{base_url}}/api/get-data"
payload = {
"blocId": "a1489634-4009-4cc0-8a65-9965f5a1bea7",
"resultLimit": 2,
"currentPage": 1,
"reverse": False
}
headers = {
"Authorization": "Bearer {{token}}",
"Content-Type": "application/json"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)