Add listing via API

Is it possible to add listings via API? We currently have a Python script for creating listing descriptions with OpenAI API, and would love to extend its functionality to be able add listings automatically with the REST API- however I noticed the current endpoints were only for updating, deleting, hiding, and reporting listings.

Yes, unfortunately there’s no 100% REST API coverage yet but it’s on the roadmap. You can use the default WP REST API as a temporary fallback Posts | REST API Handbook | WordPress Developer Resources

HTML
HTML
Raw
it doesn’t work.
this code
post_date = {
“title”: “test_title_listing”,
“content”: “content_test content_test”,
“status”: “publish”,
“type”: “hp_listing”,
“author”: 2
}
r = requests.post(‘https://домен.com/wp-json/wp/v2/posts’, headers=header, json=post_date)
must create “type”: “hp_listing”
but creates “type”: “post”

1 Like

Please also provide the post type “hp_listing”, this endpoint should support custom post types.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.