Package Data | |
---|---|
Maintainer Username: | beaulm |
Maintainer Contact: | beaulm@gmail.com (Beau Lynn-Miller) |
Package Create Date: | 2014-07-30 |
Package Last Update: | 2016-01-17 |
Language: | PHP |
License: | Unknown |
Last Refreshed: | 2024-11-18 03:04:44 |
Package Statistics | |
---|---|
Total Downloads: | 164 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 4 |
Total Watchers: | 2 |
Total Forks: | 1 |
Total Open Issues: | 1 |
All calls to the API will start with /api/v1/
All responses will be in JSON
If any response other than 200 is given, the JSON will be an array with a code
and message
element
/api/v1/login
ANY
username
, password
OR token
token
Example: /api/v1/login?username=3333334444&password=fake
Ex Return: {"data":{"token":"12d3ff","user":{"id":2,"username":"3333334444","name":"Beau Lynn-Miller","phone":"3333334444","email":"beaulm@gmail.com","created_at":"2014-10-17 10:16:58","updated_at":"2014-10-17 10:17:00","deleted_at":null,"last_offered":null}},"timestamp":"2014-10-17 10:57:05","hashes":{"gpsConfig":"422962d8","vehicles":"86e45d7c","towingCompanies":"011500b9","states":"738ee935"}}
/api/v1/{object}
GET
token
Example: /api/v1/user?token=12d3ff
Ex Return: [{"id":1,"name":"Fakey McFakerson","email":"fake@fake.com"},{"id":2,"name":"Foo McBarenson","email":"foo@bar.com"}]
/api/v1/{object}/{id}
GET
token
Example: /api/v1/user/2?token=12d3ff
Ex Return: {"id":2,"name":"Foo McBarenson","email":"foo@bar.com"}
/api/v1/{object}
POST
token
, fillabe parameters defined in modelExample: /api/v1/user?name=Testey&password=test&email=test@test.com&phone=5551234123&token=12d3ff
Ex Return: {"id":3,"name":"Testey","email":"test@test.com","phone":"5551234123"}
/api/v1/{object}/{id}
PUT
token
, fillabe parameters defined in modelExample: /api/v1/user/2?phone=5557777777&token=12d3ff
Ex Return: {"id":2,"name":"Foo McBarenson","email":"foo@bar.com","phone":"5557777777"}
DELETE
token
Example: /api/v1/user/1
Ex Return: [{"id":2,"name":"Foo McBarenson","email":"foo@bar.com","phone":"5557777777"},{"id":3,"name":"Testey","email":"test@test.com","phone":"5551234123"}]
/api/v1/logout
ANY
token
Example: /api/v1/logout?token=12d3ff
Ex Return: {"message":"Logout successful"}
Making a call without a token will result in an error:
Example: /api/v1/user
Ex Return: {"code":401,"message":"You do not have access to view this web page"}