Skip to content

Instantly share code, notes, and snippets.

@amiel
Last active December 18, 2015 03:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save amiel/5718462 to your computer and use it in GitHub Desktop.
Save amiel/5718462 to your computer and use it in GitHub Desktop.
SmartTrips API spec draft

API Spec

POST /api/employers/trips

  • requires HTTP Basic authorization

Attributes

trip_mode options

  • walk
  • bike
  • bus
  • rideshare

trip_purpose options

  • work - default
  • errands
  • leisure
  • school

Example request

curl --data "user_email=amiel@carnesmedia.com&trip_mode=walk&trip_purpose=work&trip_distance=2.3" \
  -u 1f3a284920d579e01deafc80ca1911bbc0cfb000:c0334cbd11b78dcac2439bfe938055bc07a7092f \
  https://whatcomsmarttrips.org/api/employers/trips
@nathancarnes
Copy link

  1. Think the URL should include employers since they're authenticating to log trips for other users; otherwise it'll be confusing if we add an individual API
  2. Would like to make trip_purpose option and default it to work (since 99% of API requests will be work. Maybe 100%. Maybe more.)

@amiel
Copy link
Author

amiel commented Jun 6, 2013

Ok, I've updated the spec as per your suggestions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment