Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress plugin to connect to a REST API? [closed]

Let's say I have a RESTful API running on a server somewhere, as well as a separate, but related, Wordpress site.

I want to have some pages on the WP site that show data on WP pages that has been retrieved from the REST server (in JSON format), and allow the user to view and/or edit the data on WP pages.

For example, let's say I have, as a REST starting point, an API that returns a list of books owned by a user. I want to display the list of books, allow the user to click on a book link and go to a page that displays the details for the book.

Then if the user enters "edit mode", it lets him/her edit the data and POST/PUT it back to the server via the REST API.

Is there any WP plugin that lets me create pages that display and edit information like this?

I would expect that for each type of entity I could enter some metadata to indicate what to expect in the JSON and how to display it for viewing or how to build the form for it (like iPhorms does).

like image 599
MindJuice Avatar asked Sep 10 '25 21:09

MindJuice


2 Answers

So WordPress has some built-in support for AJAX queries, both from the admin panel and in the user-facing pages.

I don't fully understand how it all works yet as I am totally new to WordPress coding, but this seems to be what I want:

http://codex.wordpress.org/AJAX_in_Plugins

Thanks to moimikey for mentioning WP's ajax ability.

like image 121
MindJuice Avatar answered Sep 13 '25 07:09

MindJuice


Look at this URL, it will solve your problem https://developer.wordpress.org/plugins/http-api/

like image 37
FDI Avatar answered Sep 13 '25 06:09

FDI