Enterprise api

From ISoft Wiki
Jump to: navigation, search

fill me with awesomeness

Object Web API Verb Socket API Request Response
Inventory /api/inventory/:id GET  ? Params(id)


/api/inventories GET  ? Query(search, fields, properties) Array of Inventories
Store /api/store/:storeId GET  ?  ? Store
/api/stores GET 'load stores' Array of Stores
Manufacturer /api/manufacturer/:manufacturerId GET 'load manufacturer' Params(manufacturerId) Manufacturer
/api/manufacturers GET 'search manufacturers' Query(search, properties) Array of Manufacturer
Model /api/model/:modelId GET 'load model' Params(modelId) Model
/api/models GET 'search models' Query(search, fields, properties) Array of Models
Vehicle /api/vehicle/:vehicleId GET 'load vehicle' Params(vehicleId) Vehicle
/api/vehicles GET 'search vehicles' Query(search, fields, properties) Array of Vehicles



The query object is sent to the API typically for GET calls. For the web API, the query string is part of the URL.

  • Web API: http://<host>/api/path?<query>

For the Socket API, the query object is passed to the API as a property of the request object:

const request = {query: {search: "Something to search for", dismantled: true, fields: "notes, description"}}
socket.emit("search vehicles", request, (err, result) => {// code here})
  • search - This is a special property that searches multiple fields. See object definitions.
  • fields - This property accepts a comma separated list of return fields.
  • <property> - Any object properties can be used as filters. See object definitions.
Property operators
  • Properties can be set to a value. This will create a filter and uses the equality operator to compare field and value.
  • Properties can also be set to an object describing what equality operator you want to use. The object can have multiple properties but must use these operators:
    • eq: value - Equality comparison
    • lt: value - Less than comparison
    • gt: value - Greater than operator
    • null: bool - Fields is compared using IS NULL or IS NOT NULL
    • like: value - Like operator


vehicleId={"lt": 200, "gt": 100, "null": false}

Translates to:

WHERE vehicleid < 200 and vehicleid > 100 and vehicleid IS NOT NULL


The params property is a set of non-optional values that must be sent to the API when required.

  • Web API: http://<host>/api/store/<storeid>
  • Socket:
const request = {params: {storeid: 2}}
socket.emit("load store", request, callback(err, result) {// code here})


  "id": "/Store",
  "type": "object",
  "properties": {
    "storeId": {"type": "integer", "minimum": 1},
    "name": {"type": "string", "maxLength": 50},
    "code": {"type": "string", "maxLength": 10},
    "number": {"type": ["string","null"], "maxLength": 10}
  "required": ["storeId", "name", "code"]


  "id": "/Manufacturer",
  "type": "object",
  "properties": {
    "manufacturerId": {"type": "integer", "minimum": 1},
    "name": {"type": "string", "maxLength": 50},
    "code": {"type": "string", "maxLength": 10},
    "originalManufacturer": {"type": "boolean"},
    "glCategoryId": {"type": ["integer","null"]},
    "partsListAuthorityId": {"type": ["integer","null"]}
  "required": ["manufacturerId", "name", "code"]


  "id": "/Vehicle",
  "type": "object",
  "properties": {
    "vehicleId": {"type": "integer", "minimum": 1},
    "stockNumber": {"type": "string"},
    "make": {"type": "string"},
    "model": {"type": "string"},
    "year": {"type": "integer", "minimum": 0},
    "vehicleCost": {"type": "number"},
    "vehicleCostAllocated": {"type": "number"},
    "description": {"type": "string"},
    "notes": {"type": "string"}
  "required": ["vehicleId", "stockNumber"],
  "groups": {
    "basic": ["year", "make", "model"]

Search "emitToServer" (56 hits in 10 files)
C:\Users\Dev\Desktop\ProWeb\client\states\vehicle\attachment\attachment-detail\attachment-detail.js (1 hit)
	'load file', fileId

C:\Users\Dev\Desktop\ProWeb\client\states\vehicle\attachment\attachment.js (5 hits)
	'load vehicle file list', { vehicleId: parameters.vehicleId }
	'insert vehicle file', { fileId: file.fileId, vehicleId, rank: file.rank }
	'delete vehicle file', { vehicleId, fileId: fileIds }
	'set vehicle file public', { vehicleId, fileIds: files.fileIds, toPublic: files.toPublic }
	'set top ranked vehicle file', { vehicleId, fileId }
C:\Users\Dev\Desktop\ProWeb\client\states\vehicle\basic\basic.js (11 hits)
	'save vehicle', state.vehicle
	'find fuzzy make model match', { make: state.decodedVinObject.Make, model: state.decodedVinObject.Model }
	'find fuzzy make model match', { make: state.decodedVinObject.Make }
	'add make model', { make: action.payload.make, model: action.payload.model }
	'decode vin', state.vehicle.vin
	'load vehicle makes'
	'load statuses', 'Vehicle'
	'load users', {}
	'load vehicle file list', { vehicleId: parameters.vehicleId }
	'load file', topRankedFile.fileId
	'load vehicle models', { make }
C:\Users\Dev\Desktop\ProWeb\client\states\vehicle\cost\cost.js (6 hits)
	'add vehicle cost', data
	'save vehicle cost', saveCost
	'save purchase order', purchaseOrderData
	'load vehicle costs', vehicleId
	'load vehicle cost types'
	'load vendor list'
C:\Users\Dev\Desktop\ProWeb\client\states\vehicle\history-report\history-report.js (4 hits)
	'get vehicle history report', { vin: state.reportVin, pdf: isPdfReportType }
	'load vin audit brand codes'
	'load vehicle', { vehicleId: parameters.vehicleId }
	'load vin audit report id', { vin: res.vehicle.vin }
C:\Users\Dev\Desktop\ProWeb\client\states\vehicle\info\info.js (3 hits)
	'save vehicle',
	'load vehicle title statuses'
	'load states'
C:\Users\Dev\Desktop\ProWeb\client\states\vehicle\performance\performance.js (2 hits)
	'load inventory', { vehicleId, storeId: parameters.storeId, status: [ 'A', 'H' ] }
	'load sale lines', { vehicleId }
C:\Users\Dev\Desktop\ProWeb\client\states\vehicle\qanda\qanda.js (6 hits)
	'save vehicle question', submitQuestion,
	'save vehicle answer', submitAnswer,
	'load vehicle answer',
	'load vehicle questions', state.teardownName,
	'save vehicle question', submitQuestion,
	'load teardown name', {make: v.make, model: v.model, year: v.year, }
C:\Users\Dev\Desktop\ProWeb\client\states\vehicle\teardown\teardown.js (15 hits)
	'save vehicle bid', savingBid
	'accept vehicle bid', { vehicleBidId: action.payload.vehicleBidId }
	'update cost for inventory items', state.vehicleInventory
	'load origins',
	'appraise items locally', appraisalBidParts
	'appraise items remotely', { itemsToAppraise, originCode: state.chosenAppraisalOrigin.code }
	'appraise items locally', appraisalVehicleInventory
	'appraise items remotely', { itemsToAppraise, originCode: state.chosenAppraisalOrigin.code }
	'load vehicle', { vehicleId }
	'load vehicle bids', { vehicleId }
	'load inventory', { vehicleId, storeId }
	'load teardown template', { vehicleId }
	'load total vehicle cost', vehicleId
	'load vendor list'
	'load vehicle bid parts', vehicleBidId
C:\Users\Dev\Desktop\ProWeb\client\states\vehicle\vehicle.js (3 hits)
	'load vehicle', { vehicleId: parameters.vehicleId }
	'load vehicle bids', { vehicleId: parameters.vehicleId }
	'tracking number lookup', { searchString }