Get a unit by ID
const url = 'https://agent-dev.azizdubai.com/units/1';const options = {method: 'GET', headers: {'X-API-Key': '<X-API-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://agent-dev.azizdubai.com/units/1 \ --header 'X-API-Key: <X-API-Key>'Returns the unit with its project, developer, area, floor plan and
preference tags. price is expressed in the key’s prices.
A unit is visible only while its project is visible: if the project is
a draft or has been deleted, the response is 404, in the same way as
for a non-existent ID.
The response is the underlying data model as is, so the nested
project.company and project.author objects use PascalCase keys.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Unit ID.
Responses
Section titled “Responses”The unit.
object
The shape depends on the operation.
The full unit — the response of GET /units/{id}.
object
The project within GET /units/{id}: its own fields are in
snake_case, except CreatedAt and UpdatedAt, which are in
PascalCase; the nested company and author objects are entirely in
PascalCase.
object
The company as returned within GET /units/{id}: the underlying data
model with PascalCase keys.
object
2 — agency
An uploaded file, with all fields. Files are served not by this
service but by the host configured in STATIC_BASE_URL, and without
a key.
object
Relative storage path.
Ready-to-use link: STATIC_BASE_URL + path (the full path is
appended). Equal to path when the variable is not set.
The user as the underlying data model, also with PascalCase keys.
object
object
An uploaded file, with all fields. Files are served not by this
service but by the host configured in STATIC_BASE_URL, and without
a key.
object
Relative storage path.
Ready-to-use link: STATIC_BASE_URL + path (the full path is
appended). Equal to path when the variable is not set.
An uploaded file, with all fields. Files are served not by this
service but by the host configured in STATIC_BASE_URL, and without
a key.
object
Relative storage path.
Ready-to-use link: STATIC_BASE_URL + path (the full path is
appended). Equal to path when the variable is not set.
An uploaded file, with all fields. Files are served not by this
service but by the host configured in STATIC_BASE_URL, and without
a key.
object
Relative storage path.
Ready-to-use link: STATIC_BASE_URL + path (the full path is
appended). Equal to path when the variable is not set.
0 — studio.
1 — announced, 2 — EOI, 3 — start of sales, 4 — on sale, 5 — out of stock.
1 — unfurnished, 2 — partially furnished, 3 — fully furnished, 4 — premium.
In the key’s prices.
Area in m².
An uploaded file, with all fields. Files are served not by this
service but by the host configured in STATIC_BASE_URL, and without
a key.
object
Relative storage path.
Ready-to-use link: STATIC_BASE_URL + path (the full path is
appended). Equal to path when the variable is not set.
The link between a unit and a tag from the catalogue.
object
A unit tag from the global catalogue.
object
Example
{ "status": "success", "data": { "project": { "company": { "CompanyType": 2 }, "author": { "Type": 0 } }, "status": 1, "furnishing": 1, "preferences": [ { "preference": { "name": "Sea view" } } ] }}A parameter or the request body failed validation.
object
Human-readable message.
Examples
{ "status": "error", "message": "id must be a positive integer"}The key is missing (missing api key) or invalid (invalid api key).
The latter covers unknown, revoked and deleted keys. Every operation
requires a key, so any request without one receives this response.
object
Human-readable message.
Examples
{ "status": "error", "message": "invalid api key"}The key is valid, but it is restricted to a list of domains and the
request’s Origin (or Referer) does not match any of them; or the
key’s agency has no approved licence.
object
Human-readable message.
Examples
{ "status": "error", "message": "origin is not allowed for this api key"}{ "status": "error", "message": "agency license is required: upload a company license and wait for its approval"}No record exists with the given ID — or it belongs to a developer the key’s agency has no approved contract with.
object
Human-readable message.
Examples
{ "status": "error", "message": "unit not found"}An unexpected error. The cause is logged; a generic message is returned.
object
Human-readable message.
Examples
{ "status": "error", "message": "internal server error"}