Trackunit API

<back to all web services

UpdateUnit

The following routes are available for this service:
PUT/unit
PUT/unit/{Id}
GET POST/UpdateUnit
GET POST/UpdateUnit/{Id}
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UpdateUnitResponse:
    response_status: Optional[ResponseStatus] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UpdateUnit:
    id: Optional[str] = None
    name: Optional[str] = None
    reference_number: Optional[str] = None
    client_id: Optional[str] = None
    category_id: Optional[str] = None
    vehicle_type: Optional[str] = None
    pre_km: Optional[float] = None
    pre_run1: Optional[float] = None
    pre_run2: Optional[float] = None
    note: Optional[str] = None
    is_active: Optional[bool] = None
    input1_name: Optional[str] = None
    input2_name: Optional[str] = None
    input3_name: Optional[str] = None
    input4_name: Optional[str] = None
    lock: Optional[bool] = None

Python UpdateUnit DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /UpdateUnit HTTP/1.1 
Host: api.trackunit.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"id":"String","name":"String","referenceNumber":"String","clientId":"String","categoryId":"String","vehicleType":"String","preKm":0,"preRun1":0,"preRun2":0,"note":"String","isActive":false,"input1Name":"String","input2Name":"String","input3Name":"String","input4Name":"String","lock":false}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}