Back to top

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 all
GET/locations/neighbourhoods{?cityId}

Example URI

GET https://listings.spotahome.com/locations/neighbourhoods?cityId=seville
URI Parameters
HideShow
cityId
string (optional) Example: seville
Request
HideShow
Headers
Authorization: aa.bb.cc
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "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  401
HideShow
Headers
Content-Type: application/json
Body
{
  "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  500
HideShow
Headers
Content-Type: application/json
Body
{
  "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 one
GET/locations/neighbourhoods/{id}

Example URI

GET https://listings.spotahome.com/locations/neighbourhoods/9f5466d2-c6fe-4940-8c10-33a4e38046ee
URI Parameters
HideShow
id
string (optional) Example: 9f5466d2-c6fe-4940-8c10-33a4e38046ee
Request
HideShow
Headers
Authorization: aa.bb.cc
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "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  401
HideShow
Headers
Content-Type: application/json
Body
{
  "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  404
HideShow
Headers
Content-Type: application/json
Body
{
  "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  500
HideShow
Headers
Content-Type: application/json
Body
{
  "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"
  ]
}

Generated by aglio on 03 Dec 2025