CaRPM API Reference for GaragePro App NAV Navbar
Logo
shell

Introduction

Welcome to the CaRPM API reference! You can use our API reference to access CaRPM API endpoints, which can get information about the inspection done by your mechanic.

The CaRPM API is organized around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. JSON is returned by all API responses, including errors.

We have language bindings in Shell. You can view code examples in the dark area to the right.

Get Report Identifiers

  curl -i -H "Accept: application/json" 
          -H "Content-type: application/json" 
          -H "X-User-Email: lovishiit@gmail.com"
          -H  "X-User-Token: wbUFL7RLNqhWpeK_BGpD" 
          -X GET http://carpm.in/user_car_models/get_reports\
              ?from_date\='2016-12-12'\&to_date\='2016-12-20'

The above command returns JSON structured like this:

{
  "license_plates": 
  [
    { 
      "user_car_model_id": 18793,
      "license_plate": "DL1CAB1234",
      "mechanic_email": "my_mechanic_1@example.com",
      "created_at": "2017-01-20T16:26:52.723+05:30"
    }, {
      "user_car_model_id": 18794,
      "license_plate": "DL1CAB0001",
      "mechanic_email": "my_mechanic_2@example.com",
      "created_at": "2017-01-20T19:32:47.594+05:30"
    }, {
      "user_car_model_id": 18795,
      "license_plate": "DL1CAB0002",
      "mechanic_email": "my_mechanic_1@example.com",
      "created_at": "2017-01-20T21:27:29.035+05:30"
    }, {
      "user_car_model_id": 18795,
      "license_plate": "DL1CAB0003",
      "mechanic_email": "my_mechanic_3@example.com",
      "created_at": "2017-01-20T17:18:03.154+05:30"
    }
  ]
}

This request will be used to get the list of license plate of cars inspected by your mechanics. Then you can fetch the engine report for any particular car using the details returned in this request

HTTP Request

GET http://carpm.in/user_car_models/get_reports

Header Parameters

Parameter Value
Content-Type application/json
Accept application/json
X-User-Email you@example.com
X-User-Token my_authentication_token

URL Parameters

Parameter Sample Value Description
from_date ‘2016-11-07’ State date of the Query
to_date '2017-12-08’ End Date of the Query

Response Parameters

Parameter Sample Value Description
license_plate DL1CAB0003 The License Plate of the car as filled by Mechanic during inspection
user_car_model_id 18795
mechanic_email my_mechanic@example.com Email ID of the Mechanic conducting the inspection
created_at 2017-01-20T17:18:03.154+05:30 Time at which the inspection is done

The parameters license_plate and inspector_email returned in this request will be used in future requests to get the details of a particular inspection

Get Report Details

  curl -i -H "Accept: application/json"          
          -H "Content-type: application/json" 
          -H "X-User-Email: you@example.com"     
          -H  "X-User-Token: my_authentication_token" 
          -X GET https://carpm.in/mechanic/reports/get_report?
                 mechanic_email=my_mechanic@example.com
                 &license_plate=DL1CAB1234&user_car_model_id=18795

The above command returns JSON structured like this:

{
  "license_plate": "hello",
  "age": 1,
  "odometer_reading": 3128,
  "car": "Maruti Suzuki Ciaz",
  "car_model": "ZXI AT",
  "fuel_type": "Petrol",
  "status": 1,
  "time": "2016-09-29T14:07:34.671+05:30",
  "mechanic_name": "Your Mechanic",
  "mechanic_email": "your_mechanic@example.com",
  "engine_report": {
    "report_status": 1,
    "fuel_trim": true,
    "fuel_system": null,
    "battery_voltage": 11.8,
    "engine_misfire": true,
    "idling_rpm": null,
    "idling_rpm_status": null,
    "engine_knocking": true,
    "fuel_and_air_metering": true,
    "injector_circuit": true,
    "ignition_system": true,
    "auxiliary_emissions_control": false,
    "vehicle_speed_and_idle_control_system": false,
    "computer_output_circuit": true,
    "transmission_system": true,
    "coolant_temp_status": true,
    "max_coolant_temp": 41.0
  },
  "current_fault_codes": [{
    "description": "Issue in shutting off engine",
    "cause": ";A faulty crankshaft position sensor; A faulty ignition switch or lock cylinder; Damaged wiring in the engine shutoff solenoid circuit ; A faulty powertrain control module; A faulty engine shutoff solenoid",
    "symptom": "Check Engine Light/MIL will be on",
    "system": "Fuel and Air Metering"
  }, {
    "description": "Timing for injecting fuel is incorrect",
    "cause": ";Faulty camshaft position sensor; Faulty crankshaft position sensor; Faulty powertrain control module; Damaged wiring associated with the fuel injection control circuit",
    "symptom": "; Low power; Vehicle no start; Hard start; Displays an intermittent stumble or miss; Engine may start and then stall; Engine rough idle",
    "system": "Fuel and Air Metering"
  }],
  "upcoming_fault_codes": [{
    "description": "Engine is overheating",
    "cause": "; Faulty cooling fan; Faulty Thermostat; Faulty engine temperature sensor; Cooling fan harness is open or shorted; Cooling fan poor electrical connection; Engine temperature sensor harness is open or shorted; Engine temperature sensor poor electrical connection; Improper ignition timing; Blocked radiator",
    "symptom": "; Low power; Crank, but no start; Hard start; Displays an intermittent stumble or miss; Engine may start and then stall; Engine may appear to drive fine but surge at idle",
    "system": "Fuel and Air Metering"
  }, {
    "description": "The gear fluid temperature detected is very high",
    "cause": ";A leak from any part of the transmission system such as the transmission pan, transmission cooler lines, transmission cooler, or the radiator; Internal damage to the transmission causing excess friction between internal moving transmission parts; A faulty transmission temperature sensor; A faulty powertrain control module; It is even possible that the engine being overheated could cause the transmission to overheat as well.",
    "symptom": "; Vehicle transmission/transaxle wont engage; Leaking fluid out of torque converter seal or other location; Low fluid in transmission/transaxle",
    "system": "Fuel and Air Metering"
  }]
}

Once you have received the license plate of the inspected car and the corresponding Mechanic email id from the previous request

HTTP Request

GET https://carpm.in/old_car/engine_reports/report

Header Parameters

Parameter Value
Content-Type application/json
Accept application/json
X-User-Email you@example.com
X-User-Token my_authentication_token

URL Parameters

Parameter Sample Value Description
mechanic_email my_mechanic@emample.com The Email ID of the Mechanic
license_plate DL1CAB1234 The License Plate returned in the response

Authentication

# With shell, you can just pass the correct header with each request
curl https://carpm.in/users/sign_in
  -H 'Content-Type: application/json' -H 'Accept: application/json' -X POST
  -d '{"user": {"email": “myemail@example.com", "password": "mypassword"}}'

The above command returns JSON structured like this:

{"user":
    { "id":46,
      "email":"email@example.com",
      "name":"My Self",
      "phone":"9999000000"
    },
  "status":"ok",
  "authentication_token":"my_authentication_token",
  "product_id":3394,
  "csrf":"abcd123",
  "success":true
}

HTTP Request

POST https://carpm.in/users/sign_in

Header Parameters

Parameter Value
Content-Type application/json
Accept application/json

Data Parameters

Parameter Sample Value Description
email myemail@example.com Enter the Email ID here
password mypassword Enter your Password here

Authenticate the API by including your secret access token and your email id in the request header. You can obtain your access token using the following http request

The authentication_token returned in this request needs to be saved as this token will be used in all further requests to authenticate the requests.

Errors

The CaRPM API uses the following error codes:

Error Code Meaning
400 Bad Request – Your request sucks
401 Unauthorized – Your Access Token is wrong/expired
403 Forbidden – The resource requested is hidden for administrators only
404 Not Found – The specified resource could not be found
405 Method Not Allowed – You tried to access a kitten with an invalid method
406 Not Acceptable – You requested a format that isn’t json
429 Too Many Requests – You’re requesting too many reports! Slow down!
500 Internal Server Error – We had a problem with our server. Try again later.
503 Service Unavailable – We’re temporarially offline for maintenance. Please try again later.