Blocks
List Blocks
Section titled “List Blocks”Retrieves a paginated list of blocks for one or more operations.
Endpoint: GET /blocks
Authentication: Required (API Key)
Query Parameters
Section titled “Query Parameters”| 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. |
Response Format
Section titled “Response Format”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" }}Response Fields
Section titled “Response Fields”- 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
Example Requests
Section titled “Example Requests”List blocks for a single operation:
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):
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):
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"Example Response
Section titled “Example Response”{ "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 }}Error Responses
Section titled “Error Responses”| 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.