To manage this many-to-many relationship at the database level, buildify maintains listings, builders, brokerages, etc. in separate collections. And links them together with referrences.

A run to getProfilesOfListing for listing ID ZXGJ8B will show you all the different profiles to which a listing referrences to.

Listing : ZXGJ8B

{
  "agents": [],
  "salesCentres": [
    "SalesCentres/6lHjY2Z0SoGSqqKsyFa3"
  ],
  "brokerages": [],
  "salesCompanies": [
    "SalesCompanies/lBVB5SvDop3WNC550Jp4"
  ],
  "marketingCompanies": [
    "Marketers/QOWed7CGYBVyYgOaCVxD"
  ],
  "interiorDesigners": [
    "InteriorDesigners/vuLcsotpqYMNwh3Peht7"
  ],
  "communities": [],
  "architects": [
    "Architects/qTVx6Xd9PBd9S6XUPxf1"
  ],
  "builders": [
    "Builders/5fH9CC8jgOxPuxqyMk70"
  ],
  "owners": [],
  "id": "ZXGJ8B"
}

Similarly, a run to getAProfile for Builder with ID 5fH9CC8jgOxPuxqyMk70 will show Listing with ZXGJ8B as its referrence.

Builder: 5fH9CC8jgOxPuxqyMk70

{
  "chargeableConciliations": 0,
  "name": "Diamond Kilmer Developments",
  "listings": [
    "Listings/0WGIV1",
    "Listings/ZXGJ8B"
  ],
  "email": "[[email protected]](/cdn-cgi/l/email-protection)",
  "noticesIssued": 0,
  "rating": 0,
  "totalFreeholdProperties": 0,
  "disciplinaryActivities": 0,
  "review": "",
  "website": "http://diamondkilmer.ca/",
  "totalPossessions": 0,
  "dollarsPaidInClaims": 0,
  "condominiumUnits": 0,
  "logo": "https://storage.googleapis.com/precon-app.appspot.com/ae939a1a-ff6e-46a9-844a-68ac53691820.png",
  "tarionActionOnBehalf": 0,
  "address": "22 Saint Clair Avenue West, 1010, Toronto, Ontario, Canada",
  "breach": 0,
  "contact": 4165191099,
  "outstandingClaimsPaidOwing": 0,
  "path": "Builders/5fH9CC8jgOxPuxqyMk70",
  "id": "5fH9CC8jgOxPuxqyMk70"
}

Similarly, to get all profiles for a listing, you can run multiple getAProfile endpoints for each of the referrences and merge data on the front end. But this can be time-consuming and tedious. To make it easier for you to collate/attach referred data, buildify provides a referrences parameter, which you make use of to let API know that you need profile data attached to the response.

referrences

Array of string, Optional

By default, to limit the response size, endpoints do not attach referred data. You can override this by using this parameter. Suppose you want Builders data attached to the listing object, as shown above.

Your request would look as shown below.

Endpoint replaces the referred path with the corresponding object.


{
     "retrieveAttributes": [
          "name",
          "builders",
          "summary",
          "marketingCompanies"
     ],
     "referrences": [
          "builders"
     ],
     "id": "ZXGJ8B"
}