Events/get_campaign_events

get_campaign_eventstoken required

Returns the caller's campaign-membership events over a time window, newest first: every event one of the caller's own vehicles raised into a campaign. Any client can use it.

POST/api— body field action.name = "get_campaign_events"

Parameters

NameTypeRequiredDescription
from_datetimedateoptionalWindow start. Accepts `YYYY-MM-DD`, `YYYY-MM-DD HH:MM:SS`, or ISO with an offset (`2026-08-01T00:00:00+03:00`). A value carrying no zone is read as UTC, NOT the caller's local time, so a control room on Israeli time should send the offset explicitly. A non-existent date such as 2026-02-30 is rejected with action_value '1'. Omitted, the window starts 24 hours before `to_datetime`, so with both omitted it is the last 24 hours.e.g. 2026-08-01 00:00:00
to_datetimedateoptionalWindow end, same forms as `from_datetime`. A BARE DATE is that day's UTC midnight, not its end: `to_datetime=2026-08-31` stops BEFORE 31 August's alerts, and the same date in both fields is a zero-width window that returns nothing. To cover a whole day, end it at `23:59:59`. Omitted, it is the current time. The window may not exceed 31 days (action_value '3'). When both are given, `from_datetime` may not be later than `to_datetime` (action_value '2'); a future `from_datetime` with `to_datetime` omitted is not an error and returns no events.e.g. 2026-08-31 23:59:59
campaign_idstringoptionalComma-separated positive integers narrowing to specific campaigns. Supplied but blank, or any non-positive / non-integer part, is rejected with action_value '1'. Omitted means every campaign the caller's vehicles raised events into. Campaign ids are not part of this action's response, which carries the campaign name only.e.g. 1024,1108
license_numberstringoptionalNarrow to a single licence plate. Exact match against the plate as stored, which is the `license_number` this action returns once URL-decoded. A differently formatted plate, for example with added dashes or spaces, matches nothing and returns an empty success.e.g. 12345678
language_codenumberoptionalTranslation language for `description`. Must be a positive integer. Defaults to 7002 (Hebrew), the language the legacy procedure hard-codes; an unknown code falls the description back to the untranslated text.e.g. 7002
offset_pagenumberoptional1-based page index. Must be supplied together with `show_in_page`, both as whole numbers, or the pair is rejected with action_value '1'. 0 is read as 1.e.g. 1
show_in_pagenumberoptionalPage size. Defaults to 500 when paging is omitted. Larger values are reduced to 5000, and 0 is read as 1. Must be supplied together with `offset_page`.e.g. 500

Notes

Every row is an event one of the caller's vehicles raised into a campaign. Rows are limited to the vehicles the caller's session or API key may see. `starttime` is the event's own time as epoch SECONDS (no milliseconds), given as a string, with the campaign's copy as a fallback. `campaign`, `event`, `description` and `license_number` are URL-encoded like every other string field; `description` is the translated text (Hebrew by default), falling back to the untranslated event text when no dictionary entry exists. Alongside `data` the response carries a `pagination` envelope: `page`, `page_size`, `total_count`, `total_pages` and `has_more` — iterate while `has_more === true`. Send the same `from_datetime` and `to_datetime` on every page: with `to_datetime` omitted the window ends at the time of each call, so events arriving between calls push rows onto later pages and some come back twice. This action uses `offset_page` / `show_in_page` rather than the shared `page_number` / `page_size` contract. Action values: '0' success (an empty `data` list means no events in the window), '1' a malformed parameter (dates, campaign_id, language_code, or the paging pair), '2' from_datetime later than to_datetime, '3' the window exceeds 31 days, '999' general error (the description holds the reason).

Request

curl
curl -X POST 'https://private.develop-1.questar.io/v2/private-questar-units/api' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  --data '{"action":{"name":"get_campaign_events","parameters":[{"from_datetime":"2026-08-01 00:00:00","to_datetime":"2026-08-31 23:59:59","campaign_id":"1024,1108","license_number":"12345678","language_code":7002,"offset_page":1,"show_in_page":500}]}}'
Body
{
  "action": {
    "name": "get_campaign_events",
    "parameters": [
      {
        "from_datetime": "2026-08-01 00:00:00",
        "to_datetime": "2026-08-31 23:59:59",
        "campaign_id": "1024,1108",
        "license_number": "12345678",
        "language_code": 7002,
        "offset_page": 1,
        "show_in_page": 500
      }
    ]
  }
}

Response

Successful responses always wrap the action's payload in response.properties. The action_value field reports the handler outcome: "0" for success, "1" for invalid params, "2" for not allowed, "3" for limit-exceeded /pagination-session-expired, "999" for general error.

Authentication is checked before the action runs and fails the same way for every action. A token that is not valid returns HTTP 200 with action_value "2" and description invalid_session; an empty bearer returns "2" with session_token_required. Read the description to tell these apart from an action's own "2". With no Authorization header the gateway answers HTTP 401 {"message":"Unauthorized"}, and with a bearer that is not a token HTTP 403 {"message":"Forbidden"}.

200 OK
{
  "response": {
    "properties": {
      "action_name": "get_campaign_events",
      "action_value": "0",
      "description": "success",
      "data": [
        {
          "campaign": "Campaign%20Name",
          "event": "Harsh%20Braking",
          "description": "Speeding%20Alert",
          "starttime": "1723968135",
          "license_number": "12345678"
        }
      ]
    }
  }
}