-
Notifications
You must be signed in to change notification settings - Fork 14
<base_url>/api/v1/<object>/<method>
In order to make trip requests, save personal POIs and other actions that require a user to be logged in a X-User-Email and X-User-Token must be passed along with the request as a header.
Example:
--header "X-User-Email: dedwards@camsys.com" --header "X-User-Token: vEUuxxx5zH9Z1wgZQ7PU"
If these headers are not provided, then it is assumed that a guest users is making the request.
The Google Place format is used to represent all places.
Relevant section of the API document is here: https://developers.google.com/places/webservice/details#PlaceDetailsResults
Establishes user identity for further interaction with the system.
POST /api/v1/sign_in
Include the following Parameters
- password
Example
{
"session":
{
"email": "dedwards@camsys.com",
"password": "welcome1"
}
}
Success
- email address string
- authentication_token string
- first_name string
- last_name string
- last_origin Google Place The origin of the last trip planned by this traveler.
- last_destination Google Place The destination of the last trip planned for this traveler.
Email address and an authentication token. The Authentication token must be passed in all future API requests.
{"email":"dedwards@camsys.com","authentication_token":"vEUuxxx5zH9Z1wgZQ7PU"}
Failure
An error message.
Logout a user. (Invalidate the authentication token.)
POST api/v1/sign_out
Include the following Parameters
- user_token
Example
{"user_token":"dt8bjR77UV3sP1u7S6U-"}
Success
True
Failure
False
Returns a list of named locations whose names match the supplied search term. The semantics of the search (i.e. starts with, contains, wildcard, etc) are abstracted from the client. Default max results limit is something sensible (10?). If an authentication token is present in the request and includeUserPois = true, then search user’s POIs as well as global POIs, default is global only.
GET /api/v1/places/search
Include the following Parameters in the url
- search_string string
- maxresults int
- includeUserPois boolean
- pageSize int
- resultsPerPage int
Note 1: Use a % sign for wildcards. Otherwise an exact match will be required.
Note 2: %25 is the URL code for the % sign.
Example
http://oneclick-pa.herokuapp.com/api/v1/places/search?search_string=%25college%25
Success
- an array of locations, with the name attribute containing the POI name, and scope indicating global or user-defined.
- resultsPerPage int
- page int
- recordcount int (count of all records matching criteria)
Description: Retrieves a list of trip purposes in presentation order. The server may silently filter the list based on the user identity. ‘Selected’ flag is set to true for the purpose that the server has deemed to be most appropriate based on the destination parameter posted.
This service is needed for 1-Click/Ecolane integration in Pennsylvania.
POST /api/v1/trip_purposes/list
There are two ways to request this.
As a logged-in user, no parameters are needed except for the user's login credentials
As a guest user, pass the following parameter in the header
- geometry google_place This location will be used to filter the list of trip purposes
Returns the follwoing:
- trip_purposes array Array of JSON trip purposes
- top_trip_purposes array Array of 4 trip purposes that are most likely to be selected by the traveler. All four of these trip purposes will also be present in the trip_purposes array.
- default_trip_purposes string The String Id of the default trip purposes.
Each Trip Purpose JSON object present in the trip_purposes and top_trip_purposes arrays contains the following information
- name string Display name of the trip purpose
- code string Identifier of the trip purpose
- sort_order int Indicates order that the purposes should be shown.
Example
{
"top_trip_purposes": [
{
"name": "Medical Appointment",
"code": "Medical",
"sort_order": 1
},
{
"name": "Grocery Shopping",
"code": "Grocery",
"sort_order": 2
},
{
"name": "Dialysis",
"code": "Dialysis",
"sort_order": 3
},
{
"name": "Recreation",
"code": "Recreation",
"sort_order": 4
}
],
"trip_purposes": [
{
"name": "Medical Appointment",
"code": "Medical",
"sort_order": 1
},
{
"name": "Other",
"code": "Other",
"sort_order": 2
},
{
"name": "Grocery Shopping",
"code": "Grocery",
"sort_order": 3
},
{
"name": "Dialysis",
"code": "Dialysis",
"sort_order": 4
}
{
"name": "Senior Center",
"code": "Senior",
"sort_order": 5
},
{
"name": "Recreation",
"code": "Recreation",
"sort_order": 6
}
],
"default_trip_purpose": "Other"
}
Retrieves a list of itineraries in presentation order.
POST /api/v1/itineraries/plan
Include the following Parameters
- user_profile json A json that updates the user's profile. This will be done before the plan call is run.
- trip_purpose string
- trip_token:string
- optimize string can be ‘TIME’, ‘TRANSFERS’, or ‘WALKING’, Set to ‘TIME’ time to minimize total trip time. Set to ‘TRANSFERS’ to minimize transfers, or set to ‘WALKING’ to minimize time spent walking. If not included, ‘TIME’ is assumed.
- itinerary_requests array of trip requests
- segment_index int (starting with 0)
- start_location Google Place
- end_location: Google Place
- trip_time ISO8601 DateTime
- departure_type string (valid values are ‘arrive’, ‘depart’)
- max_walk_miles (optional) float Maximum distance the traveler is willing to walk. 2 Miles is default.
- max bicycle_miles (optional) float Maximum distance the traveler is willing to bike. 5 miles is default.
- max_walk_seconds (optional) integer Maximum time the traveler is willing to walk. Infinity is default.
- walk_mph (optional) float Traveler's walking speed in MPH (Used to calculate maximum distance when max_walk_seconds is specified. Also sent to OpenTripPlanner to determine trip times. Default is 3MPH. For travelers with a walking speed set in their profiles, this parameter will overwrite that parameter for the given trip.
- num_itineraries (optional) integer The maximum number of itineraries to be returned from OTP. The default is 3.
- modes (optional) array an array of strings for the modes that you want returned. For example ['mode_transit', 'mode_taxi', 'mode_paratransit', 'mode_bicycle', 'mode_bicycle_transit']. If modes is NULL, mode_transit, and mode_paratransit will be the default.
Modes Accepted
- mode_transit = bus and rail
- mode_taxi = taxi
- mode_paratransit = shared ride / paratransit
- mode_bicycle = bicycle only
- mode_bicycle_transit = bike to transit and being bicycle onto the transit vehicle
- mode_walk = walk only
- mode_park_transit = Drive to a Park&Ride and then take transit
Example
{
"user_profile":
{
"attributes":
{
"email": "dedwards@camsys.com",
"walking_speed": "average",
"walking_distance": "2.5"
},
"characteristics":
{
"veteran": true,
"ada_eligible": false
},
"accommodations":
{
"stretcher": false,
"folding_wheelchair": true
}
},
"trip_purpose": trip_purpose_code,
"trip_token": unique_trip_token (optional),
"optimize": optimization_code (optional),
"modes": ['mode_transit', 'mode_taxi', 'mode_paratransit', 'mode_bicycle', 'mode_bicycle_transit'],
"itinerary_request": [
{
"segment_index": 1,
"start_location": location element as shown above,
"end_location": location element as shown above,
"trip_time”: "2015-03-25T19:30:00.000-04:00",
"departure_type": "depart"
},
{
"segment_index": 2,
"start_location": location element as shown above,
"end_location": location element as shown above,
"trip_time": "2015-03-25T20:30:00.000-04:00",
"departure_type": "depart"
}
]
}
- trip_id integer
- trip_token string Optionally, if specified on the call to create the trip.
- purposes array Array of relevant purposes for the itineraries returned. Name and Code.
- characteristics array Array of relevant characteristics for the itineraries returned. Name, Code, and Question.
- accommodations array Array of relevant accommodations for the itineraries returned. Name, Code, and Question.
- itineraries array An array of itinerary objects. See below for more details.
Each Itinerary object contains the following:
- cost float (Optional) Cost of the itinerary, if it is known
- duration int Duration of trip in seconds
- walk_time int Time spent walking in seconds
- transit_time int Time spent on a vehicle in seconds
- wait_time int Time spent waiting in seconds
- walk_distance float Walk distance in meters
- transfers int Number of vehicle transfers
- bookable boolean Does this service allow online booking through 1-Click?
- user_registered boolean Does the current user have valid credentials stored to book with this service?
- start_time ISO8601 Trip starting time
- end_time ISO8601 Trip ending time
- discounts Array This is a json array of potential discounts. It is used for guest users only. For guest users who are interested in shared ride trips, a list of potential fares, comments, and funding sources will be returned. This information is the format: [{"fare"=>2.35, "comment"=>"Senior Citizens", "funding_source"=>"Lottery"}]
- start_location Google Place Origin of the itinerary
- end_location Google Place Destination of the itinerary
- service_name string The name of the service. e.g., Rabbit Transit, MBTA, etc.
- segment_index int indicates which segment of the itinerary request the itinerary is related to.
- json_legs array the individual trip legs. E.g., 1) walk to the bus, 2) take bus #12, 3) walk to destination. This information is provided directly from OpenTripPlanner legs and includes service names, route names, etc.
- pre-booking questions array {code, options, question} For bookable itineraries, This parameter defines additional questions that need to be answered by the traveler before booking.
Example
{
"trip_id": 16,
"trip_token": null,
"purposes": [
{
"name": "Grocery",
"code": "grocery"
},
{
"name": "Medical",
"code": "medical"
}
],
"characteristics": [
{
"name": "Disabled",
"code": "disabled",
"note": "Do you have a permanent or temporary disability?"
},
{
"name": "Veteran",
"code": "veteran",
"note": "Are you a military veteran?"
}
],
"accommodations": [
{
"name": "Folding wheelchair accessible.",
"code": "folding_wheelchair_accessible",
"note": "Do you need a vehicle that has space for a folding wheelchair?"
},
{
"name": "Motorized wheelchair accessible.",
"code": "motorized_wheelchair_accessible",
"note": "Do you need a vehicle than has space for a motorized wheelchair?"
},
{
"name": "Curb-to-curb",
"code": "curb_to_curb",
"note": "Do you need delivery to the curb in front of your home?"
}
],
"itineraries": [ <ITINERARIES LISTED HERE> ]
}
Book one or more itineraries
POST /api/v1/itineraries/book
Include the following Parameters in the request
- itinerary_id int
- assistant boolean (optional: Ecolane only) Are you traveling with a certified assistant?
- children int (optional: Ecolane only) How many children are traveling with you?
- companions int (optional: Ecolane Only) How many companions are traveling with you?
- other_passengers int (optional: Ecolane Only) How many other passengers are traveling with you?
- comments string (optional: Ecolane Only) Leave comments for the driver.
- guests int (optional: RidePilot only) How many guests are traveling with you?
- attendants int (optional: RidePilot only) How many attendants are traveling with you?
- purpose int (optional: RidePilot only) What is the purpose code for this trip?
- return_time iso8601 Time (optional) For 1-way trips, providing a return_time will automatically create a round trip and book both parts of the trip.
Example with Ecolane Parameters
{
"booking_request": [
{
"itinerary_id": "3",
"assistant": true,
"children": 1,
"companions": 1,
"note": "Honk twice.",
},
{
"itinerary_id": "4",
"assistant": true,
"other_passengers": 3,
"note": "I'm in door #3.",
}
]
}
Example with RidePilot Parameters
{
"booking_request": [
{
"itinerary_id": "44413",
"guests": 1,
"purpose": 1,
"attendants": 0,
"return_time": "2017-01-25T18:07:12+00:00"
}
]
}
- booking_results array array of itinerary booking results
(each element in the booking_results array contains the following:)
- trip_id int
- itinerary_id int
- booked boolean True: Trip booked, False: Trip failed to book
- confirmation_id text Give this number to the traveler, this is their trip confirmation number.
- wait_start ISO8601 datetime Start of estimated pickup window.
- wait_end ISO8601 datetime End of estimated pickup window.
- arrival ISO8601 datetime Estimated arrival time.
- message string Used when the trip fails to book
- negotiated_duration float Estimated total trip duration in minutes.
Example
{
"booking_results": [
{
"trip_id": "2",
"itinerary_id": "1",
"booked": true,
"confirmation": "12345",
"wait_start": "ISO8601 Time",
"wait_end": "ISO8601 TIME",
"arrival": "ISO8601 Time",
"message": "Optional Message"
},
{
"trip_id": "2",
"itinerary_id": "2",
"booked": true,
"confirmation": “12346”,
"wait_start": "ISO8601 Time",
"wait_end": "ISO8601 TIME",
"arrival": "ISO8601 Time",
"message": "Optional Message"
}
]
}
Cancel 1 or more booked itineraries
POST /api/v1/itineraries/cancel
Include the following Parameters in the url
- bookingcancellation_request array of itinerary ids or booking_confirmations
- itinerary_id int (Optional: If this isn't specified then the booking_confirmation must be specified.) points to the id of a trip booked through 1-Click
- booking_confirmation string (Optional: If this isn't specified then the itinerary_id must be specified.) the booking confirmation of a trip that was not necessarily booked through 1-Click.
Example
{
"bookingcancellation_request": [
{
"itinerary_id": "3"
},
{
"itinerary_id": "4"
} ,
{
"booking_confirmation": "3423424"
}
]
}
- cancellation_results array Array of results for each requested cancellation
- trip_id int
- itinerary_id int
- success boolean
- confirmation_id text This is the same as the booking confirmation.
Save itineraries to My Trips
POST /api/v1/itineraries/select
Include the following Parameters in the request
- select_itineraries array Array of itineraries to be selected
Example
{
"select_itineraries": [
{
itinerary_id:"1"
},
{
itinerary_id:"4"
}
]
}
Success
200
Failure
Error Message
Send trip emails to the traveler.
POST /api/v1/trips/email
POST /api/v1/itineraries/email (Denver RTD Only)
Include the following Parameters in the request
- email_address string email address AND EITHER:
- trip_id int ID of current trip OR:
- booking_confirmations array Array containing a Booking Confirmation Number
Example with Trip ID
{
"email_address": "email@camsys.com",
"trip_id": 1
}
Example with Multiple Recipients and Booking Confirmation
{
"email_address": "email@camsys.com, user@camsys.com",
"booking_confirmations": ["1695914"]
}
For Denver RTD Only
- email_itineraries array Array of trips to email each contains email address and trip id.
- email_address string email address
- trip_id int
Example
{
"trip_link": "http://url-to-list-trip.camsys-apps.com/#/trip/",
"email_itineraries": [
{
"from_address": "sender@camsys.com",
"subject": "email_subject",
"email_address": "user@camsys.com",
"itineraries": [
{
"trip_id":"1"
}
]
}
]
}
Example with Itineraries Specified (Denver Trip Planner)
{
"trip_link": "http://rtd-qa.camsys-apps.com/#/plan/",
"email_itineraries": [
{
"from_address": "user@camsys.com",
"subject": "test2",
"email_address": "lcaraballo@camsys.com",
"trip_id": 38,
"itinerary_ids": [96]
}
]
}
Success
200
Failure
Error Message
Return the status of a Trip.
GET api/v1/trips/status_from_token
Include the following Parameters in the request
- trip_token string
Example
GET api/v1/trips/status_from_token?trip_token=1234
-
trip_token string
-
trip_id int
-
code string Status of the trip
Codes
- BOOKED Trip is booked
- PLANNED Trip has been saved but not booked (only used for non-bookable trips)
- STARTED Trip started but neither booked or planned/saved
-
description string Expanded version of the status
Example
{
"trip_status_report": {
"trip_token": "abc123",
"trip_id": 2,
"code": STARTED,
"description": "Trip is started but not planned."
}
}
Return the status of a Trip.
GET api/v1/trips/<id>/status
Include the following Parameters in the request
- id int Internal Trip Id
Example
GET api/v1/trips/3/status
-
trip_token string
-
trip_id int
-
code string Status of the trip
Codes
- BOOKED Trip is booked
- PLANNED Trip has been saved but not booked (only used for non-bookable trips)
- STARTED Trip started but neither booked or planned/saved
-
description string Expanded version of the status
Example
{
"trip_status_report": {
"trip_token": "abc123",
"trip_id": 2,
"code": STARTED,
"description": "Trip is started but not planned."
}
}
Return the status of a Trip.
GET api/v1/trips/status_from_token
Include the following Parameters in the request
- trip_token string
Example
GET api/v1/trips/details_from_token?trip_token=1234
-
trip_token string
-
trip_id int
-
code string Status of the trip
Codes
- BOOKED Trip is booked
- PLANNED Trip has been saved but not booked (only used for non-bookable trips)
- STARTED Trip started but neither booked or planned/saved
-
description string Expanded version of the status
-
trip trip object a full trip object including
Return the status of a Trip.
GET api/v1/trips/<id>/details
Include the following Parameters in the request
- id int Internal Trip Id
Example
GET api/v1/trips/3/details
-
trip_token string
-
trip_id int
-
code string Status of the trip
Codes
- BOOKED Trip is booked
- PLANNED Trip has been saved but not booked (only used for non-bookable trips)
- STARTED Trip started but neither booked or planned/saved
-
description string Expanded version of the status
-
trip trip object a full trip object including
Get a list of the global characteristics questions.
GET api/v1/characteristics/list
Example
GET http://oneclick-pa.herokuapp.com/api/v1/characteristics/list
- characteristics_questions array an array of characteristics questions and potential answers
- text string Question Text
- code string Unique code for this question
- type string What type of question is this? Bool, Date, or Integer
Example
{
"characteristics_questions":
[
{
"text":"Do you have a permanent or temporary disability?",
"code":"disabled",
"type":"bool"
},
{
"text":"Are you eligible for ADA paratransit?",
"code":"ada_eligible",
"type":"bool"
}
]
}
Get a list of the global accommodations questions.
GET api/v1/accommodations/list
Example
GET http://oneclick-pa.herokuapp.com/api/v1/accommodations/list
- accommodations_questions array an array of characteristics questions and potential answers
- text string Question Text
- code string Unique code for this question
- type string What type of question is this? Bool, Date, or Integer
Example
{
"accommodations_questions":
[
{
"text":"Do you need a vehicle that has space for a folding wheelchair?",
"code":"folding_wheelchair",
"type":"bool"
},
{
"text":"Do you need assistance entering the vehicle?",
"code":"requires_assistance",
"type":"bool"
}
]
}
Does a given point (lat,lng) reside within the global coverage area.
POST /api/v1/places/within_area
Include the following Parameters in the request
- geometry Google Place
True
The point lies within the global boundary.
False
The point lies outside the global boundary.
Retrieve the global boundary for the system.
GET /api/v1/places/boundary
Example
GET http://oneclick-rtd-qa.herokuapp.com/api/v1/places/boundary
- GeoJSON representation of the global bounary
Example
{
"type":"MultiPolygon",
"coordinates":
[[[[-105.02646235099996,39.52183578300003],[-105.02673495599998,39.52182518700005], etc. . .
}
Returns a list of all paratransit services. ["paratransit", "volunteer", "nemt", "tap", "dial_a_ride"]. Used mostly for getting a list county names in Pennsylvania.
GET api/v1/services/ids
Example
GET http://oneclick-pa-qa.herokuapp.com/api/v1/services/ids
- service_ids array An array of service ids
Example
{"service_ids":["lebanon","dauphin","cambria","york","northumberland","franklin"]}
The same as #18, but the names are humanized e.g., los_angeles would become Los Angeles. Used mostly for getting a list county names in Pennsylvania.
GET api/v1/services/ids_humanized
Example
GET http://oneclick-pa-qa.herokuapp.com/api/v1/services/ids_humanized
- service_ids array An array of service ids
Example
{"service_ids":["Lebanon","Dauphin","Cambria","York","Northumberland","Franklin"]}
Get Traveler profile of the currently logged in user. It's currently customized for FindMyRidePA. Should be generalized.
GET api/v1/users/profile
Example
GET http://oneclick-pa-qa.herokuapp.com/api/v1/users/profile
- first_name string
- last_name string
- email string
- walking_speed string [slow = 2mph, average = 3mph, fast = 4mph]
- walking_distance float Maximum distance the traveler is willing to walk on a trip (miles).
- ecolane_id string Ecolane Id of this traveler
- lang string preferred language of the traveler
- characteristics array Hash array of answered characteristics questions
- accommodations array Hash array of answered accommodations questions
- preferred_modes array Array of modes that the traveler prefers to use. This can be used to hide certain modes by default.
Example
{
"first_name":"George",
"last_name":"Burdell",
"email":"GeorgePBurdell@example.com",
"walking_speed":"average",
"walking_distance":2.0,
"ecolane_id":12345,
"lang": "en",
"characteristics": [
{
"name": "Disabled",
"code": "disabled",
"note": "Do you have a permanent or temporary disability?"
},
{
"name": "Veteran",
"code": "veteran",
"note": "Are you a military veteran?"
}
],
"accommodations": [
{
"name": "Folding wheelchair accessible.",
"code": "folding_wheelchair_accessible",
"note": "Do you need a vehicle that has space for a folding wheelchair?"
},
{
"name": "Motorized wheelchair accessible.",
"code": "motorized_wheelchair_accessible",
"note": "Do you need a vehicle than has space for a motorized wheelchair?"
},
{
"name": "Curb-to-curb",
"code": "curb_to_curb",
"note": "Do you need delivery to the curb in front of your home?"
}
],
"preferred_modes": [
"mode_paratransit",
"mode_transit"
]
}
Update Traveler profile of the currently logged in user. It's currently customized for FindMyRidePA. Should be generalized.
POST api/v1/users/update
Include the following Parameters in the request
- attributes json Contain attributes to be updated.
- characteristics json Contains updated characteristics questions.
- accommodations json Contains updated accommodations question.
- password string Updated Password
- password_confirmation string Confirm your password
- lang string Preferred language
- preferred_modes array Array of preferred modes
Supported Attributes
- first_name string
- last_name string
- email string
- lang string (e.g., 'en', 'es')
- walking_speed string [slow = 2mph, average = 3mph, fast = 4mph]
- walking_distance float Maximum miles a person is willing to walk.
Example
{
"attributes":
{
email: "dedwards@camsys.com",
walking_speed: "average",
walking_distance: "2.5"
},
"characteristics":
{
veteran: true,
ada_eligible: false
},
"accommodations":
{
stretcher: false,
folding_wheelchair: true
},
"booking":
[
{ "service_id": 3, "user_name": "bob@bob.bob", "password": "B0B" }
],
"lang":"es",
"preferred_modes", ["mode_paratransit", "mode_transit"]
}
- will return status code 200 if user info was updated successfully, 400 if not
- message string
- booking["result"] boolean If booking profile info was passed, did it all authenticate successfully?
- booking["message"] string Message describing the outcome of booking info authentication.
Get all the upcoming trips for a traveler.
GET api/v1/trips/future_trips
Include the following Parameters in the request
No parameters should be included, the user is assumed to be the logged in user.
A trip array will be returned.
Each trip will contain a hash of either 1 or two itineraries. They keys for these itineraries will be
- 0 For the first itinerary in the trip. (i.e., the Outbound Itinerary)
- 1 For the second itinerary in the trip. (.e., the Return Itinerary). Note: The return itinerary is optional.
Each itinerary will contain the following
- mode _string _
- booking_confirmation string (optional)
- system string The system the trip was booked with (optional)
- customer_id string (optional)
- status string (optional)
- departure iso8601 time
- arrival iso8601 time
- fare float (optional)
- assistant boolean is their an assistant booked with this trip? (optional)
- children int how many children are traveling (optional)
- companions int how many additional companions are traveling (optional)
- origin Google Place
- destination Google Place
- duration float duration of trips in seconds
- walk_time float total walk time of trip in seconds
- transit_time float total time spent traveling in a vehicle in seconds
- wait_time float total time spent waiting in seconds
- walk_distance float total distance walked in meters
- transfers int total number of transfers
- json_legs hash hash of all leg details (walking directions, transit directions, shapes, etc.) from OpenTripPlanner.
Get past trips for a traveler. This only checks trips that occurred in the past year. Passing a date will only retrieve orders between 1 year ago and that date. Passing a max_results=N will limit the results to the N most recent trips planned within the date range.
GET api/v1/trips/past_trips
Include the following Parameters in the request
- max_results int (optional) the maximum number of trips to return. The default is 10
A trip array will be returned.
Each trip will contain a hash of either 1 or two itineraries. They keys for these itineraries will be
- 0 For the first itinerary in the trip. (i.e., the Outbound Itinerary)
- 1 For the second itinerary in the trip. (.e., the Return Itinerary). Note: The return itinerary is optional.
Each itinerary will contain the following
- mode _string _
- booking_confirmation string (optional)
- system string The system the trip was booked with (optional)
- customer_id string (optional)
- status string (optional)
- departure iso8601 time
- arrival iso8601 time
- fare float (optional)
- assistant boolean is their an assistant booked with this trip? (optional)
- children int how many children are traveling (optional)
- companions int how many additional companions are traveling (optional)
- origin Google Place
- destination Google Place
- duration float duration of trips in seconds
- walk_time float total walk time of trip in seconds
- transit_time float total time spent traveling in a vehicle in seconds
- wait_time float total time spent waiting in seconds
- walk_distance float total distance walked in meters
- transfers int total number of transfers
- json_legs hash hash of all leg details (walking directions, transit directions, shapes, etc.) from OpenTripPlanner.
Generate images of each itinerary map for the specified trip. It's currently customized for Denver Trip Planner.
POST /api/v1/itineraries/request_create_maps
Include the following Parameters in the request
- trip_id int OR
- itinerary_ids array of integers
Trip Id Example
{ "trip_id": 100}
Itinerary Ids Example
{ "itinerary_ids": [100]}
Success
200
Failure
Error Message
Checks to see if a rendered map image is available for the specified itineraries. It's currently customized for Denver Trip Planner.
POST /api/v1/itineraries/map_status
Include the following Parameters in the request
- id int Comma separated list of itineraries
Example
{ "id": 100}
Success
{
"itineraries": [{
"id": 100,
"has_map": true,
"url": "/uploads/itinerary/map_image/100/itinerary_map20160614-4212-1xc3gc1.png"
}]
}
Failure
Error Message
Email trip details from either a trip_id or a list of booking_confirmations.
POST /api/v1/trips/email
Include the following Parameters in the request
- email_address string Comma separated string of emails
- booking_confirmations array (Optional: If this is not specified, trip_id must be specified) array of strings of booking booking confirmation numbers
- trip_id int (Optional: If this is not specified, booking_confirmations must be specified) Integer of the trip id
Note: You need either booking_confirmations OR trip_id. Both are not needed.
Example
Example using booking confirmations
{"email_address": "dedwards8@gmail.com", "booking_confirmations": ["16233178", "16233179"]}
Example using trip_id.
{"email_address": "dedwards8@gmail.com", "trip_id": "3838"}
Success
Returns 200
Failure
Error Message
Pass a locale and an array of translation key and get back a dictionary of those translations.
POST /api/v1/translations/find
Include the following Parameters in the request
- locale string String of locale e.g., "en" or "es"
- translations array An array of translations
Example
Example body
{"locale": "en", "translations": ["splash", "welcome", "mode_walk"]}
{
"splash": "<html>Hello World!</html>",
"welcome": "Welcome",
"mode_walk": null
}
Get all translations for a specific locale or for all locales.
GET /api/v1/translations/all
Include the following Parameters in the request
- lang string (Optional) String of locale e.g., "en" or "es"
Examples
Get all translations for all locales.
http://oneclick-pa-qa.camsys-apps.com/api/v1/translations/all
Get all translations for Spanish only.
http://oneclick-pa-qa.camsys-apps.com/api/v1/translations/all?lang=es
For all locales, the results will look like this
{"es":{"hello":"hola","goodbye":"adios"},"en":{"hello":"Hi","goodbye":"Good bye"}}
For specific locales, the locale is omitted and only the dictionary is returned.
{"hello":"hola","goodbye":"adios"}
Get the 4 most recently used places for a logged in user.
GET /api/v1/places/recent
Include the following Parameters in the request header
- X-User-Token
- X-User-Email
An array of the 20 most recent places.
Create a new user.
POST /api/v1/sign_up
Include the following Parameters
- first_name
- last_name
- password
- password_confirmation
Example
{
"email": "gpburdell@camsys.com",
"password": "welcome1",
"password_confirmation": "welcome1",
"first_name": "George",
"last_name": "Burdell"
}
Success
- email address string
- authentication_token string
Email address and an authentication token. The Authentication token must be passed in all future API requests.
{"email":"dedwards@camsys.com","authentication_token":"vEUuxxx5zH9Z1wgZQ7PU"}
Failure
An error message explaining why the user creation failed.
For booking service users that have forgotten their ID, looks up ID by user attributes. Currently only works for Ecolane, and requires last name, last 4 digits of social, and home county.
GET /api/v1/users/lookup
Include the following Parameters in the url
- booking_agency string
- county string
- last_name string
- date_of_birth string (format: YYYY-MM-DD) [OPTIONAL]
- ssn_last_4 int or string [OPTIONAL]
Example
GET ../api/v1/users/lookup?booking_agency=ecolane&last_name=user&date_of_birth=1950-05-30&county=countyname
Success
- customer_number string
Returns the identifying ID number for the user's external booking service account. You may query using date_of_birth, ssn_last_4, or both.
{ "customer_number": "79109" }
Failure
Will return ERROR: 404 and a message if there were NO results, or MORE THAN ONE result, or if an invalid booking_agency parameter was passed.
Update Traveler Password
POST api/v1/users/password
Include the following Parameters in the request
- password string
- password_confirmation string
Example
{
"password": "welcome1",
"password_confirmation": "welcome1"
}
- will return status code 200 if the password updated successfully, 406 if not
Update Traveler Password
POST api/v1/users/password
Include the following Parameters in the request
- password string
- password_confirmation string
Example
{
"password": "welcome1",
"password_confirmation": "welcome1"
}
- will return status code 200 if the password updated successfully, 406 if not
Send an email to the user with password reset instructions
localhost:3000/api/v1/users/request_reset
Include the following Parameters in the request
- email string
Example
{
"email":"jsmith@example.com"
}
- will return status code 200 and send an email to the user.
Reset a user's password from a password reset token.
POST /api/v1/users/reset
Include the following Parameters in the request
- password string
- password_confirmation string
- reset_password_token string This token is provided in URL, in the email sent by 33. Send Reset Password Email
Example
{
"password": "welcome2",
"password_confirmation":"welcome2",
"reset_password_token":"djejesjaklsdvlk2929"
}
The call will return with a status code and a message
- will return status code 200 if the password is reset
- will return status code 400 if the password or password_confirmation is missing
- will return status code 403 if reset_password_token is invalid
- will return status code 406 if the password is unacceptable