API de Casafari existente · API v1 · References
Get locations typeahead suggestions scoped by country code
https://api.casafari.com/v1/references/locations/typeaheadEnvíe Authorization: Token $CASAFARI_TOKEN con su token de API existente; consulte dónde obtenerlo.
The same path under /api, signed in with a bearer token, is in the REST API reference: POST /api/v1/references/locations/typeahead.
Description
Returns location typeahead suggestions within the given country (ES or PT).
Cuerpo de la solicitud
Content type application/json. Opcional. Tipo: object.
country_codesstring[]obligatorioES PTnamestringobligatoriosizeintegerlangstringen pt es deEjemplo de solicitud
Solo marcadores de posición: reemplace el token y los valores por los suyos.
curl -X POST "https://api.casafari.com/v1/references/locations/typeahead" \
-H "Authorization: Token $CASAFARI_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"country_codes": [
"PT"
],
"name": "lisboa",
"lang": "en",
"size": 30
}'Respuestas
200
Tipo: object.
Show the response shape (8 fields)
typeaheadobject[]obligatorio5 propiedades
location_idintegerobligatorionamestringobligatoriomatched_namestringobligatorioadministrative_levelstringobligatoriobreadcrumbsobject[]obligatorio2 propiedades
location_idintegerobligatorionamestringobligatorioEjemplo de la descripción de la API
{
"typeahead": [
{
"location_id": 1296,
"name": "Lisboa",
"matched_name": "Lisboa",
"administrative_level": "Distrito",
"breadcrumbs": [
{
"location_id": 499,
"name": "Portugal"
},
{
"location_id": 1296,
"name": "Lisboa"
}
]
}
]
}401 No autorizado
Tipo: object.
Mostrar la estructura de la respuesta (1 campo)
detailstring403 Prohibido
Tipo: object.
Mostrar la estructura de la respuesta (1 campo)
detailstring