Creating a Place via v2 API

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

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

Open Support Ticket
  • Author
    Posts
  • #509050

    coreyhammond
    Full Member
    Post count: 58

    We’re working on syncing our backend system with Geodirectory and we’re trying to use the API endpoint documented here:

    https://wpgeodirectory.com/docs-v2/api/posts/

    We’re sending over a call to:

    https://wip.restorationlocal.com/wp-json/geodir/v2/places/?zip=44720&post_title=Test Place Creation&title=Test Place Creation&default_category=1198&author=6156&content=Test Partner Creation&street=123 Fake Street&city=North Canton&state=Ohio&phone=555-555-5555&mapview=ROADMAP&franchise_fields=featured&post_category=1198&email=test@example.com

    and here’s our response, which doesn’t show any of the actual location information (such as the ZIP code that we sent over.)

    {“id”:null,”title”:{“raw”:null,”rendered”:”Test Partner Creation”},”slug”:null,”link”:”https:\/\/wip.restorationlocal.com\/places\/test-partner-creation\/”,”status”:null,”type”:null,”author”:0,”date”:false,”date_gmt”:false,”modified”:false,”modified_gmt”:false,”content”:{“raw”:null,”rendered”:””,”protected”:false},”default_category”:null,”post_category”:[{“id”:1998,”name”:”Biohazard Cleanup”,”slug”:”biohazard”}],”post_tags”:[],”package_id”:null,”street”:null,”country”:null,”region”:null,”city”:null,”zip”:null,”map”:null,”latitude”:null,”longitude”:null,”mapview”:null,”mapzoom”:null,”franchise”:{“raw”:null,”rendered”:null},”franchise_fields”:{“raw”:null,”rendered”:[]},”timing”:null,”phone”:null,”email”:null,”website”:null,”twitter”:null,”facebook”:null,”video”:null,”special_offers”:null,”claimed”:{“raw”:null,”rendered”:”No”},”featured”:false,”rating”:0,”rating_count”:0,”featured_media”:0,”featured_image”:{“id”:0,”title”:”Restoration-Local-Icon-1.png”,”src”:”https:\/\/wip.restorationlocal.com\/wp-content\/uploads\/2019\/08\/Restoration-Local-Icon-1.png”,”thumbnail”:”https:\/\/wip.restorationlocal.com\/wp-content\/uploads\/2019\/08\/Restoration-Local-Icon-1-600×600.png”,”width”:899,”height”:899},”images”:[{“id”:0,”title”:”Restoration-Local-Icon-1.png”,”src”:”https:\/\/wip.restorationlocal.com\/wp-content\/uploads\/2019\/08\/Restoration-Local-Icon-1.png”,”thumbnail”:”https:\/\/wip.restorationlocal.com\/wp-content\/uploads\/2019\/08\/Restoration-Local-Icon-1-600×600.png”,”featured”:false,”position”:0}],”comment_status”:null,”ping_status”:null,”meta”:[],”guid”:{“rendered”:null,”raw”:null},”_links”:{“self”:[{“href”:”https:\/\/wip.restorationlocal.com\/wp-json\/geodir\/v2\/places\/32025″}],”collection”:[{“href”:”https:\/\/wip.restorationlocal.com\/wp-json\/geodir\/v2\/places”}],”about”:[{“href”:”https:\/\/wip.restorationlocal.com\/wp-json\/geodir\/v2\/types\/gd_place”}],”author”:[{“embeddable”:true,”href”:”https:\/\/wip.restorationlocal.com\/wp-json\/wp\/v2\/users\/6156″}],”replies”:[{“embeddable”:true,”href”:”https:\/\/wip.restorationlocal.com\/wp-json\/geodir\/v2\/reviews?post=32025″}],”version-history”:[{“href”:”https:\/\/wip.restorationlocal.com\/wp-json\/geodir\/v2\/places\/32025\/revisions”}],”wp:attachment”:[{“href”:”https:\/\/wip.restorationlocal.com\/wp-json\/wp\/v2\/media?parent=32025″}],”wp:term”:[{“taxonomy”:”gd_place_tags”,”embeddable”:true,”href”:”https:\/\/wip.restorationlocal.com\/wp-json\/geodir\/v2\/places\/tags?post=32025″},{“taxonomy”:”gd_placecategory”,”embeddable”:true,”href”:”https:\/\/wip.restorationlocal.com\/wp-json\/geodir\/v2\/places\/categories?post=32025″}],”curies”:[{“name”:”wp”,”href”:”https:\/\/api.w.org\/{rel}”,”templated”:true}]}}”

    If we look at the platform, a place is being created, but most of the data that we sent over isn’t being added to the Place, see attachment.

    Also attached is our request via Postman.

    What are we missing?

    #509096

    Alex Rollin
    Moderator
    Post count: 27815

    Thanks for writing in about this. The developers will take a look.

    #509172

    Kiran
    Moderator
    Post count: 7069

    Hi,

    I have tested with following api data and it worked fine.

    title=Listing via API&content=This listing is created via API.&post_category[]=36&post_tags=my tag,api&status=publish&author=1&street=123 GD Tower&country=India&region=Gujarat&city=Surat&zip=123456&latitude=21.169559&longitude=72.836725&mapview=ROADMAP&phone=+1 111 111 1111&email=myemail@mysite.com&website=https://www.mysite.com/&package_id=7&franchise_fields[]=email

    Please provide a site link, admin & FTP credentials to look into more.

    Kiran

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

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

Open Support Ticket