Update Listing Location via WP API?

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

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

Open Support Ticket
  • Author
    Posts
  • #332628

    Troy Thompson
    Expired Member
    Post count: 7

    Hi there,

    I’m using the the WP GeoDirectory API to update data from my hybrid application using Ionic. I see some endpoints are enabled for Post, but don’t see an option to update the location of a listing. I need this to move listings on the application. Is this endpoint available via the WP GeoDirectory API?

    Thanks,

    Troy

    #332639

    Stiofan O’Connor
    Site Admin
    Post count: 22956
    #332863

    Kiran
    Moderator
    Post count: 7069

    Hi Troy,

    Please download & use this latest development version from here: https://github.com/kprajapatii/geodir_api

    Posts fields available under endpoint
    wp-json/geodir/v1/ -> routes -> /geodir/v1/places -> endpoints -> methods POST -> Args

    Add listing example:

    /wp-json/geodir/v1/places/?status=publish&title=Place via API&content=This place is added via API&gd_place_tags[]=rest api&gd_placecategory[]=5&post_address=SG Road&post_country=India&post_region=Gujarat&post_city=Ahmedabad&post_zip=380054&post_latitude=23.042512794737146&post_longitude=72.62729260253082&geodir_timing=10.00 am to 6 pm&geodir_contact=+43453457878&geodir_email=email@myemail.com&geodir_website=http://www.website.com&geodir_twitter=http://www.twitter.com&geodir_facebook=http://www.facebook.com&geodir_price=56697

    Update listing example:

    /wp-json/geodir/v1/places/123/?title=Place via API&content=This place is added via API&gd_place_tags[]=rest api&gd_placecategory[]=5&post_address=SG Road&post_country=India&post_region=Gujarat&post_city=Ahmedabad&post_zip=380054&post_latitude=23.042512794737146&post_longitude=72.62729260253082&geodir_timing=10.00 am to 6 pm&geodir_contact=+43453457878&geodir_email=email@myemail.com&geodir_website=http://www.website.com&geodir_twitter=http://www.twitter.com&geodir_facebook=http://www.facebook.com&geodir_price=56697
    #332898

    Troy Thompson
    Expired Member
    Post count: 7

    Thanks for sending that updated plugin. I’m getting a new error response.

    {
    “code”: “empty_content”,
    “message”: “Content, title, and excerpt are empty.”,
    “data”: {
    “status”: 400
    }
    }

    Please help.

    Thanks!

    Troy

    #332900

    Troy Thompson
    Expired Member
    Post count: 7

    Can I update listings that were created on the website? I don’t see a method for that.

    #332904

    Troy Thompson
    Expired Member
    Post count: 7

    Nevermind. It works! Thank you. Thank you.

    #333311

    Kiran
    Moderator
    Post count: 7069

    Great!
    Thanks for letting us 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