WP rest API - list & link to post

Hi community, hope you are all well.

I have successfully made a list of posts (pulled from Wordpress) and the list dynamically updates as i create / delete posts - works really well.

I just don’t seem to be able to display the individual posts (and link from the list to the post in question).

In the documentation the examples are using the appgyver cloud, and not with a REST api connection, and the process doesn’t translate exactly. API has a different method when creating a Data source.

Perhaps anyone successfully made a list (from WP or other) who has been able to link the items listed to their individual content (on another page)?

Grateful for input in advance.

Hi Will! This should be easily doable with any API – does all the info that you want to display about the post already exist in the list of objects that you are pulling from Wordpress, or do you need to make another API call to get the details of the post in question?

HI Marie! I think thats actually a very good point - i am unsure of its its:

  1. There is a primary URL (for the API) which can call all the information under the post
  2. I should call each element of the post (excerpt, title, meta etc) with a unique API url?

Do you have an opinion on that.

I am really grateful for your reply!

Hi, that depends on how the Wordpress API works – often it is so that to get the list of records you make a GET request to http://www.exampleapi.com, and then another GET request to http://www.exampleapi.com/12345 will give you all details of the entry with ID 12345. Do you have documentation for the API that you are working with?

ah ok, i understand. I can test that. I wanted the data to pull dynamically to the app you see.

This is because i didnt want to create a new submission to the app store each time a new post (in wordpress) was created.
I have the WP rest API documentation, and I can definately test your theory here.

After your app has been submitted (and accepted) to the various stores, what is the process for making updates and changes? can you point me to documentation on that?

You can definitely do it dynamically, I don’t know if you already checked these videos but they explain the logic of how the whole thing works with using data variables.

Using a REST API data resource, you just have to configure both Get data collection and Get record for your endpoint in the Data configurator. Then on the page where you list the data, you use Open page flow function, passing the ID of the current post as a page parameter to a detail page. On the detail page, you have a data variable of type “Single data record”, and you use the ID from the page parameter to get the right record. Whenever new posts are added you’ll see them in the list, and will be able to view their details, no new submissions to any stores needed!

Anyways, the build service/distribution documentation can be found here.

ok, i am going to try this later - its all new. Again - really appreciate your input.

1 Like

Hi Will,
Please I like to know how to use Wordpress REST API authentication method for AppGyver. I need to create and edit some post using REST API.
Dinesh Peiris