Giter VIP home page Giter VIP logo

ticketscannerwebsite's Introduction

Website for TicketScanner app

This is the backend api for the ticketscanner app. Live version is available on ticketscanner.xlw.be

Api instructions

Api instructions are simple, yet so simple security isn't optimal, but good enough. The api routes are defined in the route file of the MVC-model.

Route::post('/api/createToken', 'ApiController@createToken');
Route::post('/api/event', 'ApiController@getEvents');
Route::post('/api/event/{id}', 'ApiController@getSingleEvent');
Route::post('/api/code/{id}', 'ApiController@getCode');

Get a token:

Send a request to /api/createToken with the fields email and password.

Example:

{
  "state": true,
  "userName": "Example",
  "userMail": "[email protected]",
  "api_token": "QS04Vd5zdphF6MEMNjNq7qINv4J7ugSjSdh038BmuJoYsnfiVTSAS7p9Tv9s"
}

If information is invalid:

{
  "state": false
}

List events:

Send a request to /api/event with the field api_token.

{
  "state": true,
  "events": [
    {
      "id": 1,
      "owner_id": 1,
      "name": "Testevent",
      "created_at": "2016-12-31 13:46:40",
      "updated_at": "2016-12-31 13:46:40"
    },
    {
      "id": 2,
      "owner_id": 1,
      "name": "test",
      "created_at": "2016-12-31 14:00:25",
      "updated_at": "2016-12-31 14:00:25"
    }
  ]
}

Get event codes:

Send a request to /api/event/{id} with the field api_token.

{
  "state": true,
  "codes": [
    {
      "id": 1,
      "event_id": 1,
      "code": "123456789",
      "state": "true",
      "created_at": "2016-12-31 13:46:40",
      "updated_at": "2016-12-31 13:46:40"
    }
  ]
}

Update a code:

Send a request to /api/code/{id} with the fields api_token and state. Set state to false

{
  "state": true,
  "update": 1
}

ticketscannerwebsite's People

Contributors

versionsix avatar

Watchers

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