Code Monkey home page Code Monkey logo

phpvms-rest-api's Introduction

phpVMS REST API

This is a basic REST API module for access to phpVMS data and functionality, for example in third party clients.

You can find a list of existing features/resources below as well as a (rather long and ever expanding) to do list - all contributions are welcome.

Important note: Clients will make requests directly to your own website and require user credentials. While clients should make every attempt to keep credentials secure you should be wary of where you enter your password when using clients built around this API.

Requirements

  • SimpleNews (Note: you don't need to use SimpleNews front end - just ensure NewsData.class.php is available)

Installation

Simply upload the files within the core folder to your phpVMS root.

Features & Resources

  • Username/password user auth for all requests via Basic Auth
  • Only available to confirmed registered users
  • Removes sensitive information from responses (encrypted password, salt, emails, IP addresses)
  • All PUT/POST data is expected to be JSON
  • Modular API resources - easy for other modules to include API functionality

News

Resource URI HTTP Method Data Purpose
/api/news[?page=n] GET N/A News list [at page n]
/api/news/{NewsID} GET N/A Individual news item

Pilots

Resource URI HTTP Method Data Purpose
/api/pilots GET N/A Pilot list
/api/pilots/{PilotID} GET N/A Individual pilot details
/api/pilots/me GET N/A Current pilot (from Auth header)

Registrations

Available only to users who can manage registrations

Resource URI HTTP Method Data Purpose
/api/registrations GET N/A List pending registrations
/api/registrations/{RequestID} PUT {confirmed:[1/2]} Approve/Reject registration

Schedules

Resource URI HTTP Method Data Purpose
/api/schedules GET N/A List schedules (all of them)
/api/schedules/{ScheduleID} GET N/A Individual schedule details

Bids

Resource URI HTTP Method Data Purpose
/api/bids POST {id:n} Bid on schedule ID n

To Do

Please let me know if there's anything missing from this list or you'd like to see included

  • Better auth method (token based?)
  • It's all in one file. Difficult to read. How can this be improved?
  • Editing pilot profile
  • View PIREPs
  • Submit a PIREP?
  • Awards
  • Aircraft
  • Paginate schedules list
  • Airports/Hubs
  • Viewing pages?

Admin

  • Approve/Reject PIREPs
  • Manage airlines
  • Manage schedules
  • Manage aircraft
  • Manage airports
  • Manage news
  • Manage pages
  • Manage downloads
  • Send mass email
  • Manage pilot groups
  • Manage pilot ranks
  • Manage awards
  • Financials
  • Site settings
  • Admin logs
  • Maintenance options

Licence

Released under the โ˜บ Licence

Feel free to edit this code however you want. Please also don't hesitate to fork this repo and open pull requests in order to extend the module however you feel is appropriate.

phpvms-rest-api's People

Contributors

tomsterritt 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.