Creating a New Place is Not Working
This topic contains 11 replies, has 3 voices, and was last updated by Kiran 5 years, 8 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
May 2, 2019 at 9:13 pm #484225
Hello,
I’m trying to create a new place with the API. It isn’t working correctly. The place gets created, however, it’s missing the majority of fields.
When I view the place in admin, it’s missing all fields I passed in other than the title.
Request
POST /wp-json/geodir/v2/places/?title=Test%20Place&street=123%20Fake%20St&country=United%20States&city=Rockford®ion=IL&zip=61108&latitude=42.266800&longitude=-89.088379&post_category=51&email=test%40test.com HTTP/1.1 Authorization: Basic ZGVubmlzQG1lbmdlbHQuY29tOmIwbWJhdDBt Content-Type: application/octet-stream Host: example.com Connection: close User-Agent: Paw/3.1.7 (Macintosh; OS X/10.14.2) GCDHTTPRequest Content-Length: 0
Response
HTTP/1.1 201 Created Server: nginx Date: Thu, 02 May 2019 20:58:38 GMT Content-Type: application/json; charset=UTF-8 Transfer-Encoding: chunked Connection: close X-Robots-Tag: noindex Link: <https://example.com/wp-json/>; rel="https://api.w.org/" X-Content-Type-Options: nosniff Access-Control-Expose-Headers: X-WP-Total, X-WP-TotalPages Access-Control-Allow-Headers: Authorization, Content-Type Expires: Wed, 11 Jan 1984 05:00:00 GMT Cache-Control: no-transform, no-cache, must-revalidate, max-age=0 Allow: GET, POST Location: https://example.com/wp-json/geodir/v2/places/26031 Host-Header: 192fc2e7e50945beb8231a492d6a8024 alt-svc: quic=":443"; ma=86400; v="43,39" {"id":null,"title":{"raw":null,"rendered":"Test Place"},"slug":null,"link":"https:\/\/example.com\/?post_type=gd_place&p=26031","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":51,"name":"Nursing Home","slug":"nursing-home"}],"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,"claimed":{"raw":null,"rendered":"No"},"logo":null,"licensing_information":null,"phone":null,"website":null,"email":null,"video":null,"special_offers":null,"business_hours":null,"featured":false,"rating":0,"rating_count":0,"featured_media":0,"featured_image":[],"images":[],"meta":[],"guid":{"rendered":null,"raw":null},"_links":{"self":[{"href":"https:\/\/example.com\/wp-json\/geodir\/v2\/places\/26031"}],"collection":[{"href":"https:\/\/example.com\/wp-json\/geodir\/v2\/places"}],"about":[{"href":"https:\/\/example.com\/wp-json\/geodir\/v2\/types\/gd_place"}],"author":[{"embeddable":true,"href":"https:\/\/example.com\/wp-json\/wp\/v2\/users\/3"}],"version-history":[{"href":"https:\/\/example.com\/wp-json\/geodir\/v2\/places\/26031\/revisions"}],"wp:attachment":[{"href":"https:\/\/example.com\/wp-json\/wp\/v2\/media?parent=26031"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/example.com\/wp-json\/geodir\/v2\/places\/tags?post=26031"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/example.com\/wp-json\/geodir\/v2\/places\/categories?post=26031"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
I’ve replaced the domain name with ‘example.com’ in the request/response above.
May 3, 2019 at 12:49 pm #484296Hello,
I have flagged your topic for the developers.
For your reference: https://wpgeodirectory.com/docs-v2/geodirectory/settings/api/
May 3, 2019 at 12:54 pm #484300This reply has been marked as private.May 3, 2019 at 4:10 pm #484344This reply has been marked as private.May 6, 2019 at 5:11 pm #484734This reply has been marked as private.May 6, 2019 at 7:54 pm #484779This reply has been marked as private.May 6, 2019 at 8:53 pm #484808This reply has been marked as private.May 7, 2019 at 9:16 am #484892This reply has been marked as private.May 7, 2019 at 5:26 pm #484975This reply has been marked as private.May 10, 2019 at 11:15 am #485566Hello,
The “REST API Console” is a 3rd party tool provided by “WP REST API Team” to test WordPress REST API requests through your normal WordPress admin.
Did you try this tool to submit API request with same fields & data?
Is it possible to check and test API request from my side? If yes, then provide details so i can check what going wrong.
Regards,
KiranMay 10, 2019 at 7:04 pm #485691This reply has been marked as private.May 14, 2019 at 9:58 am #486328This reply has been marked as private. -
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket