Skip to main content

API

The api object allows you to add/ remove builds. Below are examples to add a new build. You can pass all available attributes to build the Single Family home, Multi Family Home and Quick Possessions

Single Family Home

try {
buildId = await window.Ownly.api.build.add({
"community-id": "community1",
"community-external-id" : "community1"
"community-name": "New Community 1",
"model-id": "model1",
"model-external-id":"model1",
"model-name": "New Model 1",
"model-size": "1567",
"model-beds": "3",
"model-baths": "2.5",
"model-price": "650000",
"model-image": "/assets/images/model-101.jpg",
"model-option1-floor": "Main Floor",
"model-option1-floor-image":"/assets/images/main-floor.jpg",
"model-option1-group": "Kitchen",
"model-option1-name": "Spice Kitchen",
"model-option1-price": "1000",
"model-option2-floor": "Main Floor",
"model-option2-group": "Mudroom",
"model-option2-name": "Mudroom with Bench",
"model-option2-price": "500",
});
window.Ownly.widget.open(buildId);
console.log(`Build added... id=[${buildId}]`);
} catch (e) {
console.log("Error while adding build...", e);
}

Multi Family Home

try {
buildId = await window.Ownly.api.build.add({
"project-id": "project2",
"project-name": "New Project 2",
"building-id": "building2",
"building-name": "New Building 2",
"unit-id": "unit2",
"unit-name": "New Unit 2",
"unit-image": "/images/precise-logo.png",
"unit-size": "930",
"unit-beds": "2",
"unit-baths": "2",
"unit-floor": "19",
"unit-price": "850000",
"unit-option1-floor": "Main Floor",
"unit-option1-group": "Kitchen",
"unit-option1-name": "Spice Kitchen",
"unit-option1-price": "1000",
"unit-option2-floor": "Main Floor",
"unit-option2-group": "Mudroom",
"unit-option2-name": "Mudroom with Bench",
"unit-option2-price": "500",
"package-name": "Exclusive",
"package-price": "10000",
"palette-name": "Nordic Clean",
"palette-price": "5000",
});
window.Ownly.widget.open(buildId);
console.log(`Build added... id=[${buildId}]`);
} catch (e) {
console.log("Error while adding build...", e);
}

Quick Posession Home

try {
buildId = await window.Ownly.api.build.add({
"listing-external-id": "quickPossession9",
"listing-description":
"When building a new home doesn’t suit your plans,quick possession homes are an excellent, turnkey alternative.",
"listing-address": "Test address",
"listing-community-id": "LpewPE7J",
"listing-community-name": "Belmont",
"listing-community-external-id" : "community1"
"listing-model-id": "b2rpZDey",
"listing-model-name": "Manhattan",
"listing-model-external-id":"model1",
"listing-price": "412000",
"listing-size": "2406",
"listing-beds": "4",
"listing-baths": "3",
"listing-image":
"https://ownly-new-ui-3.s3.ca-central-1.amazonaws.com/models/328/cfd5b1fd-c553-4b10-9c96-70253cb17430.png",
"listing-url": "",
});
window.Ownly.widget.open(buildId);
console.log(`Build added... id=[${buildId}]`);
} catch (e) {
console.log("Error while adding build...", e);
}

Existing Build

Below is another example for referencing an existing build that is already in Ownly.

try {
buildId = await window.Ownly.api.build.add({
"community-id": "LpewPE7J",
"model-id": "Lpewl27J",
});
window.Ownly.widget.open(buildId);
console.log(`Build added... id=[${buildId}]`);
} catch (e) {
console.log("Error while adding build...", e);
}

Retrieve Build URL

You can also retrieve the URL of the build.

var buildLink = Ownly.api.build.getUrl(YOUR_BUILD_ID);

Remove Build

Also, you can remove the build added.

Ownly.api.build.remove(YOUR_BUILD_ID);