jarod
July 26, 2020, 8:27am
1
Greetings,
I’m trying to access the StopPoint by Radius endpoint in Postman but have noticed that it’s returning some unexpected data.
The request is the following (my app_id and app_key have been omitted).
https://api.tfl.gov.uk/Place?type=StopPoint&lat=51.49454&lon=-0.100601&radius=200&categories=
And the response has been
{
"$type": "Tfl.Api.Presentation.Entities.ApiError, Tfl.Api.Presentation.Entities",
"timestampUtc": "2020-07-26T08:16:52.4798949Z",
"exceptionType": "ApiArgumentException",
"httpStatusCode": 400,
"httpStatus": "BadRequest",
"relativeUri": "/Place?type=StopPoint&lat=51.494&lon=-0.100&radius=200&categories=",
"message": "The following place type is not recognised: StopPoint"
}
Is there something I’m doing on my side that I need to fix or is there a server side issue at play here?
Thank you!
nickp
July 26, 2020, 10:51am
2
I think you are using the wrong call: StopPoint is not an entry in /Place/Meta/PlaceTypes (see below). Try using /StopPoint?radius
|1|“BikePoint”|
|2|“Boroughs”|
|3|“Cabwise”|
|4|“CarPark”|
|5|“CensusOutputAreas”|
|6|“CensusSuperOutputAreas”|
|7|“CentralActivityZone”|
|8|“ChargeConnector”|
|9|“ChargeStation”|
|10|“CoachBay”|
|11|“CoachPark”|
|12|“CyclePark”|
|13|“JamCam”|
|14|“OnStreetMeteredBay”|
|15|“OpportunityAreas”|
|16|“OtherCoachParking”|
|17|“OysterTicketShop”|
|18|“RedLightAndSpeedCam”|
|19|“RedLightCam”|
|20|“SpeedCam”|
|21|“TaxiRank”|
|22|“VariableMessageSign”|
|23|“Wards”|
|24|“WaterfreightBridge”|
|25|“WaterfreightDock”|
|26|“WaterfreightJetty”|
|27|“WaterfreightLock”|
|28|“WaterfreightOther Access Point”|
|29|“WaterfreightTunnel”|
|30|“WaterfreightWharf”|
jarod
July 26, 2020, 12:46pm
3
@nickp Thanks for your response but I think there’s something else going on. This is happening with multiple endpoints across the whole system
This call
https://api.tfl.gov.uk/StopPoint?lat=51.49454&lon=-0.100601&stopTypes=NaptanMetroStation&includeDistances=false&radius=200&useStopPointHierarchy=true&modes=
is returning
{
"$type": "Tfl.Api.Presentation.Entities.ApiError, Tfl.Api.Presentation.Entities",
"timestampUtc": "2020-07-26T12:32:37.770496Z",
"exceptionType": "EntityNotFoundException",
"httpStatusCode": 404,
"httpStatus": "NotFound",
"relativeUri": "/StopPoint?lat=51.494&lon=-0.100&stopTypes=NaptanMetroStation&includeDistances=false&radius=200&useStopPointHierarchy=true",
"message": "Resource not found: http://api:8001/StopPoint?lat=51.494&lon=-0.100&stopTypes=NaptanMetroStation&includeDistances=false&radius=200&useStopPointHierarchy=true"
}
I’m guessing the documentation/Postman collection is out of date/being updated
jarod
July 26, 2020, 12:54pm
4
After doing a little more searching it looks like this is the correct URL for what I was
https://api.tfl.gov.uk/Stoppoint?lat=51.5025&lon=-0.1348&stoptypes=NaptanPublicBusCoachTram&radius=300
Thanks to this post for getting me in to the right place.
Looks like the Postman collection and docs need updating but I’m guessing that’s coming
Thanks!