Weblisting - Show your Listings on your Website Follow
Note: The following instructions explain how to display Propertybase listings on your Website. The integration requires development knowledge. The codes below are just examples and need to be adapted to your Website by a knowledgeable Developer.
What is our Weblisting service?
Using our WebListings service you will be able grab any Listing object information found in Propertybase, such as Listing fields or media (e.g. images, documents, videos [if linked]) and display it on the Website.
Please find the technical documentation below for your Web Developer to use to sync your information to your Website. Your developer can add a search functionality, map search and this can all be designed styled as you like.
WebListings are a means of getting the live data to your Website using the Propertybase API. Where whenever you modify any data in Propertybase, the change is instant on the website. Meaning you don't have to track changes in two places.
Here is a summary of how WebListings work;
- You have a Website where you want to have your listings displayed to the public.
- You fill Propertybase with your Listings and necessary data.
- You activate Webservices in Propertybase and provide your Web Developer with our Technical Documentation.
- Your Web Developer can then grab the data from Propertybase and display it however you specify. It can have the look and feel of your website or any styling you wish.
Set up Notes
- Getting Started - you first need to activate your Webservices for your Propertybase ORG.
-
Sample Website
Want to see how it can look? Visit our "BayAreaBrokers" demo site! You can check out your webservice configuration just by clicking "connect" and see your Propertybase listings!
- The Fields to retrieve in each returned item
- How many items to retrieve (items per result page and number of page)
- The order to retrieve the results
- Whether you want to include links to images and other media files
- And of course the filters that shall be applied to the data in Propertybase as simple http get or post parameters
YYYY-MM-DD HH:mm:ss
Example: 2009-08-08 16:08:00
CreatedDate=[;2011-12-24 17:00:00] (any item that was created before christmas eve )
In the query it looks like this &LastModifiedDate=[;2011-12-24%2017:00:00]
Also make sure, that if you do a "starts with" or "contains" search, that your % is encoded as %25.Example: If you're searching for "name contains London", your search should contain the following filter &name=%25London%25All server script languages have built-in support for URL encoding. Check out this Wikipedia article if you are not sure how to encode your values: http://en.wikipedia.org/wiki/Percent-encoding
XML result
Error
<result> <page>0</page> <listingsPerPage>20</listingsPerPage> <numberOfListings>0</numberOfListings> <fatalError>true</fatalError> <errorMessages> <message>message text</message> ... </errorMessages> <!-- debug messages will only be included if debugmode is set to true--> <debugMessages> <message>message text</message> ... </debugMessages> </result>
Success
<result> <page>0</page> <listingsPerPage>20</listingsPerPage> <numberOfListings>6</numberOfListings> <!-- debug messages will only be included if debugmode is set to true--> <debugMessages> <message>message text</message> ... </debugMessages> <listings> <listing> <data> <id>a0900000762hj83</id> <name>Paradise in Poipu Kauai</name> <pba__ListingPrice_pb__c>1795000.0</pba__ListingPrice_pb__c> ... </data> <media> <images> <image> <title>Ocean View</title> <filename>Hawaii3.jpeg</filename> <tags>Exterior</tags> <mimetype>image/jpeg</mimetype> <url>https://s3.amazonaws.com/propertybase-clients/.../Hawaii3.jpeg</url> <baseurl>https://s3.amazonaws.com/propertybase-clients/...</baseurl> </image> <image> ... </image> ... </images> <videos> <video> <title>Flight over mansion</title> <tags></tags> <mimetype>video/mpeg</mimetype> <external>true</external> <!-- true if video is stored somewhere on the net. false if video is on s3 like the images --> <url>http://youtube.com/...</url> </video> ... </videos> <documents> <!-- similar to videos --> </documents> </media> </listing> ... </listings> </result>
JSON result
{ "page" : 0, "listingsPerPage" : 20, "numberOfListings" : 90, "fatalError" : false, "errorMessages" : [ ], "debugMessages" : [ "querying fields name,pba__Bedrooms_pb__c", "no filter on recordtypes", "order by: CreatedDate DESC", "getImages: true", "getVideos: false", "getDocuments: false", "using default for itemsPerPage: 20", "using default for page: 0" ], "listings" : [ { "data" : { "name" : "Paradise in Poipu Kauai", "pba__Bedrooms_pb__c" : 4.0 },
"images" : [ { "title" : null, "filename" : "original20.jpeg", "tags" : null, "mimetype" : "image/jpeg", "url" : "https://.../4f4b7c5a2df53/original20.jpeg", "baseurl" : "https://.../4f4b7c5a2df53" }, { "title" : null, "filename" : "original1.jpeg", "tags" : null, "mimetype" : "image/jpeg", "url" : "https://.../4f4b7c6d776cf/original1.jpeg", "baseurl" : "https://.../4f4b7c6d776cf"
}, ...],
"videos" : [ ], "documents" : [ ] } },
Before you start you need to find your endpoint and your token here - items 6 & 7
Sample Request #1 - Minimal request:
Fields: Name, Price
Filter: Any Price (0 - )
Debug: enabled
Enter this query into your browser (values not url encoded):
https://yourendpoint/pba__WebserviceListingsQuery?token=yourtoken&fields=name;pba__ListingPrice_pb__c&pba__ListingPrice_pb__c=[0;]&debugmode=true
https://yourendpoint/pba__WebserviceListingsQuery?token=yourtoken&fields=name;pba__ListingPrice_pb__c&CreatedDate=[;2020-12-24 17:00:00]&debugmode=true
Fields: Name, Price, Description, Beds, Baths, Size
Filters: Price between 1,000,000 and 1,500,000
Size greater than 2,500 sqft
Order: lowest price first
Debug: not enabled
Enter this query into your browser (values not url encoded):
https://yourendpoint/pba__WebserviceListingsQuery?token=yourtoken&fields=name;pba__ListingPrice_pb__c;pba__description_pb__c;pba__Bedrooms_pb__c;pba__FullBathrooms_pb__c;pba__totalarea_pb__c&pba__ListingPrice_pb__c=[1000000;1500000]&pba__totalarea_pb__c=[2500;]&orderby=pba__ListingPrice_pb__c;ASC&getdocuments=true&getvideos=true&itemsperpage=25&page=1
The parameter called Fields enables you to request any field from the listing record.
All you need to do is add the field API Name for the Fields you require in the Fields parameter in the query call.
To find out more about how to find the API Names for the required fields please review this help file. API Field Names Help File
2)I get error "field cannot be accessed: myfieldname__c"
The website user does not have permission to access the field . You will need to give permissions to access the field "myfieldname__c".
This will be the error message if you have not given access.
<errorMessages>
<message>field cannot be accessed: myfieldname__c</message>
</errorMessages>
For more information please refer to our Help file on Webservices(click opens in new tab), specifically "Modify Object Settings".
3) Is there a way to exclude a property from the webservices output xml?
Indeed this is possible. You just need to add a field in Propertybase. e.g. Checkbox "List on Website". Then you adjust your web listing query so that it only requests Listings that have a tick in the checkbox.
4) My Price Filter ranges do not work properly
Please double-check if you have entered the filter correctly. You require both a filter from and a filter to,
e.g. to filter listing prices from $0 to $100,000 the filter should be as below
pba__listingprice_pb__c=[0;100000]
If you want to filter all lisitngs with a price greater than $100,000 the filter should be as below
pba__ListingPrice_pb__c=[100000;]
5) Its there possibly anyway to add commas to the money values in the xml output.
We return decimal numbers not formatted strings. -> So every client can adjust it it to his purpose and for instance country.
Depending on your website technology you can format them as you need. e.G.: http://www.php.net/manual/en/function.number-format.php
6) I can not read the listings in my web server.
On cPanel the API doesn’t work unless allow_url_fopen is ON.
7) Do you have a demo website?
Click here to check it out!
8) Do you have code examples for my developer
We have a full working example website repository and every developer should be able to introduce it into your website! You can check out your webservice configuration just by clicking "connect" and see your Propertybase listings!
9) Documents are not showing in the returned data?
Documents are not returned by default. Make sure you have added the Parameter &getdocuments=true to your query call.
10) Videos are not showing in the returned data?
Videos are not returned by default. Make sure you have added the Parameter &getvideos=true to your query call.
11) External Links are not showing in the returned data?
External Links are treated like Videos in the API are not returned by default. Make sure you have added the Parameter &getvideos=true to your query call.
Comments
0 comments
Please sign in to leave a comment.