GithubHelp home page GithubHelp logo

smartcar's Introduction

Smartcar API Documentaion

Live version of this API: https://SmartcarIntern.herokuapp.com

Contents:

1. Getting started: Running locally

2. API Endpoints

Getting started: Running server locally

Clone the repo:

$ git clone https://github.com/rahulsonwalkar/smartcar

Install dependencies & start:

$ cd smartcar
$ npm install
$ npm start       # Creates server on Localhost Port 3000

Tests: Open a new terminal window (because local server needs to be running) to run tests

$ npm test        # Runs API tests on local server

API Endpoints

Available IDs: 1234, 1235

1. Vehicle Info

Request:

GET /vehicles/:id

Response:

{
"vin": "1213231",
"color": "Metallic Silver",
"doorCount": 4,
"driveTrain": "v8"
}

Manual cURL request:

curl https://SmartcarIntern.herokuapp.com/vehicles/1234 -X GET

2. Security

Request:

GET /vehicles/:id/doors

Response:

[
{"location":"backRight","locked":"True"},
{"location":"frontRight","locked":"True"},
{"location":"frontLeft","locked":"True"},
{"location":"backLeft","locked":"False"}
]

Manual cURL request:

curl https://SmartcarIntern.herokuapp.com/vehicles/1234/doors -X GET

3. Fuel Range

Request:

GET /vehicles/:id/fuel

Response:

{"percent":"12.1"}

Manual cURL request:

curl https://SmartcarIntern.herokuapp.com/vehicles/1234/fuel -X GET

4. Battery Range

Request:

GET /vehicles/:id/battery

Response:

{"percent":"12.1"}

Manual cURL request:

curl https://SmartcarIntern.herokuapp.com/vehicles/1234/battery -X GET

5. Engine (START & STOP)

Request:

POST /vehicles/:id/engine

{
  "action" : "START | STOP"
}

Response:

{"status":"sucess | error"}

Manual cURL request:

curl https://SmartcarIntern.herokuapp.com/vehicles/1234/engine -X POST -H 'Content-Type: application/json' -d '{"action": "START"}'

smartcar's People

Contributors

asaprahul avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.