Skip to content

Blocks

Retrieves a paginated list of blocks for one or more operations.

Endpoint: GET /blocks

Authentication: Required (API Key)

Parameter Type Required Description
operation_id integer[] Yes Filter blocks by one or more operation IDs. At least one is required.
_page integer No Page number (positive integer, defaults to 1)
_pageSize integer No Number of items per page (positive integer, max varies by configuration)
_sortBy string No Sort order. Format: +field for ascending or -field for descending.

Returns a paginated response with the following structure:

{
"data": [
{
"id": "integer",
"operation_id": "integer",
"polygon_id": "integer | null",
"name": "string | null",
"geo_boundaries": "GeoJSON Polygon geometry object"
}
],
"pagination": {
"page": "integer",
"pageSize": "integer",
"rowCount": "integer",
"pageCount": "integer"
}
}
  • id: Integer ID of the block
  • operation_id: Integer ID of the parent operation
  • polygon_id: Sequential number of the block within the operation (e.g., 1, 2, 3), or null if not set
  • name: Name of the block (e.g., “Block 0”), or null if not set
  • geo_boundaries: GeoJSON Polygon geometry object representing the block’s boundaries

List blocks for a single operation:

Terminal window
curl -X GET "https://api.sitemark.com/blocks?operation_id=123&_page=1&_pageSize=25" \
-H "Authorization: ApiKey your-api-key-here"

List blocks for multiple operations (without brackets):

Terminal window
curl -X GET "https://api.sitemark.com/blocks?operation_id=123&operation_id=456&_page=1&_pageSize=25" \
-H "Authorization: ApiKey your-api-key-here"

List blocks for multiple operations (with brackets):

Terminal window
curl -X GET "https://api.sitemark.com/blocks?operation_id[]=123&operation_id[]=456&_page=1&_pageSize=25" \
-H "Authorization: ApiKey your-api-key-here"
{
"data": [
{
"id": 1,
"operation_id": 123,
"polygon_id": 1,
"name": "Block 0",
"geo_boundaries": {
"type": "Polygon",
"coordinates": [
[
[4.35, 50.85],
[4.36, 50.85],
[4.36, 50.86],
[4.35, 50.86],
[4.35, 50.85]
]
]
}
}
],
"pagination": {
"page": 1,
"pageSize": 25,
"rowCount": 1,
"pageCount": 1
}
}
Status Code Description
401 Unauthorized - Invalid or missing API key
400 Bad Request - Missing or invalid operation_id filter
500 Internal Server Error

Note: The operation_id filter is required. You will receive a 400 error if it is not provided.