Skip to content

Instantly share code, notes, and snippets.

@sommestad
Forked from potmo/test.md
Last active October 7, 2015 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sommestad/e38c1acf2aed495edf2d to your computer and use it in GitHub Desktop.
Save sommestad/e38c1acf2aed495edf2d to your computer and use it in GitHub Desktop.
A basic test for client developers.

Vehicle Attributes App

User story

As an American user, I can see the attributes of my vehicle in my mobile app.

Notes

  • Create a single-view iOS or Android app.
  • Consider this feature to be the first of many to come in the same app. This is the start of a brand new, long-living and successful product.
  • Choose your own design with your own ambition level
  • Vehicle attribute data can be fetched from the URL listed in the API spec.
  • If time would get limited, reduce the number of displayed vehicle attributes

Best of luck. 👋

API

For sake of simplicity, the vehicle attributes is a raw JSON file on Github with a static URL: https://gist.githubusercontent.com/sommestad/e38c1acf2aed495edf2d/raw/cdb6dfb85101eedad60853c44266249a3f4ac5df/vehicle-attributes.json

No authentication is required.

Get attributes for vehicle: GET /v1/vehicles/:vin/vehicle_attributes

Get the vehicle attributes for a given car.

URI parameters

Parameter Description Type Required
vin The vin to find. string Yes

Response

HTTP 200 OK with the vehicle-attributes document

Parameter Description Type Restriction Required
regno Registration number string Alphanumeric, 6-7 characters Yes
vin The vin number string Yes
brand The brand of the vehicle string possible values are volvo, ford, saab, rover Yes
year The model year number Yes
gearbox_type The type of gearbox string possible values are manual, automatic Yes
fuel_types Possible fueltypes in order of importance. At least one is provided array of strings possible values are gasoline, diesel Yes
fuel Fuel information Yes
fuel.gasoline Provided if the car is a gasoline car No
fuel.gasoline.average_consumption Average consumption Yes
fuel.gasoline.average_consumption.mixed Average consumption for mixed driving number unit is liters/meter No
fuel.gasoline.average_consumption.rural Average consumption for rural driving number unit is liters/meter No
fuel.gasoline.average_consumption.urban Average consumption for urban driving number unit is liters/meter No
fuel.gasoline.tank_volume The volume of the fuel tank number unit is liters Yes
fuel.diesel Provided if the car is a diesel car No
fuel.diesel.average_consumption Average consumption Yes
fuel.diesel.average_consumption.mixed Average consumption for mixed driving number unit is liters/meter No
fuel.diesel.average_consumption.rural Average consumption for rural driving number unit is liters/meter No
fuel.diesel.average_consumption.urban Average consumption for urban driving number unit is liters/meter No
fuel.diesel.tank_volume The volume of the fuel tank number unit is liters Yes
emission Emission information Yes
emission.gasoline Provided if the car is a gasoline car No
emission.gasoline.co2 Average emissions Yes
emission.gasoline.co2.mixed Average emissions for mixed driving number unit is kilograms/meter No
emission.gasoline.co2.rural Average emissions for rural driving number unit is kilograms/meter No
emission.gasoline.co2.urban Average emissions for urban driving number unit is kilograms/meter No
emission.diesel Provided if the car is a diesel car No
emission.diesel.co2 Average emissions Yes
emission.diesel.co2.mixed Average emissions for mixed driving number unit is kilograms/meter No
emission.diesel.co2.rural Average emissions for rural driving number unit is kilograms/meter No
emission.diesel.co2.urban Average emissions for urban driving number unit is kilograms/meter No
timestamp The time of last update date iso-8601 format in UTC Yes

Example:

{
  "regno": "wur816",
  "vin": "tmbga61z852094863",
  "timestamp": "2015-05-29T12:18:31.390Z",
  "emission": {
    "gasoline": {
      "co2": {
        "mixed": 0.000175
      }
    }
  },
  "fuel": {
    "gasoline": {
      "average_consumption": {
        "urban": 0.000099,
        "rural": 0.000058,
        "mixed": 0.000073
      }
    }
  },
  "gearbox_type": "manual",
  "year": 2005,
  "brand": "volvo",
  "fuel_types": [
    "gasoline"
  ]
}
{
"regno": "abc123",
"vin": "tmagc61z852094863",
"timestamp": "2015-05-29T12:18:31.390Z",
"emission": {
"gasoline": {
"co2": {
"mixed": 0.000175
}
}
},
"fuel": {
"gasoline": {
"average_consumption": {
"urban": 0.000099,
"rural": 0.000058,
"mixed": 0.000073
}
}
},
"gearbox_type": "manual",
"year": 2005,
"brand": "volvo",
"fuel_types": [
"gasoline"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment