RESTful API of Locations Bounded Context
Headers
As this API is working with JSON every request must add the following headers:
Accept: application/json
And for requests with body:
Content-Type: application/json
Neighbourhoods ¶
View neighbourhoods ¶
View allGET/locations/neighbourhoods{?cityId}
Example URI
GET https://listings.spotahome.com/locations/neighbourhoods?cityId=seville
URI Parameters
- cityId
string(optional) Example: seville
Request
Headers
Authorization: aa.bb.ccResponse
200Headers
Content-Type: application/jsonBody
[
{
"id": "macarena",
"cityId": "seville",
"name": "Macarena"
}
]Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"enum": [
"macarena"
]
},
"cityId": {
"type": "string",
"enum": [
"seville"
]
},
"name": {
"type": "string",
"enum": [
"Macarena"
]
}
},
"required": [
"id",
"cityId",
"name"
],
"additionalProperties": false
}
}Response
401Headers
Content-Type: application/jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Response
500Headers
Content-Type: application/jsonBody
{
"detail": "Internal Server Error",
"status": 500,
"title": "Internal Server Error",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}View neighbourhoods ¶
View oneGET/locations/neighbourhoods/{id}
Example URI
GET https://listings.spotahome.com/locations/neighbourhoods/9f5466d2-c6fe-4940-8c10-33a4e38046ee
URI Parameters
- id
string(optional) Example: 9f5466d2-c6fe-4940-8c10-33a4e38046ee
Request
Headers
Authorization: aa.bb.ccResponse
200Headers
Content-Type: application/jsonBody
{
"id": "macarena",
"cityId": "seville",
"name": "Macarena",
"_links": {
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"cityId": {
"type": "string"
},
"name": {
"type": "string"
},
"_links": {
"type": "object",
"properties": {
"self": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
}
}
}
},
"required": [
"id",
"cityId",
"name",
"_links"
]
}Response
401Headers
Content-Type: application/jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Response
404Headers
Content-Type: application/jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Response
500Headers
Content-Type: application/jsonBody
{
"detail": "Internal Server Error",
"status": 500,
"title": "Internal Server Error",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}