Pull API: Overdue Violations

The OPS-COM Controller provides a simple JSON based API to integrate with.

Clients use this API to export a list of the currently overdue violations, which are then marked as having been sent to collections.


Make sure you set the HTTP Content-Type header to be application/json.


Information

When accessed, this API will send all overdue violations that have not been sent to collections yet in a JSON object. It will also mark them as having been sent to collections, so subsequent calls to the API will not get the same information more than once.

This is a POST request. Data is being posted to the server.

POST /api/{client}/v1/violations/send_overdue_to_collections


Sample Request - All Params

/api/OC_TOMA/v1/violations/send_overdue_to_collections


Making API Requests

Raw Request

POST /api/OC_TOMA/v1/violations/send_overdue_to_collections HTTP/1.1
Host: controller.operationscommander.io
Accept: application/json
Content-Type: application/json
Cache-Control: no-cache

{
	"apiToken": "YOUR-API-TOKEN",
}

JavaScript Request

var request = new XMLHttpRequest();

request.open('POST', 'https://controller.operationscommander.io/api/OC_TOMA/v1/violations/send_overdue_to_collections');

request.setRequestHeader('Content-Type', 'application/json');
request.setRequestHeader('Accept', 'application/json');

request.onreadystatechange = function () {
  if (this.readyState === 4) {
    console.log('Status:', this.status);
    console.log('Headers:', this.getAllResponseHeaders());
    console.log('Body:', this.responseText);
  }
};


var body = {
	"apiToken": "YOUR-API-TOKEN"
}
request.send(JSON.stringify(body));

Request Object Attributes

AttributeTypeLimitsPossible NamesDescription
apiTokenString

50-character alphanumeric including dashes.

apiToken(Required) Your supplied API Token.



Successful Response

The response will be a JSON object.

Content-Type: application/json

{
  "records": [
    {
      "ViolationID": 9,
      "SemPermitID": 0,
      "Ticket": "1-100013",
      "VehicleID": 8,
      "Spoiled": 0,
      "TicketType": 2,
      "Issued": "2016-05-03T20:00:00.000000Z",
      "convNotice": null,
      "Due": "2016-05-23T20:00:00.000000Z",
      "ViolationTypeID": -1,
      "Fine": 50,
      "AdjustedFine": 0,
      "Towing": 0,
      "taxAmount": "0.0000",
      "Writer": 8,
      "LocationID": 6,
      "Comment": null,
      "TicketAppeal": null,
      "appealType": 0,
      "appealFormat": null,
      "AccessAdminID": 7,
      "ActionedPer": null,
      "Created": "2020-10-15T20:13:24.000000Z",
      "AppealUserID": 0,
      "AppealProcessDate": null,
      "AppealAdminID": 0,
      "AppealComment": null,
      "AppealAdminComment": null,
      "AutoNotice": 2,
      "ProcessedByCollection": null,
      "SentToCollections": null,
      "PrivateComments": null,
      "DriveAway": 0,
      "UUID": "d9a1c8bb-4ed1-411e-91b1-0b63ba52e04d",
      "VioNotice": null,
      "latitude": null,
      "longitude": null,
      "Warning": null,
      "userid": null,
      "incidentID": null,
      "failToIdentify": null,
      "pin": null,
      "duplicate": null,
      "AdjustmentReason": null,
      "user": null,
      "vehicle": {
        "VehicleID": 8,
        "Active": 1,
        "lastUpdate": "2020-10-15T20:13:03.000000Z",
        "Plate": "AJNR123",
        "PlateTypeID": 4,
        "ProvID": 9,
        "MakeID": 13,
        "TypeID": 5,
        "ColourID": 14,
        "Year": 2006,
        "TotalVio": 0,
        "TotalUnpaid": 0,
        "TotalWarning": 0,
        "created": "2020-10-15T20:13:03.000000Z",
        "externallookupdate": null,
        "externallookupRequestID": null,
        "modified": "2022-03-16T21:36:09.000000Z",
        "vehicleAlert": null,
        "vin": null,
        "drivers": [
          {
            "UserID": 73,
            "enabled": null,
            "salutation": "Dr.",
            "firstName": "stephen_14Oct_1114",
            "middleName": null,
            "lastName": "stephen_14Oct_1114",
            "username": "stephen_14Oct_1114",
            "email": "stephen_14Oct_1114@test",
            "street": "1234 Main Street",
            "city": "Ottawa",
            "prov": 9,
            "postal": "H0H0H0",
            "street2": null,
            "city2": null,
            "prov2": null,
            "postal2": null,
            "phonecell": "6135551212",
            "status": 1,
            "UserTypeID": 7,
            "employNo": "staff12341115",
            "deptNameID": null,
            "ePhone": null,
            "staffFacultyFlag": 0,
            "studentNo": null,
            "sPhone": null,
            "sPhone2": null,
            "lastUpdated": "2022-08-29T21:31:12.000000Z",
            "created": "2020-10-15T20:12:57.000000Z",
            "privateComment": null,
            "publicComment": null,
            "DLNum": "DL 123451114",
            "DOB": "2020-10-14T04:00:00.000000Z",
            "StaffMailPermit": 0,
            "ExtendedID": null,
            "UserUUID": "42c5d253-2f06-4ab6-9090-969333c25da6",
            "CampusBox": null,
            "newEmail": null,
            "ReadOnlyUserID": null,
            "studentNo_int": null,
            "employNo_int": null,
            "StuCampusLocation": null,
            "EmpCampusLocation": null,
            "MailPermitTo": "Permanent Mailing Address",
            "isCloudAccount": null,
            "lastSelfUpdated": null,
            "emailConsent": null,
            "T2P_reminders": null,
            "reminderTime": null,
            "lockerUserTypeID": null,
            "encid": "A063AA9AC458DA5581FC777ADC9875FF",
            "preferredname": null,
            "plateAlert": 0,
            "peopleAlert": 0,
            "salt": "85cf3dbb-54de-48e3-a2d1-0b312dd4cea8",
            "forcePasswordChange": 1,
            "lastpasswordchange": null,
            "DLprov": 66,
            "loginSource": "OPSCOM",
            "company_id": null,
            "taxexemption": null,
            "company_manager": null,
            "receives_invoice": null,
            "account_number": null,
            "company_bill_recipient": null,
            "kais_employer": null,
            "kais_building": null,
            "kais_supervisor_name": null,
            "kais_supervisor_title": null,
            "register_token": null,
            "api_token": null,
            "modified": "2022-08-29T21:36:24.000000Z",
            "bambora_customer_code": null,
            "language": "fr",
            "preferred_communication_method": null,
            "laravel_through_key": 8
          }
        ],
        "make": {
          "MakeID": 13,
          "MakeName": "Chevrolet",
          "modified": "2020-10-15T20:13:11.000000Z"
        },
        "colour": {
          "ColourID": 14,
          "ColourName": "Red",
          "ColourKey": null,
          "modified": "2020-10-15T20:13:08.000000Z"
        },
        "vehicle_type": {
          "TypeID": 5,
          "TypeName": "Compact",
          "modified": "2020-10-15T20:13:13.000000Z"
        },
        "plate_type": {
          "TypeID": 4,
          "TypeName": "Passenger",
          "modified": "2022-04-15T20:58:56.000000Z",
          "typeCode": "passenger"
        },
        "province": {
          "ProvID": 9,
          "ProvName": "Ontario",
          "Country": 1,
          "ProvCode": "ON",
          "modified": "2022-08-30T21:54:10.000000Z",
          "payments": 1
        }
      },
      "location": {
        "LocationID": 6,
        "LocationName": "Downtown Business District",
        "WriterVisible": 1,
        "GisNo": 0,
        "modified": "2020-10-15T20:04:19.000000Z"
      },
      "details": [
        {
          "ViolationsDetailID": 10,
          "ViolationID": 9,
          "Ticket": "1-100013",
          "ViolationTypeID": 9,
          "LocationID": 6,
          "offenceFine": 50,
          "discountFlag": 1,
          "discountAmount": 10,
          "discountHours": 168,
          "created": "2020-10-15T20:13:33.000000Z",
          "type": {
            "ViolationTypeID": 9,
            "ViolationDescr": "Parked in Loading Zone",
            "DefaultCost": 50,
            "created": "2020-10-15T20:13:41.000000Z",
            "discountFlag": true,
            "discountAmount": 10,
            "discountHours": 168,
            "adminOnly": false,
            "violationkey": null,
            "modified": "2020-10-15T20:13:41.000000Z",
            "category_id": 1,
            "adjustable": false,
            "bylawcode": "BL-78"
          }
        }
      ],
      "attachments": [
        {
          "attachID": 1,
          "storageLocation": "oc_tomahawk/VIOLATIONS/2022/08/23/index-debf76b6.png",
          "attachName": "index-debf76b6",
          "attachExt": "png",
          "attachMime": "image/png",
          "relatedType": "VIOLATIONS",
          "relatedID": 9,
          "relatedNote": "1-100013",
          "created": "2022-08-23T18:48:36.000000Z",
          "archived": null,
          "uniqueid": "70756a09-550e-433d-b6f4-75b0bfdcef60"
        },
        {
          "attachID": 2,
          "storageLocation": "oc_tomahawk/VIOLATIONS/2022/08/23/index-b11529e8.png",
          "attachName": "index-b11529e8",
          "attachExt": "png",
          "attachMime": "image/png",
          "relatedType": "VIOLATIONS",
          "relatedID": 9,
          "relatedNote": "1-100013",
          "created": "2022-08-23T20:55:23.000000Z",
          "archived": null,
          "uniqueid": "079541cf-302e-4c42-a2cf-38665643d364"
        }
      ],
      "category": {
        "TicketTypeID": 2,
        "TicketTypeName": "Municipal",
        "HandHeldVisible": 0,
        "modified": "2020-10-15T20:12:51.000000Z",
        "archived": null,
        "appliesTo": 1,
        "enableFailToIdentify": 0
      }
    }
  ],
  "state": {
    "version": "2022.5.hawksbill.0-rc",
    "csrf_token": "xSc9UppEG8iMXFu606Z6sfemODRyHuoyvKYT0vs6"
  }
}