Rest API Observations / Questions

This topic contains 6 replies, has 3 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
  • #267092

    D.D
    Buyer
    Post count: 199

    Hi,

    I’ve been working with the rest API and the JSON files and while I understand that it’s still a work in progress I thought I might have some observations/questions answered in the meantime;

    I have noticed that when I have a category type with a space and “&” symbol e.g “Health & Wellness”, the JSON string object return “Health & Wellness”.

    The GET request for listings within a category type is limited to ten (10) results per page and I’m probably doing this wrong but i have tried using the “/?per_page= 20” to get it to do more unsuccessfully. Currenlty I have http://MYDOMAIN.com/wp-json/geodir/v1/places?gd_placecategory=927/?per_page=20.

    Place categories also have a “Default Image” parameter, will that be an endpoint going forward with the final release?

    Cheers

    #267296

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hello,

    We will be keeping as much to the WP standards as possible, things like the default cat image will be added. Just post anything you find here and we will fix/add it. I will flag this post for the dev who is working on it but he will not be here until Tuesday.

    Thanks,

    Stiofan

    #267318

    D.D
    Buyer
    Post count: 199

    Great! I need to clarify the 1st point with the “Health & Wellness” the response is “Health &(amp:) Wellness”. The “amp:” isn’t in parenthesis in the JSON response but it won’t show up here if I don’t use them.

    #267343

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Yeah sound like it might be a bug, Kiran will take a look at it after the weekend.

    Thanks,

    Stiofan

    #269196

    Kiran
    Moderator
    Post count: 7069

    Hello D.D

    1)
    We are using WP standard functions to retrieves data via all endpoints.
    Can you clarify on which endpoint you getting this “Health & Wellness”? Please check attachment that i got with endpoint on my site.

    2)
    The correct request url should be http://MYDOMAIN.com/wp-json/geodir/v1/places?gd_placecategory=927&per_page=20 OR http://MYDOMAIN.com/wp-json/geodir/v1/places/?gd_placecategory=927&per_page=20
    You could add more parameters to url with “&” Ex: “&per_page=20” “&page=2” etc.

    3)
    We have already in our todo that “add default image and marker icon in listing categories endpoint”. We surly add this in final release of GeoDirectory API.
    We are still looking at WP when they include REST API as inbuilt feature in WP package.

    Thanks

    #269256

    D.D
    Buyer
    Post count: 199

    thanks for the feedback Kiran. If you look at the attachment under the “name” parameter the value is “Attractions (& amp;) Site Points”. Is there a way to get rid of the “(amp;)” and just have it return “Attractions & Site Points” in the JSON?

    #269262

    Kiran
    Moderator
    Post count: 7069

    Hi,

    The encoded entity name for & (ampersand) is “&” so using only “amp;” the API functions will treat it other then &.
    Please look here : http://www.w3schools.com/html/html_entities.asp

    Let me know

Viewing 7 posts - 1 through 7 (of 7 total)

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

Open Support Ticket