Skip to content

Instantly share code, notes, and snippets.

@nathancarnes
Forked from amiel/smarttrips_api_spec.md
Last active December 18, 2015 04:09
Show Gist options
  • Save nathancarnes/5723790 to your computer and use it in GitHub Desktop.
Save nathancarnes/5723790 to your computer and use it in GitHub Desktop.

API Spec

POST /api/employers/trips

  • requires HTTP Basic authorization

Attributes

  • user_email -- users email required
  • trip_mode -- trip mode identifier required (see trip_mode options below)
  • trip_purpose -- trip purpose identifier optional (see trip_purpose options below)
  • trip_distance -- trip distance in miles required
  • trip_date -- date the trip occurred on in YYYY-MM-DD format; optional, defaults to current day

trip_mode options

  • walk
  • bike
  • bus
  • rideshare

trip_purpose options

  • work - default
  • errands
  • leisure
  • school

Example request

curl --data "[email protected]&trip_mode=walk&trip_purpose=work&trip_distance=2.3" \
  -u 1f3a284920d579e01deafc80ca1911bbc0cfb000:c0334cbd11b78dcac2439bfe938055bc07a7092f \
  https://whatcomsmarttrips.org/api/employers/trips
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment