V2: Weblisting V2

2. Weblistings

The following document is valid for Propertybase versions 2.8.5.8 - 2.9.9.

If you have a previous version, please open a case and request an update for your org.

Check out this link, to identify your Propertybase version: Identifying the Propertybase version

Getting started

To get the weblistings feature enabled for your org, please send a message to support@propertybase.com. Our support staff will take care of the activation and will give you any additional information needed to start developing your weblisting integration, e.g. the endpoint Url for accessing the API.

Technical Documentation


Send a search request to the weblisting service


Limitations:
  • you can receive a maximum of 200 inventories with one single call

From within your website code, send an http post or get request with a combination of the following parameters to the weblisting endpoint:
 
 

Parameter  mandatory (Y/N) value(s)  example(s) default (*) annotations
token y String token=24230928347owsadf,==239487woe x must match the token in the LeanParameter 'webserviceWeblisting_securityToken'
page n Integer page=2 1 First page is 1
page_limit n Integer page_limit=10 200 default value can be configured in LeanParameter 'webserviceWeblisting_pageLimit'. 200 is maximum.
fields n Propertybase API field names, comma separated fields=Id,Name,pb__UnitType__c,Area__c Id all fields which should be included in the XML result
sort n Propertybase API field name + ASC or DESC sort=pb__PurchaseListPrice__c%20ASC Name ASC use URL encoding for white space (%20)
null n String null=unselected any Value to ignore the field in your search
record_type n Propertybase Inventory Record Types, comma separated record_type=6_Unit,3_Plot 6_Unit limit Record Types to be returned. Use the Developer name of the Record Type.
get_images n Boolean get_images=false TRUE set to false to exclude images and media assets from the result
Propertybase_ApiFieldName n variable pb__IsForSale__c=true   for 'equals' matches
min_Propertybase_ApiFieldName n Integer or Double min_pb__PurchaseListPrice__c=100   for 'equals or greater than' (>=) matches
max_Propertybase_ApiFieldName n Integer or Double max_pb__PurchaseListPrice__c=2000   for 'equals or less than' (<=) matches 
like_Propertybase_ApiFieldName n String like_name=6383    for 'contains' matches (name contains 6383)
in_Propertybase_ApiFieldName n Strings, comma separated in_pb__UnitBedrooms__c=Studio,1,2,3   for IN matches in your search query, means, the field must be equal to one of the given values (pb__UnitBedrooms__c is 1,2,3 or Studio)
(*) default is used if parameter is missing
 

If you want to limit the result to items only, which are listed and/or available, make sure to add pb__IsListed__c=true and/or pb__isAvailable__c=true to your query.
 
 
You will receive an XML document as the response, which you can parse in your website code and display the information as required.
 

XML Response

 

<?xml version="1.0" encoding="UTF-8"?>

<searchResult>

    <pagination>
        <itemsPerPage>{Number of Inventories per Page}</itemsPerPage>
        <numberOfItems>{Number of Inventories}</numberOfItems>
    </pagination>

    <itemList>
        <item>
            {Requested Salesforce fields e.g:}
            <Id>{Salesforce Id}</Id>
            <Name>{Name}</Name>
            <pb__IsForSale__c>{e.g.}false</pb__IsForSale__c>
            <pb__IsForLease__c>{e.g.}true</pb__IsForLease__c>
            <pb__ItemDescription__c>{Item Description}</pb__ItemDescription__c>
            <pb__PurchaseListPrice__c>{Item List Price e.g.:}2000000.00</pb__PurchaseListPrice__c>
            <CurrencyIsoCode>{Currency Iso Code e.g:}EUR</CurrencyIsoCode>
            <pb__UnitBedrooms__c>{Number of Bedrooms}</pb__UnitBedrooms__c>
            
            <asset>
                <Id>{internal Propertybase InventoryAsset Id}</Id>
                <category>{Images, Videos or Documents}</category>
                <isExternalLink>false</isExternalLink>
                <title>{title}</title>
                <filename>{original name of the uploaded file}</filename>
                <url>{full url to image/video/document}</url>
                <thumbnailUrl>{full url to thumbnail image}</thumbnailUrl>
                <midresUrl>{full url to thumbnail image}</midresUrl>
                <tags>{comma separated tags}</tags>
                <mimeType>{e.g. image/jpeg}</mimeType>
            </asset>

            <asset>
                <Id>{internal Propertybase InventoryAsset Id}</Id>
                <category>{Images, Videos or Documents}</category>
                <isExternalLink>true</isExternalLink>
                <title>{title}</title>
                <url>{full url to image/video/document}</url>
                <tags>{comma separated tags}</tags>
            </asset>

            <asset>
               {...}
            </asset>
            {more assets ...}

        </item>

        <item>
            {...}
        </item>
        {more items ...}

    </itemList>

</searchResult>

 

Notes on Assets:

  • There are currently three categories of assets: Images, Videos and Documents.
  • thumbnail and midres url are available for Images only.
  • If you are using links to external resources like e.g. videos on Vimeo or Youtube, there will be two different kind of assets in your result. The external resources can be identified by the tag isExternalLink which has a value of true. External resources only have a subset of information compared to internal resources: category, title, url and tags. They never have thumbnails, midres images, filenames or a mimeType. Check out the example above to see the difference between internal and external assets.

FAQ

Question Answer
How can I query for more than one location (my Location field in Propertybase is Area__c) Use an IN query. The correct parameter for your example is in_Area__c=Location1,Location2
Ok. I like to query pb__UnitBedrooms__c. Is min_UnitBedrooms__c=1 and max_UnitBedrooms__c=10 correct? pb__UnitBedrooms__c is a picklist field. You cannot use >= <= matches on picklist values. Please use in_pb__UnitBedrooms__c=1,2,3,4,5,6,7,8,9,10 instead.
How can I identify the API field names? Check out this link: 9. Identifying API fieldnames

Examples

Standard query for listed properties

  • fields=Id,Name,pb__IsForSale__c,pb__IsForLease__c,pb__ItemDescription__c,pb__PurchaseListPrice__c,
    CurrencyIsoCode,pb__UnitBedrooms__c,pb__TotalAreaSqft__c,pb__UnitType__c
  • token={Your Token}
  • pb__IsListed__c=true
  • pb__IsForSale__c=true
  • pb__PlannedUsage__c=any
  • pb__UnitType__c=any
  • min_pb__PurchaseListPrice__c=0
  • max_pb__PurchaseListPrice__c=any
  • in_pb__UnitBedrooms__c=1,2,3,4
  • sort=pb__PurchaseListPrice__c ASC
 
Full example query (can be executed in any browser):
 
 
http://{Your Force.com Sites Endpoint URL}/pb__WebserviceWeblisting3?token={Token}&fields=Id%2CName%2Cpb__IsForSale__c%2Cpb__IsForLease__c%2Cpb__ItemDescription__c%2Cpb__PurchaseListPrice__c%2CCurrencyIsoCode%2Cpb__UnitBedrooms__c%2Cpb__TotalAreaSqft__c%2Cpb__UnitType__c&pb__IsListed__c=true&pb__IsForSale__c=true&pb__PlannedUsage__c=any&pb__UnitType__c=any&min_pb__PurchaseListPrice__c=0&max_pb__PurchaseListPrice__c=any&in_pb__UnitBedrooms__c=1,2,3,4&sort=pb__PurchaseListPrice__c+ASC
 
 

Standard query with 100 properties per result page, only available properties, no assets/images

  • fields=Id,Name,pb__IsForSale__c,pb__IsForLease__c,pb__ItemDescription__c,pb__PurchaseListPrice__c,
    CurrencyIsoCode,pb__UnitBedrooms__c,pb__TotalAreaSqft__c,pb__UnitType__c
  • token={Your Token}
  • page_limit=100
  • page=1 (first result page)
  • get_images=false
  • pb__IsAvailable__c=true
  • pb__IsForSale__c=true
  • pb__PlannedUsage__c=any
  • pb__UnitType__c=any
  • min_pb__PurchaseListPrice__c=0
  • max_pb__PurchaseListPrice__c=any
  • in_pb__UnitBedrooms__c=Studio,1,2,3,4
  • sort=pb__PurchaseListPrice__c ASC

Full example query (can be executed in any browser):

http://{Your Force.com Sites Endpoint URL}/pb__WebserviceWeblisting3?token={Token}&fields=Id%2CName%2Cpb__IsForSale__c%2Cpb__IsForLease__c%2Cpb__ItemDescription__c%2Cpb__PurchaseListPrice__c%2CCurrencyIsoCode%2Cpb__UnitBedrooms__c%2Cpb__TotalAreaSqft__c%2Cpb__UnitType__c&page_limit=100&page=1&get_images=false&pb__IsAvailable__c=true&pb__IsForSale__c=true&pb__PlannedUsage__c=any&pb__UnitType__c=any&min_pb__PurchaseListPrice__c=0&max_pb__PurchaseListPrice__c=any&in_pb__UnitBedrooms__c=Studio,1,2,3,4&sort=pb__PurchaseListPrice__c+ASC

 

PHP Example

Find below a simple PHP script that includes all major features of the weblisting API. The script below should work with all standard customizations of Propertybase v2.x. If you have changed the customization of Propertybase, make sure to change the code, so it refers to your fields and record types.

Powered by Zendesk