Skip to content

Commit

Permalink
Merge pull request #104 from OneBusAway/rest-apis
Browse files Browse the repository at this point in the history
Finish converting REST API methods to the new layout
  • Loading branch information
aaronbrethorst authored Mar 21, 2024
2 parents 4385e74 + fc12f0c commit 99f5c17
Show file tree
Hide file tree
Showing 38 changed files with 147 additions and 672 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":200,"currentTime":1710979160311,"data":{"entry":{"actualTrack":"","arrivalEnabled":true,"blockTripSequence":2,"departureEnabled":true,"distanceFromStop":-86260.03203224196,"frequency":null,"historicalOccupancy":"","lastUpdateTime":1710979086000,"numberOfStopsAway":-174,"occupancyStatus":"","predicted":true,"predictedArrivalInterval":null,"predictedArrivalTime":1710959774000,"predictedDepartureInterval":null,"predictedDepartureTime":1710959774000,"predictedOccupancy":"","routeId":"1_100214","routeLongName":"","routeShortName":"372E","scheduledArrivalInterval":null,"scheduledArrivalTime":1710959580000,"scheduledDepartureInterval":null,"scheduledDepartureTime":1710959580000,"scheduledTrack":"","serviceDate":1710918000000,"situationIds":[],"status":"default","stopId":"1_75403","stopSequence":39,"totalStopsInTrip":47,"tripHeadsign":"U-District Station","tripId":"1_604670535","tripStatus":{"activeTripId":"1_604669915","blockTripSequence":6,"closestStop":"1_23905","closestStopTimeOffset":0,"distanceAlongTrip":17544.75847875161,"frequency":null,"lastKnownDistanceAlongTrip":0,"lastKnownLocation":{"lat":47.67626953125,"lon":-122.30064392089844},"lastKnownOrientation":0,"lastLocationUpdateTime":1710979086000,"lastUpdateTime":1710979086000,"nextStop":"1_23905","nextStopTimeOffset":0,"occupancyCapacity":0,"occupancyCount":0,"occupancyStatus":"","orientation":268.65466459784096,"phase":"in_progress","position":{"lat":47.676273613612494,"lon":-122.3006519855894},"predicted":true,"scheduleDeviation":194,"scheduledDistanceAlongTrip":17544.75847875161,"serviceDate":1710918000000,"situationIds":[],"status":"SCHEDULED","totalDistanceAlongTrip":22176.747926117183,"vehicleId":"1_6936"},"vehicleId":"1_6936"},"references":{"agencies":[{"disclaimer":"","email":"","fareUrl":"https://kingcounty.gov/en/dept/metro/fares-and-payment/prices","id":"1","lang":"EN","name":"Metro Transit","phone":"206-553-3000","privateService":false,"timezone":"America/Los_Angeles","url":"https://kingcounty.gov/en/dept/metro"}],"routes":[{"agencyId":"1","color":"","description":"UW/Cascadia College - University District","id":"1_100214","longName":"","nullSafeShortName":"372","shortName":"372","textColor":"","type":3,"url":"https://kingcounty.gov/en/dept/metro/routes-and-service/schedules-and-maps/372.html"},{"agencyId":"1","color":"","description":"Loyal Heights - University District","id":"1_100225","longName":"","nullSafeShortName":"45","shortName":"45","textColor":"","type":3,"url":"https://kingcounty.gov/en/dept/metro/routes-and-service/schedules-and-maps/045.html"},{"agencyId":"1","color":"","description":"Northgate - Roosevelt - University District","id":"1_100259","longName":"","nullSafeShortName":"67","shortName":"67","textColor":"","type":3,"url":"https://kingcounty.gov/en/dept/metro/routes-and-service/schedules-and-maps/067.html"}],"situations":[],"stopTimes":[],"stops":[{"code":"75403","direction":"SW","id":"1_75403","lat":47.654503,"locationType":0,"lon":-122.30513,"name":"East Stevens Way NE & Benton Ln","parent":"","routeIds":["1_100225","1_100259","1_100214"],"staticRouteIds":["1_100225","1_100259","1_100214"],"wheelchairBoarding":"ACCESSIBLE"},{"code":"23905","direction":"S","id":"1_23905","lat":47.676273,"locationType":0,"lon":-122.300743,"name":"25th Ave NE & NE 65th St","parent":"","routeIds":["1_100214"],"staticRouteIds":["1_100214"],"wheelchairBoarding":"ACCESSIBLE"}],"trips":[{"blockId":"1_7087104","directionId":"1","id":"1_604670535","peakOffpeak":0,"routeId":"1_100214","routeShortName":"372E","serviceId":"1_45626","shapeId":"1_20372015","timeZone":"","tripHeadsign":"U-District Station Lake City","tripShortName":"EXPRESS"},{"blockId":"1_7087104","directionId":"1","id":"1_604669915","peakOffpeak":0,"routeId":"1_100214","routeShortName":"372E","serviceId":"1_45626","shapeId":"1_20372015","timeZone":"","tripHeadsign":"U-District Station Lake City","tripShortName":"EXPRESS"}]}},"text":"OK","version":2}
1 change: 1 addition & 0 deletions src/api/example_responses/block-1_7085253.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/api/example_responses/route-1_100224.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":200,"currentTime":1710977537681,"data":{"entry":{"agencyId":"1","color":"","description":"Ballard - Montlake","id":"1_100224","longName":"","nullSafeShortName":"44","shortName":"44","textColor":"","type":3,"url":"https://kingcounty.gov/en/dept/metro/routes-and-service/schedules-and-maps/044.html"},"references":{"agencies":[{"disclaimer":"","email":"","fareUrl":"https://kingcounty.gov/en/dept/metro/fares-and-payment/prices","id":"1","lang":"EN","name":"Metro Transit","phone":"206-553-3000","privateService":false,"timezone":"America/Los_Angeles","url":"https://kingcounty.gov/en/dept/metro"}],"routes":[],"situations":[],"stopTimes":[],"stops":[],"trips":[]}},"text":"OK","version":2}
1 change: 1 addition & 0 deletions src/api/example_responses/route-ids-for-agency-40.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":200,"currentTime":1710977435475,"data":{"limitExceeded":false,"list":["40_100511","40_532","40_535","40_SNDR_TL","40_102734","40_560","40_574","40_577","40_578","40_SNDR_EV","40_580","40_586","40_590","40_592","40_594","40_595","40_596","40_100232","40_100236","40_100479","40_2LINE","40_100240","40_100239","40_100451","40_TLINE","40_510","40_512","40_513"],"references":{"agencies":[],"routes":[],"situations":[],"stopTimes":[],"stops":[],"trips":[]}},"text":"OK","version":2}
1 change: 1 addition & 0 deletions src/api/example_responses/routes-for-agency-40.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":200,"currentTime":1710977596679,"data":{"limitExceeded":false,"list":[{"agencyId":"40","color":"2B376E","description":"Redmond - University District","id":"40_100511","longName":"Redmond - University District","nullSafeShortName":"542","shortName":"542","textColor":"FFFFFF","type":3,"url":"https://www.soundtransit.org/542"},{"agencyId":"40","color":"2B376E","description":"","id":"40_532","longName":"Everett - Bellevue","nullSafeShortName":"532","shortName":"532","textColor":"FFFFFF","type":3,"url":"https://www.soundtransit.org/ride-with-us/routes-schedules/532"},{"agencyId":"40","color":"2B376E","description":"","id":"40_535","longName":"Lynnwood - Bellevue","nullSafeShortName":"535","shortName":"535","textColor":"FFFFFF","type":3,"url":"https://www.soundtransit.org/ride-with-us/routes-schedules/535"},{"agencyId":"40","color":"9AB6D3","description":"S Line runs between King Street Station and Tacoma Dome or Lakewood Stations weekdays","id":"40_SNDR_TL","longName":"Seattle - Tacoma/Lakewood","nullSafeShortName":"S Line","shortName":"S Line","textColor":"000000","type":2,"url":"https://www.soundtransit.org/S"},{"agencyId":"40","color":"2B376E","description":"Auburn - Redmond","id":"40_102734","longName":"","nullSafeShortName":"566","shortName":"566","textColor":"FFFFFF","type":3,"url":"https://www.soundtransit.org/566"},{"agencyId":"40","color":"2b376e","description":"","id":"40_560","longName":"Bellevue - Sea-Tac - W. Seattle","nullSafeShortName":"560","shortName":"560","textColor":"ffffff","type":3,"url":"https://www.soundtransit.org/560"},{"agencyId":"40","color":"2b376e","description":"","id":"40_574","longName":"Lakewood - SeaTac","nullSafeShortName":"574","shortName":"574","textColor":"ffffff","type":3,"url":"https://www.soundtransit.org/574"},{"agencyId":"40","color":"2b376e","description":"","id":"40_577","longName":"Federal Way - Seattle","nullSafeShortName":"577","shortName":"577","textColor":"ffffff","type":3,"url":"https://www.soundtransit.org/577"},{"agencyId":"40","color":"2b376e","description":"","id":"40_578","longName":"Puyallup - Seattle","nullSafeShortName":"578","shortName":"578","textColor":"ffffff","type":3,"url":"https://www.soundtransit.org/578"},{"agencyId":"40","color":"9AB6D3","description":"N Line runs between Everett Station and King Street Station weekdays","id":"40_SNDR_EV","longName":"Everett - Seattle","nullSafeShortName":"N Line","shortName":"N Line","textColor":"000000","type":2,"url":"https://www.soundtransit.org/N"},{"agencyId":"40","color":"2b376e","description":"","id":"40_580","longName":"Puyallup / Lakewood","nullSafeShortName":"580","shortName":"580","textColor":"ffffff","type":3,"url":"https://www.soundtransit.org/580"},{"agencyId":"40","color":"2b376e","description":"","id":"40_586","longName":"Tacoma - U. District","nullSafeShortName":"586","shortName":"586","textColor":"ffffff","type":3,"url":"https://www.soundtransit.org/586"},{"agencyId":"40","color":"2b376e","description":"","id":"40_590","longName":"Tacoma - Seattle","nullSafeShortName":"590","shortName":"590","textColor":"ffffff","type":3,"url":"https://www.soundtransit.org/590"},{"agencyId":"40","color":"2b376e","description":"","id":"40_592","longName":"Olympia/DuPont - Seattle","nullSafeShortName":"592","shortName":"592","textColor":"ffffff","type":3,"url":"https://www.soundtransit.org/592"},{"agencyId":"40","color":"2b376e","description":"","id":"40_594","longName":"Lakewood - Seattle","nullSafeShortName":"594","shortName":"594","textColor":"ffffff","type":3,"url":"https://www.soundtransit.org/594"},{"agencyId":"40","color":"2b376e","description":"","id":"40_595","longName":"Gig Harbor - Seattle","nullSafeShortName":"595","shortName":"595","textColor":"ffffff","type":3,"url":"https://www.soundtransit.org/595"},{"agencyId":"40","color":"2b376e","description":"","id":"40_596","longName":"Bonney Lake - Sumner","nullSafeShortName":"596","shortName":"596","textColor":"ffffff","type":3,"url":"https://www.soundtransit.org/596"},{"agencyId":"40","color":"2B376E","description":"Woodinville - Roosevelt Link Station","id":"40_100232","longName":"Woodinville - Seattle","nullSafeShortName":"522","shortName":"522","textColor":"FFFFFF","type":3,"url":"https://www.soundtransit.org/522"},{"agencyId":"40","color":"2B376E","description":"Redmond - Seattle","id":"40_100236","longName":"Redmond - Seattle","nullSafeShortName":"545","shortName":"545","textColor":"FFFFFF","type":3,"url":"https://www.soundtransit.org/545"},{"agencyId":"40","color":"28813F","description":"1 Line runs between Northgate Station and Angle Lake Station seven days a week","id":"40_100479","longName":"Northgate - Angle Lake","nullSafeShortName":"1 Line","shortName":"1 Line","textColor":"FFFFFF","type":0,"url":"https://www.soundtransit.org/1"},{"agencyId":"40","color":"007CAD","description":"2 Line runs between South Bellevue Station and Redmond Tech Station seven days a week","id":"40_2LINE","longName":"South Bellevue - Redmond Tech Station","nullSafeShortName":"2 Line","shortName":"2 Line","textColor":"FFFFFF","type":0,"url":"https://www.soundtransit.org/2"},{"agencyId":"40","color":"2B376E","description":"Issaquah - Seattle","id":"40_100240","longName":"Issaquah - Seattle","nullSafeShortName":"554","shortName":"554","textColor":"FFFFFF","type":3,"url":"https://www.soundtransit.org/554"},{"agencyId":"40","color":"2B376E","description":"Bellevue - Seattle","id":"40_100239","longName":"Bellevue - Seattle","nullSafeShortName":"550","shortName":"550","textColor":"FFFFFF","type":3,"url":"https://www.soundtransit.org/550"},{"agencyId":"40","color":"2B376E","description":"Issaquah-University District","id":"40_100451","longName":"Issaquah - Northgate","nullSafeShortName":"556","shortName":"556","textColor":"FFFFFF","type":3,"url":"https://www.soundtransit.org/556"},{"agencyId":"40","color":"F38B00","description":"T Line runs between Tacoma Dome Station and St Joseph Station seven days a week","id":"40_TLINE","longName":"Tacoma Dome - St Joseph","nullSafeShortName":"T Line","shortName":"T Line","textColor":"000000","type":0,"url":"https://www.soundtransit.org/T"},{"agencyId":"40","color":"2B376E","description":"","id":"40_510","longName":"Everett - Seattle","nullSafeShortName":"510","shortName":"510","textColor":"FFFFFF","type":3,"url":"https://www.soundtransit.org/ride-with-us/routes-schedules/510"},{"agencyId":"40","color":"2B376E","description":"","id":"40_512","longName":"Everett - Northgate Station","nullSafeShortName":"512","shortName":"512","textColor":"FFFFFF","type":3,"url":"https://www.soundtransit.org/ride-with-us/routes-schedules/512"},{"agencyId":"40","color":"2B376E","description":"","id":"40_513","longName":"Seaway Transit Ctr - Northgate Station","nullSafeShortName":"513","shortName":"513","textColor":"FFFFFF","type":3,"url":"https://www.soundtransit.org/ride-with-us/routes-schedules/513"}],"references":{"agencies":[{"disclaimer":"","email":"[email protected]","fareUrl":"https://www.soundtransit.org/ride-with-us/how-to-pay/fares","id":"40","lang":"en","name":"Sound Transit","phone":"1-888-889-6368","privateService":false,"timezone":"America/Los_Angeles","url":"https://www.soundtransit.org"}],"routes":[],"situations":[],"stopTimes":[],"stops":[],"trips":[]}},"text":"OK","version":2}
1 change: 1 addition & 0 deletions src/api/example_responses/routes-for-location.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":200,"currentTime":1710977677779,"data":{"limitExceeded":true,"list":[{"agencyId":"1","color":"","description":"UW/Cascadia College - University District","id":"1_100214","longName":"","nullSafeShortName":"372","shortName":"372","textColor":"","type":3,"url":"https://kingcounty.gov/en/dept/metro/routes-and-service/schedules-and-maps/372.html"},{"agencyId":"1","color":"","description":"Univ Dist-Montlake-Capitol Hill-Downtown Seattle","id":"1_100223","longName":"","nullSafeShortName":"43","shortName":"43","textColor":"","type":3,"url":"https://kingcounty.gov/en/dept/metro/routes-and-service/schedules-and-maps/043.html"},{"agencyId":"1","color":"","description":"Lake City - University District","id":"1_100254","longName":"","nullSafeShortName":"65","shortName":"65","textColor":"","type":3,"url":"https://kingcounty.gov/en/dept/metro/routes-and-service/schedules-and-maps/065.html"},{"agencyId":"1","color":"","description":"University District - Eastlake - Downtown Seattle","id":"1_100264","longName":"","nullSafeShortName":"70","shortName":"70","textColor":"","type":3,"url":"https://kingcounty.gov/en/dept/metro/routes-and-service/schedules-and-maps/070.html"},{"agencyId":"1","color":"","description":"Jackson Park - Univ District","id":"1_100267","longName":"","nullSafeShortName":"73","shortName":"73","textColor":"","type":3,"url":"https://kingcounty.gov/en/dept/metro/routes-and-service/schedules-and-maps/073.html"},{"agencyId":"1","color":"","description":"Northgate - Lake City - Sand Point - Univ District","id":"1_100269","longName":"","nullSafeShortName":"75","shortName":"75","textColor":"","type":3,"url":"https://kingcounty.gov/en/dept/metro/routes-and-service/schedules-and-maps/075.html"},{"agencyId":"1","color":"","description":"Madrona - Lakeside School","id":"1_100346","longName":"","nullSafeShortName":"988","shortName":"988","textColor":"","type":3,"url":"https://kingcounty.gov/en/dept/metro/routes-and-service/schedules-and-maps/988.html"},{"agencyId":"1","color":"","description":"Lake City - Northgate - University District","id":"1_102730","longName":"","nullSafeShortName":"20","shortName":"20","textColor":"","type":3,"url":"https://kingcounty.gov/en/dept/metro/routes-and-service/schedules-and-maps/020.html"},{"agencyId":"1","color":"","description":"Greenlake - University District","id":"1_102732","longName":"","nullSafeShortName":"79","shortName":"79","textColor":"","type":3,"url":"https://kingcounty.gov/en/dept/metro/routes-and-service/schedules-and-maps/079.html"},{"agencyId":"40","color":"28813F","description":"1 Line runs between Northgate Station and Angle Lake Station seven days a week","id":"40_100479","longName":"Northgate - Angle Lake","nullSafeShortName":"1 Line","shortName":"1 Line","textColor":"FFFFFF","type":0,"url":"https://www.soundtransit.org/1"}],"outOfRange":false,"references":{"agencies":[{"disclaimer":"","email":"","fareUrl":"https://kingcounty.gov/en/dept/metro/fares-and-payment/prices","id":"1","lang":"EN","name":"Metro Transit","phone":"206-553-3000","privateService":false,"timezone":"America/Los_Angeles","url":"https://kingcounty.gov/en/dept/metro"},{"disclaimer":"","email":"[email protected]","fareUrl":"https://www.soundtransit.org/ride-with-us/how-to-pay/fares","id":"40","lang":"en","name":"Sound Transit","phone":"1-888-889-6368","privateService":false,"timezone":"America/Los_Angeles","url":"https://www.soundtransit.org"}],"routes":[],"situations":[],"stopTimes":[],"stops":[],"trips":[]}},"text":"OK","version":2}
1 change: 1 addition & 0 deletions src/api/example_responses/schedule-for-route-1_100223.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/api/example_responses/schedule-for-stop-1_75403.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/api/example_responses/shape-1_10002005.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":200,"currentTime":1710978057810,"data":{"entry":{"length":347,"levels":"","points":"yfraH`djiVAB?F?DFLCJGFGBcDbAg@PIBE@GDG@GDWPOH[VsAz@c@\\y@h@aAn@g@\\KJq@`@c@Zw@h@GDKHEBE?GBC?E?E?m@?m@?iA?aB?E?G?I?I@GBGBGBGDGBIHGDEFGHGHEJGHELCHENAJCDANC^CZ?vC?|EA~A?V@R@L@L@JBL@F@DBJBHDHDJFHDHDHFBFHFBHDFDF@HBF?H@F?r@?pDBf@?zEHj@?xDB`ABnCDT?ApE?vA?lBAJ?JCR?fEAbA?rC?h@ClE?v@?V?L?j@BxB?dG?~@@jD?V?dGAdA?|D?bG?x@@~BBdG@pF?P?lD?jA?dC?hC?~A?`@?bC?`C?bCAbC?~B?hB?\\@jC?jA?@?r@ArA?b@IDEFEDG?y@@x@jCX`AJj@Gl@C~EAdG?rA?pA?VCd@?DAb@A\\?vB?X@L@HBFBHBHBDDFHHLHTPHHD@DFDJRj@j@lBn@lBl@nBV|@Tr@n@jBh@fBN^JX@DTr@zA|EXz@bA`Dl@rBn@lBZ`ANj@Vz@bA|Cl@rBl@jBn@nBl@pBl@jB\\bANh@d@zAFPmCbCeEvDiDxC]XwChCm@j@kCbCIFGFGHIPMTOVKRO`@aB`DkBvDk@jAyCdGyCbGiAtBoAjCmBzDoBxD_AlBm@jAmBzDmBxDMb@k@hAIPAD?dF?@?p@@xA?d@@bCAdC?pBCDGBIDO?aAAE?E?MCG?cB?iF?iFCiE?_@?cGC_@?mC?CbGq@?yB?}C?O?mDAq@?_@?Q?OAMCOAS?[?kBCk@?U?kBAkDAe@?K?w@?Y?M?I@G@EBGDEBEHKVAh@?tB@j@AxA?x@?jA?d@?`B?bC?`@?fB?p@?rA?P?pB?dC?P?rB?`A?hAA`CoFEa@?oE?oFCk@?}HEk@?Q?m@CcG?q@?i@?kCCcCAk@?qA?S?O?o@Cq@?y@?U?AnA?xDlA@N?"},"references":{"agencies":[],"routes":[],"situations":[],"stopTimes":[],"stops":[],"trips":[]}},"text":"OK","version":2}
1 change: 1 addition & 0 deletions src/api/example_responses/stop-1_75403.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":200,"currentTime":1710978183498,"data":{"entry":{"code":"75403","direction":"SW","id":"1_75403","lat":47.654503,"locationType":0,"lon":-122.30513,"name":"East Stevens Way NE & Benton Ln","parent":"","routeIds":["1_100225","1_100259","1_100214"],"staticRouteIds":["1_100225","1_100259","1_100214"],"wheelchairBoarding":"ACCESSIBLE"},"references":{"agencies":[{"disclaimer":"","email":"","fareUrl":"https://kingcounty.gov/en/dept/metro/fares-and-payment/prices","id":"1","lang":"EN","name":"Metro Transit","phone":"206-553-3000","privateService":false,"timezone":"America/Los_Angeles","url":"https://kingcounty.gov/en/dept/metro"}],"routes":[{"agencyId":"1","color":"","description":"Loyal Heights - University District","id":"1_100225","longName":"","nullSafeShortName":"45","shortName":"45","textColor":"","type":3,"url":"https://kingcounty.gov/en/dept/metro/routes-and-service/schedules-and-maps/045.html"},{"agencyId":"1","color":"","description":"Northgate - Roosevelt - University District","id":"1_100259","longName":"","nullSafeShortName":"67","shortName":"67","textColor":"","type":3,"url":"https://kingcounty.gov/en/dept/metro/routes-and-service/schedules-and-maps/067.html"},{"agencyId":"1","color":"","description":"UW/Cascadia College - University District","id":"1_100214","longName":"","nullSafeShortName":"372","shortName":"372","textColor":"","type":3,"url":"https://kingcounty.gov/en/dept/metro/routes-and-service/schedules-and-maps/372.html"}],"situations":[],"stopTimes":[],"stops":[],"trips":[]}},"text":"OK","version":2}
Loading

0 comments on commit 99f5c17

Please sign in to comment.