Missing fields from REST API call
This topic contains 31 replies, has 4 voices, and was last updated by Kiran 9 years, 1 month ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
July 22, 2016 at 3:06 pm #231857
np, thanks for letting us know 🙂
July 25, 2016 at 2:35 pm #233322Is it possible to have a request for more than one CPT in one request? Thank you
July 25, 2016 at 3:08 pm #233333Hi,
sorry, but that is not possible, just like it’s not possible via the php application.
Thank you
August 19, 2016 at 8:30 am #249544Hi,
The “https://YOUR-SITE.COM/wp-json/geodir/v1/places/” returns an Error 400. All others work fine.
August 19, 2016 at 9:04 am #249549@d.D there is a minor bug found that when default sorting not set in backend GeoDirectory -> CPT Settings -> Custom Fields Sorting Options it causes a 400 error.
To fix this please set any one of four fields as default sorting. Tick “Set as default sort.” radio beside any field to set default sorting.
Let us know.
Thanks,
KiranAugust 19, 2016 at 9:11 am #249551Great! Had mine sorted by “featured” but changing it to something else worked.
Thanks!
August 19, 2016 at 9:20 am #249553Thanks for letting us know 🙂
August 29, 2016 at 2:39 pm #255431Hi this may be something wrong that I’m doing or a setting I’m unaware of but my GET request only ever returns 10 listings. How do I retrieve every listing?
Cheers!
August 30, 2016 at 4:30 am #255814Hey D.D,
You can use per_page parameter to retrieve maximum number of listings per each page. Ex: YOUR-SITE-URL/wp-json/geodir/v1/places/?per_page=20
The value for per_page parameter must be between 1 to 100 and default is 10. Please see https://github.com/WP-API/WP-API/blob/develop/lib/endpoints/class-wp-rest-controller.php#L255
All parameters are found at YOUR-SITE-URL/wp-json/geodir/v1/ under “routes” -> “/geodir/v1/places” -> “endpoints” -> “args”
FYI: Maximum 100 listings are good enough otherwise it may happen server timeout issue for large number listings.
Let us know.
Thanks
August 30, 2016 at 5:55 am #255823Thanks Kiran!
September 12, 2016 at 1:21 pm #264818Hi,
I don’t seem to be able to find endpoints for users, categories or tags. Are those still being worked on or am I missing something?
Cheers.
September 12, 2016 at 6:45 pm #265031I alerted Kiran for you, he’ll let you know asap.
Thanks
September 13, 2016 at 7:17 am #265255Hi There,
We have added new endpoints to retrieve GeoDirectory taxonomies (categories & tags).
Taxonomies endpoint will be YOUR-SITE-URL/wp-json/geodir/v1/taxonomies/.This could be reflected in next version of GeoDirectory Rest API. If you don’t want to wait till next release you can download development version and overwrite files.
Development version available here https://github.com/kprajapatii/geodir_apiFor users endpoints
GeoDirectory Rest API plugin is extended to WP Rest API and it retrieves only GeoDirectory data. So for users endpoints (and also other WP data like posts, post categories, post tags, pages etc) you need to install WP Rest API plugin.
FYI: WordPress has planned (probably in next major version) to include WP Rest API as built in functionality in WP.Let us know.
Thanks
September 13, 2016 at 7:24 am #265256thanks for the update kiran. I have had issues trying to use the Geodirectory rest API and the WP rest API at the same time. I get the message “Plugin could not be activated because it triggered a fatal error”. Am I supposed to use both API’s? I’ll check out the updates on Github.
Thanks
September 13, 2016 at 7:42 am #265262Hello,
Please use recent updated version for both WP Rest API. The development version Geodirectory Rest API will fix “Plugin could not be activated because it triggered a fatal error”.
WP Rest API plugin only required if you want to retrieve data like blog posts, posts categories, post tags, users etc through API.
Geodirectory Rest API is only required if you want to retrieve GD data like listings, categories, tags, reviews etc through API.Please check and let us know.
Thanks
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket