Snippets

Realhub Systems Managing Quotes via the Realhub API

Created by Accounts Realhub last modified

API Documentation

Please review the documentation located at for in depth examples:

http://api-docs.realhub.com.au/

Base Urls

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

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

Identifying Your API

Please use the User-Agent header to identify yourself.

Authentication

We can provide a token per agent user so that requests are scoped to their campaigns only.

Requests can then be made by passing the x-auth-token: AUTH_TOKEN header.

http://api-docs.realhub.com.au/#user-authentication

Tokens do not have an expiry but can be revoked at any stage. If authentication fails you can call the /users/auth.json endpoint to retrieve a new token.

Campaign Matching

We have created an endpoint to make it easier to match campaigns based on common data (the portal unique ID).

http://api-docs.realhub.com.au/#search-campaigns

For example, if the portal/crm being used is AgentBox and the unique property ID is AB124 we could perform the following request to find matches:

curl -X GET "api/v2/campaigns/search.json" \
  -H "x-api-token: API_KEY" \
  -F "portal_short_code=agentbox" \
  -F "portal_unique_id=AB124"

This will return an array of possible matches (in most cases it should only be one).

Portal Short Codes

Portal Short Code
AgentBox agentbox
Box+Dice boxdice
LJH Move ljhmove
ListOnce listonce
LockedOn lockedon
Move move
MyDesktop mydesktop
Realhub realhub
Rex rex
Zenu zenu

Retrieving Campaign Quotes

Once you have the campaign ID it is very easy to retrieve an array of associated quotes.

http://api-docs.realhub.com.au/#campaign-quotes

To return quotes for a specific campaign:

curl -X GET "api/v2/campaign_quotes.json?campaign_id={{campaign.id}}&include_campaign_quote_items=true" \
  -H "x-api-token: API_KEY"

You can pass the include_campaign_quote_items param so that when returning the quote the API will also include all the items in one request.

Updating a Quote Item

You can toggle a quote item as selected or not and update the override price (the price displayed to the vendor). Please read the notes as compulsory and locked items should not be toggled or updated.

http://api-docs.realhub.com.au/#update-quote-item

curl -X PUT "api/v2/campaign_quote_items/:id.json" \
  -H "User-Agent: MyCompanyName" \
  -H "x-api-token: API_KEY" \
  -F price_override=500 \
  -F selected=true

Authorizing a Quote

You can authorize a quote by using the following endpoint.

http://api-docs.realhub.com.au/#authorize-quote

To authorize a specific quote:

curl -X PUT "api/v2/campaign_quotes/:id/authorize.json" \
  -H "User-Agent: MyCompanyName" \
  -H "x-api-token: API_KEY" \
  -F 'signers=[{"first_name":"Jane","last_name":"Vendor","middle_name":"","address":"245 Underwood Street\nNewport\nNSW 2021","email":"jane@email.com.au","phone":"0452 256 236","document_sent":true,"document_sent_at":"2018-10-09T12:02:17+11:00","document_signed":true,"document_signed_at":"2018-10-11T12:02:17+11:00","physically_present":true,"nature_of_signer":"self","representing_trust":false,"external_id":1}]'

Signers are to be supplied as a stringified JSON string with dates in ISO8601 format.

This endpoint should only be called once all required signers have completed the signing process.

Comments (0)

HTTPS SSH

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