Snippets

Realhub Systems Realhub Instant XML Sync / Media Vendor API

Created by Accounts Realhub last modified

Base Urls

Staging - https://app.realhublive.com/

Production - https://www.realhubapp.com/

Overview

The instant sync / media vendor API can be used to instantly create campaigns in Realhub by performing a POST request with valid REAXML. The campaign will be created and the API will return a link that can be followed to instantly log the user in to Realhub and be redirected to the newly created campaign.

The same API can be used to export media and ad copy from Realhub in to the user's Portal/CRM.

Authentication

Authentication is handled on a per office level. Realhub will supply you with a username which is reused for all requests and a unique token/password per agency.

Pushing a Listing to Realhub

To push a listing to Realhub use the following endpoint:

integration/media_vendor/:username/import_listing

Sample request:

curl -X POST integration/media_vendor/:username/import_listing \
  -F xmlData={{ xml }} \
  -F autoLogonUserName={{ username }} \
  -F autoLogonUserPassword={{ password }} \
  -F autoLogonUserEmail={{ user.email }} \
  -F import_media=true

Sample import response:

<?xml version="1.0"?>
<Results xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Property>
        <UniqueID>1P1952</UniqueID>
        <Status>Success</Status>
        <Type>Add</Type>
        <Details>
            <PropertyId>195</PropertyId>
            <CampaignId>195</CampaignId>
            <URL>https://www.realhubapp.com/integration/media_vendor/boxdice/agency_login?redirect=http%3A%2F%2Fwww.realhubapp.com%2Fagency%2Fcampaigns%2F195%2Fedit&amp;token=LOGIN_TOKEN</URL>
            <Address>9/53 Balgowlah Avenue, Balgowlah</Address>
            <Message>Creation of new campaign was a success.</Message>
            <FailureNotificationEmailAddress>notifications@realhub.com.au</FailureNotificationEmailAddress>
            <SuccessNotificationEmailAddress>notifications@realhub.com.au</SuccessNotificationEmailAddress>
        </Details>
    </Property>
    <Message>Processed 1 Property.</Message>
</Results>

Sample import with no creations:

<?xml version="1.0"?>
<Results xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Message>Processed 0 Properties.</Message>
</Results>

Notes

You must use the same username and password in the supplied REAXML for the system to successfully process the request.

<!DOCTYPE propertyList SYSTEM "http://reaxml.realestate.com.au/propertyList.dtd"> <propertyList date="2016-11-18-12:58:32" username="{{ username }}" password="{{ password }}">

Params

Parameter Description
xmlData A valid REAXML file or string with the username and password from above.
autoLogonUserName The supplied portal username / short code
autoLogonUserPassword The agency password / token supplied by Realhub
autoLogonUserEmail The email of the user performing the action
import_media If true, we will import the media in to Realhub

Vendor Details

Please supply vendor details in the REAXML file as per the below example. You can supply multiple vendorDetails nodes.

<vendorDetails>
    <firstname>contact.firstname</firstname>
    <lastname>contact.lastname</lastname>
    <name>contact.firstname contact.lastname</name>
    <salutation>contact.salutation</salutation>
    <mailingTitle>contact.title</mailingTitle>
    <email>contact.email</email>
    <telephone type="mobile">contact.mobile</telephone>
    <telephone type="AH">contact.homePhone</telephone>
    <address>
        <streetNumber>contact.address.streetNumber</streetNumber>
        <street>contact.address.street</street>
        <suburb>contact.address.suburb</suburb>
        <state>contact.address.state</state>
        <postcode>contact.address.postcode</postcode>
    </address>
</vendorDetails>

Exporting Media

You can export campaign media using the following endpoint:

integration/media_vendor/:username/export_campaign_media

Sample request:

curl -X POST integration/media_vendor/:username/export_campaign_media \
  -F LogonCode={{ username }} \
  -F Password={{ password }} \
  -F AgentID={{ agency.id }} \
  -F UniqueID={{ property.id }}

Sample Response:

<?xml version="1.0"?>
<Results xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" PropertyAddressUnitNo="2" PropertyAddressStreetNo="144" PropertyAddressStreetName="Ocean View Drive" PropertyAddressStreetType="Ocean View Drive" PropertyDisplaySuburb="Wamberal" agentID="1332-1" campaignID="60903" uniqueID="1P8668">
    <heading>
        <![CDATA[Property Tagline]]>
    </heading>
    <copy>
        <![CDATA[Property Ad Copy]]>
    </copy>
    <images>
        <image assetID="678971" id="m" type="PHOTO" src="IMAGE_URL"/>
        <image assetID="678972" id="a" type="PHOTO" src="IMAGE_URL"/>
    </images>
</Results>

Notes

Only images marked as Public will be exported.

Params

Parameter Description
AgentID The same ID of the agency supplied when pushing REAXML
LogonCode The supplied portal username / short code
Password The agency password / token supplied by Realhub
UniqueID The unique ID of the property in the CRM/Portal

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.