HTTP API
1. HTTP API Feature
HTTP API feature is a new way to send the updated data from Agentpoint system to other website domain which have registered before from the developer system.
There are several conditions which make this feature work:
- Domain for HTTP API must be defined. This is the url where the API will be sent.
- The checkbox for enabled HTTP API must be checked. System will check this value, if this value true then it allows to send API.
- The properties belonging to the office must not in Draft status. When users create or update a property and save it as Draft then there is no way to send the API to the 3rd party.
- Office status must remain active.
- HTTP API feature is also applied on team member and office information. This means when a user creates or updates a team member or office information the API will send this information to the 3rd party.
If you’re using WordPress then you can download a plugin which will automatically populate your WordPress database with information from Zoo Property sent through the HTTP API.
2. Parameters Input
All parameters are sent as json outputs
- Property API
On this API there are several parameters sent by using curl
-
- Property attributes
- Property detail attributes
- Primary and Secondary Contact attributes
- Images
- Brochures
- Floorplans
All string type parameters are encoded using Base64 encoding and the curl :
curl -i -X POST -d 'property=#{encoded_property.to_json}&details=#{encoded_property_detail.to_json}&rental_seasons=#{rental_seasons.to_json}&contacts=#{users.to_json}&brochures=#{encoded_brochures.to_json}&opentimes=#{opentimes.to_json}&images=#{encoded_images.to_json}&floorplans=#{encoded_floorplans.to_json}&features=#{features.to_json}&callback_url=http://#{GLOBAL_ATTR["Host-#{self.office_id}"]}/agents/#{self.agent_id}/offices/#{self.office_id}/properties/#{self.id}/property_notification?token=#{token}&type=property' #{domain.ipn}
- Office API
For this API, all office attribute parameters will be sent to 3rd party by using this curl :
curl -i -X POST -d 'office=#{encoded_office.to_json}&detail=#{self.domains.to_json}&callback_url=http://#{GLOBAL_ATTR["OFF-#{self.agent.id}-#{self.agent.developer.id}"]}/developers/#{self.agent.developer.id}/agents/#{self.agent.id}/offices/#{self.id}/office_notification?token=#{token}&type=office' #{domain.ipn}
- Team Member API
This API also sends all agent user attributes data by using this curl :
curl -i -X POST -d 'contacts=#{encoded_team_member.to_json}&callback_url=http://#{GLOBAL_ATTR["Host-#{self.office_id}"]}/agents/#{self.agent.id}/offices/#{self.office_id}/agent_users/#{self.id}/team_notification?token=#{token}&type=team_member' #{domain.ipn}
Output
There are domain logs which can show if the parameters are sent. Here is the example of results :
- Original Parameters
- contacts
{"salt": "NmQxNjc4ZWZmZWNkODUxYjZkN2Y1ZDdjYTFiZTEwMjk4NjE0MzYxYQ==\n","activated_at": null,"active_help_status": true,"api_is_sent": true,"linkedin_username": null,"office_id": 67,"updated_at": "2010-10-21T22:12:47 11:00","testimonials": {},"code": "MDQ2\n","crypted_password": "MGZiNzM4Y2Q1MWM1NmY2MmQ1Nzc3NjkxNGYzMGNhMDVkNGM0YjQ2OA==\n","twitter_username": null,"deleted_at": "2010-10-21T22:12:47 11:00","processed": null,"activation_code": "ZjA1NjQyNWFhODliNzViYjdlNDUyYTEyODZmNWYyNmEyYzdiM2QxNA==\n","facebook_username": null,"remember_token_expires_at": null,"role": "","type": "QWdlbnRVc2Vy\n","video_url": null,"id": 5415,"suburb": null,"vcard": "","landscape_images": {"1": "", "2": ""},"count_api_sent": 0,"description": "","mobile": "","fax": null,"phone": "ODgzIDc4NDI=\n","remember_token": null,"reset_code": null,"first_name": "VGlt\n","im_service": null,"developer_id": 1,"group": "U2FsZXMgQWdlbnQ=\n","last_name": "SG93YXJk\n","login": "aG93YXJk\n","position": null,"portrait_images": {"1": "", "2": ""},"created_at": "2010-10-20T22:08:09 00:00","email": "dGltQHRlc3QuY29t\n","im_username": null,"video_code": null}==================================================================================callback_urlhttp://agentpoint.agentaccount.com/agents/3/offices/67/agent_users/5415/team_notification?token=215de1be37d338382a438b017ec5c19b==================================================================================typeteam_member==================================================================================statusdelete
- Json Parameters
- contacts
salt : NmQxNjc4ZWZmZWNkODUxYjZkN2Y1ZDdjYTFiZTEwMjk4NjE0MzYxYQ==activated_at :active_help_status : 1api_is_sent : 1linkedin_username :office_id : 67updated_at : 2010-10-21T22:12:47 11:00testimonialscode : MDQ2crypted_password : MGZiNzM4Y2Q1MWM1NmY2MmQ1Nzc3NjkxNGYzMGNhMDVkNGM0YjQ2OA==twitter_username :deleted_at : 2010-10-21T22:12:47 11:00processed :activation_code : ZjA1NjQyNWFhODliNzViYjdlNDUyYTEyODZmNWYyNmEyYzdiM2QxNA==facebook_username :remember_token_expires_at :role :type : QWdlbnRVc2Vyvideo_url :id : 5415suburb :vcard :landscape_images
1 :
2 :count_api_sent : 0description :mobile :fax :phone : ODgzIDc4NDI=remember_token :reset_code :first_name : VGltim_service :developer_id : 1group : U2FsZXMgQWdlbnQ=last_name : SG93YXJklogin : aG93YXJkposition :portrait_images
1 :
2 :created_at : 2010-10-20T22:08:09 00:00email : dGltQHRlc3QuY29tim_username :video_code :==================================================================================callback_url :==================================================================================type :==================================================================================status :
From the details above we can see the string parameters are encoded.
Hi Zoo,
Just wondering whether you have any Joomla plugins which can be used with this API?
Thanks
Hi Henry,
Unfortunately we only have the WordPress plugin available at the moment. There might be another developer who has complete a plugin in Joomla who could help you out. Anyone out there?
Zoo Support
Hi Zoo,
I too am trying to integrate into a Joomla site. What’s the best way to integrate into Joomla without the plug in?
thanks
Scott