Skip to content

cicika/go-carinthia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Carithia

No fuss! Just ride :)

API Documentation

URL: http://gocarinthia.cicika.info

Authorization: GoCarinthia <auth_token>

User registration

PUT /user/

Request:

    Email: mail@address.com,
    Name: Full Name,
    Password: string,
    BeaconIdentifier: string, //optional

Response: 200 OK

    AuthToken: <token>,
    UserId: integer

User login

Request:

POST /user/login/

    Email: mail@addres.com,
    Password: password

Response:

    Id: 123,
    AuthToken: token,
    Type: passenger

Start new trip

Request:

POST /trip/start/

    StartedAt: Unix timestamp

Response:

200 OK

End trip

Request:

POST /trip/end/

If not posted by device, backend will handle it.

    EndedAt: unix timestamp

Response: 200 OK

Record check in point (trip segment)

Request:

POST /trip/segment/

    TransportStation: (name or id from location database),
    TransportType: type from location database (can be empty),
    BeaconIdentifier: registered beacon,
    Latitude: 44.28,
    Longitude: 21.13, //don't care about decimals, send all
    CreatedAt: unix timestamp)
    CheckInType: 0 for start, 1 for stop, 2 for end

Passenger check (for controller's device)

GET /user/:user_id/:beacon_identifier

Response:

    LastCheckinAt: unix timestamp,
    BeaconIdentifier: string

CC details

Request:

POST /user/payment/method/

    CardNumner: string
    CardHolder: string
    Expiration: string
    Cvv: integer

Response: 200 Ok

About

What The Hack?! - Easy ticketing solution for Carinthian public transport. And more!

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages