Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info
iconfalse

The OPS-COM Controller provides a simple JSON based API to integrate with. Clients use this API to directly feed paid permit details vehicles into OPS-COM from other systems such as Parking Meters.  

Table of Contents



Note

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


Section
bordertrue

Making API Requests

Column
width50%

Raw Request

Code Block
languagetext
themeMidnight
POST /api/OC-_TOMA/v1/vehicles/push HTTP/1.1
Host: controller.operationscommander.comio
Accept: application/json
Content-Type: application/json
Cache-Control: no-cache

{
	"apiToken": "YOUR-API-TOKEN",
	"plate": "PL8RDR",
  	"plateType": "Motorcycle",
  	"prov": "MA",
  	"make": "8",
  	"type": "3",
  	"colour": "red",
  	"year": "2011",
  	"vin": "8GKS1AKC7FR518845"
}



Column
width50%

JavaScript Request

Code Block
languagejs
themeMidnight
var request = new XMLHttpRequest();

request.open('POST', 'https://controller.operationscommander.comio/api/OC-_TOMA/v1/permitsvehicles/push');

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",
	"Amountplate": "14.50PL8RDR",
  	"CurrencyIDplateType": "CADMotorcycle",
  	"LicencePlateprov": "PL8RDRMA",
  	"zonemake": "kia",
"Lot 4  	"type": "commercial",
  	"permitNocolour": "L4-1138red",
  	"startTimeyear": "2018-07-02T09:00:002021",
  	"endTimevin": "2018-07-02T09:30:008GKS1AKC7FR518845"
}
request.send(JSON.stringify(body));



Request Object Attributes

(Required)Must be in the format of Y-m-d\TH:i:s

e.g. 2000-05-30T14:38:22

For formatting help, see PHP Date Formatting

(Required)Must be in the format of Y-m-d\TH:i:s

e.g. 2000-05-30T14:38:22

For formatting help, see PHP Date Formatting

AttributeTypeLimitsPossible NamesDescription
apiTokenString

50-character alphanumeric including dashes.

apiToken(Required)Your supplied API Token.
AmountplateString950-character decimalalphanumeric.

amountplate

Amount


(Optional)Transaction amount This must contain at least 3 digits, two of which are penny values.

The minimum allowable value is $0.01, and the maximum allowable value is $999999.99.

CurrencyString10-characters

currency

CurrencyID

(Optional) CAD, USD

Start Date

String

20-characters

Y-m-d\TH:i:s format.

startTime

StartDateUtc

End DateString

20-characters

Y-m-d\TH:i:s format.

endTime

EndDateUtc

License PlateString25-characters

plate

LicencePlate

(Required) The plate of the vehicle.
Ticket NumberString50-characters

permitNo

TicketNumber

(Optional)
Zone NameString200-characters

zone

ParkingZoneName

(Optional) If the zone does not match a zone in our system, it will be a disconnected record and may not report properly

Required)The license plate.

plateTypeIDString

The ID of the VechiclePlateType record.

plateTypeID(One of plateTypeID or plateType is required)Your supplied VehiclePlateType identifier.
plateTypeString

50-character alphanumeric including dashes.

plateType(One of plateTypeID or plateType is required) The name of the plate type.
provIDString

The ID of the state/province.

provID(One of provID or prov is required) Your supplied state or province identifier.
provString

50-character alphanumeric including dashes

prov(One of provID or prov is required) The full name of the state/province or the corresponding postal abbreviation.
makeIDString

The ID of the vehicle make.

makeID(Optional) Your supplied vehicle make identifier.
makeString50-character alphanumeric including dashes

make

(Optional) The name of the vehicle manufacturer. 
typeIDString

The ID of the vehicle type.

typeID(Optional) Your supplied vehicle type identifier.
typeString

50-character alphanumeric including dashes

type(Optional) The name of the type of vehicle that you provided.
colourIDStringThe ID of the vehicle colour.colourID(Optional) Your supplied vehicle colour identifier.

colour

String

50-character alphanumeric including dashes

colour

(Optional) The name of a colour that you have provided..

yearString

4 digit year.

year

(Optional) The model year.

vinString25-characters

vin

(Optional) The vehicle identification number.



Successful Response

The response will be a json object. 

Content-Type: application/json

Code Block
languagejs
themeMidnight
{
    "status": "success",
    "referencevehicle_id_id": "1a9b5375-cb75-4c71-9939-eeae550b09ac158",
    "InternalReferenceIDwarnings":["The "1a9b5375-cb75-4c71-9939-eeae550b09ac"vehicle colour name was too long and has been truncated."]
}


Related Pages

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
sorttitle
cqllabel = "apis" and space = currentSpace ( )


Show if
special@authenticated


Support Agent Notes

In order for a client to use this, they would have to have paid for the right to integrate with OPS-COM, been issued an API Key and had their integration validated by testing with us.


Server setup

The Addresses used for testing and production:

https://controller.dev-dev14.parkadminoperationscommander.comio/api/OC-_TOMA/v1/permitsvehicles/push

https://controller-.preview.operationscommander.comio/api/OC-_TOMA/v1/permitsvehicles/push

https://controller.operationscommander.comio/api/OC-_TOMA/v1/permitsvehicles/push


nGinx needs to have Access-Control-Allow-Origin : * to work.

The controller also needs to be behind a certificate. 




Client Setup

There is some setup related to getting clients to use the API. First, they must have an API token that exists on the API token table. THey They then have to have a an api_permission record that lists what kind of permission the token can hashave

The permission needed for this api request is vehicle-create.