-
Notifications
You must be signed in to change notification settings - Fork 0
Responses
Mirko edited this page Jun 6, 2018
·
1 revision
You can have one out of multiple JSON responses.
{
"query": "Checkpoint Charlie",
"coordinates": [
{
"latitude": 52.5075459,
"longitude": 13.3903685,
"formatted": "Friedrichstraße 43-45, 10969 Berlin, Deutschland"
},
errors: []
}{
"query": "somethingterriblyinvalid",
"coordinates": [],
"errors": [
{
"provider": "Google",
"message": "No results"
}
]
}If you forget to append an address you will receive a 400 Bad Request.
{
"errors": [
{
"message": "Please provide a geocodable search query (e.g. an address)"
}
]
}All other errors, when happening on the external API side, should be looped through to the front-end via the GeoCodingError.
The error message follows the standard format above (ideally including on which provider's API it occurred).
{
"errors": [
{
"provider": "PROVIDER_NAME",
"errors": [{"message": "ERROR_MESSAGE"}]
}
]
}