Referrencing
Every object is linked to other objects in some way or another. For example, Listings have many agents, builders, brokerages, interior designers, etc., whereas agents, builders, and brokerages also have many listings.
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.
Similarly, a run to getAProfile
for Builder with ID 5fH9CC8jgOxPuxqyMk70
will show Listing with ZXGJ8B
as its referrence.
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.