Skip to main content

GET/POST /get_report_data

Retrieves individual waste-service records for a date range — one row per service event at a location. This is the primary detail endpoint. It supports optional dimension filters and opt-in keyset pagination.

Parameters

Parameters may be supplied as query-string values (GET) or as a JSON body (POST).

ParameterTypeRequiredDescription
begin_datestring (YYYY-MM-DD)YesStart of the report period.
end_datestring (YYYY-MM-DD)YesEnd of the report period. Must be on or after begin_date; the window may not exceed 366 days.
account_idintegerNoFilter to one or more child accounts.
location_idintegerNoFilter to one or more locations.
materialstringNoFilter by waste stream, e.g. Trash, Single Stream, Organics.
service_typestringNoFilter by service type, e.g. Recurring, On Call.
disposal_typestringNoFilter by disposal method, e.g. Landfill, Recycle.
page_sizeintegerNoEnables paginated responses. Default 100, maximum 1000.
cursorstringNoOpaque token for fetching the next page (see Pagination).

Any filter accepts a single value or a comma-separated list (expanded to an IN match). Unknown parameters are ignored.

Response shapes

The response shape depends on whether page_size is supplied.

Without page_size — bare array (backward compatible)

When page_size is absent, the endpoint returns a bare JSON array of records — identical to the original API behaviour. Existing integrations that pass neither page_size nor cursor receive exactly what they always received.

[
{
"parent_account_name": "Acme Healthcare Systems",
"parent_account_id": 1045,
"account_name": "Acme Surgery Center",
"account_id": 3203,
"location_name": "5621 CA089 Valley Surgical Center",
"location_id": 15424,
"service_date_details": "2024-07-15",
"material": "Trash",
"disposal_type": "Landfill",
"amount": 460.26,
"weight_in_lbs": 19052.0,
"weight_in_tons": 9.526,
"total_emission": 5.0284871952
}
]

Each object contains 28 fields — see the Response Fields reference for the complete list.

With page_size — paginated envelope

When page_size is present, records are wrapped in a data / paging envelope:

{
"data": [ /* array of records, same 28-field shape as above */ ],
"paging": {
"page_size": 100,
"returned": 100,
"has_more": true,
"next_cursor": "MjAyNC0wNy0xNXwxNTQyNHwxNDI1Njky"
}
}
paging fieldMeaning
page_sizeThe effective page size (after clamping to [1, 1000]).
returnedNumber of records in this page.
has_moretrue when another page may exist.
next_cursorToken to pass as cursor for the next page; null when has_more is false.

Filtering

Filters narrow the result set on any combination of the supported dimensions. Combine them freely; they are ANDed together.

Single value:

GET /get_report_data?begin_date=2024-07-01&end_date=2024-07-31&material=Trash&disposal_type=Landfill

Multiple values on one dimension (comma-separated, matched with IN):

GET /get_report_data?begin_date=2024-07-01&end_date=2024-07-31&material=Trash,Single%20Stream

Restrict to specific locations:

GET /get_report_data?begin_date=2024-07-01&end_date=2024-07-31&location_id=15424,15425

Filters apply in both the bare-array and paginated response shapes.

Pagination

Pagination is opt-in and uses stable keyset (cursor) paging — reliable even while new records are being written.

  1. Request the first page with a page_size:

    GET /get_report_data?begin_date=2024-07-01&end_date=2024-09-30&page_size=500
  2. Read paging.has_more. If true, request the next page by passing paging.next_cursor back as cursor (keep all other parameters identical):

    GET /get_report_data?begin_date=2024-07-01&end_date=2024-09-30&page_size=500&cursor=MjAyNC0wNy0xNXwxNTQyNHwxNDI1Njky
  3. Repeat until paging.has_more is false. At that point next_cursor is null and all records for the range have been returned.

tip

The cursor is an opaque token — do not parse or construct it yourself. Always echo back the exact next_cursor value from the previous page.

Errors

StatusCause
400Missing/invalid begin_date or end_date, end_date before begin_date, date window over 366 days, an invalid filter value, or an invalid cursor.
401Missing or invalid Ocp-Apim-Subscription-Key.
500Unexpected server error.