• Hi guys!

    I have a customer with the wish, to include information from a separate Software. I see, that this software also serves a REST-API. Now I need someone to prove my idea of doing this or giving me ideas to improve it.

    My plan looks like this:

    1. Information from REST-API into the functions.php File
    2. Generate an Object/Array and serve those informations to a template
    3. Include the templates in content-blocks
    4. Include the content-blocks on the pages, where they are used

    Does this make sense or does it even work? Or is there another way, go get this done faster?

    I decided to put the templates into the blocks, because it is easier to include those blocks in different regions/sections on the page.

    Thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Depending on the amount of data and nature of it I’d consider caching the result in a transient or storing it more permanently in the database between points 1 & 2, for better performance.

    Thread Starter scepticore

    (@scepticore)

    @jakept

    So basically my “flowchart” makes sense to you? And saving the information sounds good, but that means that I also need to check, if there has changed anything and keep the informations up to date.

    But thanks for that input, haven’t thought so far.

    Depends on the data. If it’s a small amount of data it would be simpler just to replace it all at once. If it’s a larger amount of data you probably shouldn’t query it on every page load. So how complex you need to get depends entirely on what sort of API you’re dealing with. If you can share what exactly you’re working with you’ll get better feedback.

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

The topic ‘External REST-API into WordPress’ is closed to new replies.