How to Implement the Post Now Feature (for Property Portals only)
Note: This article is only for Property Portals and assumes you have already completed a one-way integration.
Post Now is designed to:
- Instantly add a listing to a portal
- Provide a link for agents to view the ad
- Provide a way to communicate to the agents when the listing is added successfully
- Remove the delay from adding a listing to having that reflect on a live website
How does it work?
- Masterkey adds two buttons next to your Portal ‘Post Now’ & ‘View Ad’
- When the User clicks the “Post Now” button, Masterkey will send a HTTP request to you with the group code, unit reference number, and listing type
- Use this information to query the normal Portal API and pull the XML details for the listing
Step by Step Instructions
STEP 1: Create a HTML Page
First, create a page that can accept a regular HTTP request. If your portal was called exampleportal.com, then this could be the URL: http://www.exampleportal.com/masterkey/postnow.html
STEP 2: Parse the Variables
Configure your page so it can parse the variables passed to it. For example, on the following page:
Your page should be able to gather this information:
Group Code is 1015
Unit Primary Key is 5197
Type = Sales
Action = Update
STEP 3: Request the XML from Masterkey
Use your access code and the information in Step 2 to request the listing from Masterkey's Portal API as normal. Note: There will only be one listing in the XML. For example, if your access code is 70726C52-0 you might request the following:
For Type = Sales
For Type = Rent
STEP 4: Add the listing to your database
Using your normal new listing process and validations, add the listing to your database. This is exactly the same as using your normal scheduled XML pull from Masterkey.
STEP 5: Send a response to Masterkey
You can then send a response (success / failure) in a simple XML format back to Masterkey.
Masterkey will display one of the follow two messages to the user:
- “Success! <message from portal>” if it’s a success.
- “Failed! <message from portal>” if it’s a failure message.
Simple XML responses
You can use the Simple XML response format for many purposes. For example:
- If an account doesn't exist, reply back with an error.
- If the listing limit is exceeded, reply back with an error.
- If all goes well, reply back with a success message!
The "View Ad" button will display the link provided in the Portal_Listing_URL.
<success>1</success> // 0 = failure, 1 = success
<message>This listing has been instantly uploaded on Example Portal</message> // Any messages will be here
<portal_listing_id>123412</portal_listing_id> // Ignored if error
<portal_listing_url>http://www.propertyportal.com/property/123412.html</portal_listing_url> // Ignored if error
There's a variety of actions that can be used:
- Update - This should only update the details of the listing on the portal.
- Remove - This is an instruction to remove the listing entirely.
- <Portal Option> - Different actions messages can be configured per portal. For example marking a listing as Featured or Refreshing a listing. Contact our support team to configure the portal options.