Coder Social home page Coder Social logo

smartlocation's Introduction

Documentation

This is a simple JSON REST API to create, update, delete, and retreive information about providers, service areas. A simple api to query service areas with latitude & longitude is provided.

Providers

Create provider

Request/Response:

Request/Response Description
Request URL http://188.166.228.50/api/v1/providers/
Request Type POST
Response Type json
Response [{"name":"","email":null,"language":"kjhfd","phone_number":"dhf","currency":"dsd","pk":12}]

Fields:

Parameter Description
name name of provider
email email of provider
language language of provider
phone_number phone number of provider
currency currency code of provider, eg: USD

Example:

$ curl -X POST http://188.166.228.50/api/v1/providers/ -d "name=john&language=eng&currency=USD&[email protected]"

List providers

Update provider

Delete provider

Service Area

Create Service Area

Request/Response:

Request/Response Description
Request URL http://188.166.228.50/api/v1/serviceareas/
Request Type POST
Response Type json
Response [{"provider":"http://188.166.228.50/api/v1/providers/12/","name":"test","price":"200.00","polygon":"[[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]","pk":1}]

Fields:

Parameter Description
name name of area
price price of in this area
polygon GeoJson polygon coordinates of the area
provider name of provider

Example:

curl -X POST http://188.166.228.50/api/v1/serviceareas/ -d "price=200.2&provider=http://188.166.228.50/api/v1/providers/12/&polygon=[[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]&name=atlanta"

Search service area

Request/Response:

Request/Response Description
Request URL http://188.166.228.50/api/v1/find_service_areas
Request Type GET
Response Type json
Response [{"name":"test","provider":"","price":200.0}]

Parameters:

Parameter Description
latitude latitude of the location
longitude longitude of the location
curl http://188.166.228.50/api/v1/find_service_areas?latitude=0.6&longitude=100.5

smartlocation's People

Contributors

chillaranand avatar

Stargazers

Vijay Bhaskar avatar

Watchers

James Cloos avatar  avatar  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.