Missing fields from REST API call

This topic contains 31 replies, has 4 voices, and was last updated by  Kiran 7 years, 7 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #231857

    Paolo
    Site Admin
    Post count: 31206

    np, thanks for letting us know 🙂

    #233322

    Marc D
    Buyer
    Post count: 15

    Is it possible to have a request for more than one CPT in one request? Thank you

    #233333

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    sorry, but that is not possible, just like it’s not possible via the php application.

    Thank you

    #249544

    D.D
    Buyer
    Post count: 199

    Hi,

    The “https://YOUR-SITE.COM/wp-json/geodir/v1/places/” returns an Error 400. All others work fine.

    #249549

    Kiran
    Moderator
    Post count: 7069

    @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,
    Kiran

    #249551

    D.D
    Buyer
    Post count: 199

    Great! Had mine sorted by “featured” but changing it to something else worked.

    Thanks!

    #249553

    Kiran
    Moderator
    Post count: 7069

    Thanks for letting us know 🙂

    #255431

    D.D
    Buyer
    Post count: 199

    Hi 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!

    #255814

    Kiran
    Moderator
    Post count: 7069

    Hey 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

    #255823

    D.D
    Buyer
    Post count: 199

    Thanks Kiran!

    #264818

    D.D
    Buyer
    Post count: 199

    Hi,

    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.

    #265031

    Paolo
    Site Admin
    Post count: 31206

    I alerted Kiran for you, he’ll let you know asap.

    Thanks

    #265255

    Kiran
    Moderator
    Post count: 7069

    Hi 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_api

    For 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

    #265256

    D.D
    Buyer
    Post count: 199

    thanks 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

    #265262

    Kiran
    Moderator
    Post count: 7069

    Hello,

    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

Viewing 15 posts - 16 through 30 (of 32 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket