propertyhive / WP-Property-Hive

The complete estate agency software plugin for WordPress
Other
27 stars 27 forks source link

Accessing the property address via rest api #98

Closed spong-e closed 4 years ago

spong-e commented 4 years ago

HI,

Can someone tell me how I am able to access the address of a property via the REST API? As far as I can see only the following fields are available

image

When I view the properties via wordpress the details are appearing but cant see how to get access to them via API.

Thanks

propertyhive commented 4 years ago

@spong-e The display address (i.e how the agent wants it to appear and how it will appear on the frontend) can be accessed via the 'title' attribute.

If you want to access the individual address components (number, street, postcode etc) as separate fields, we don't include this by default as the agent doesn't always want this publicly available, especially house number, and sometimes full postcode. As a result, you'd need to use something like so to add these additional fields to the response:

https://docs.wp-property-hive.com/developer-guide/rest-api/customising-the-data-returned-in-rest-api-json/

Note that if using the above you'll need to be running version 1.4.47 of Property Hive.

Hope that helps but any other questions just let me know, Steve