This topic is locked
[SOLVED]

 REST API

5/9/2020 1:39:27 PM
PHPRunner General questions
C
charlesfolder author

Hi, guys.
Does somebody have an example of how to create a PHPRUNNER project_A with REST API and another PHPRUNNER project_B

that you pull data from project_A from project_B using REST API in both projects.
Thank You

fhumanes 5/10/2020



Hi, guys.
Does somebody have an example of how to create a PHPRUNNER project_A with REST API and another PHPRUNNER project_B

that you pull data from project_A from project_B using REST API in both projects.
Thank You


Hello:
It's not exactly what you ask for, but it's functionally the same.
Here is an example of an application with a RESTfull API server:

https://asprunner.com/forums/topic/27323-phprunner-app-with-restful-api/

Here is an example of a RESTfull API client application.

https://asprunner.com/forums/topic/27340-phprunner-app-client-restful-api/

They are very simple and I think they can help you answer questions.
Cheers,
fernando

Sergey Kornilov admin 5/10/2020

Yes, check this blog post:

https://xlinesoft.com/blog/2020/03/10/version-10-4/
It explains how to both provide REST API access to data in your project and how to consume REST API data. And it will work just perfectly to pass data from one PHPRunner project to another.

C
charlesfolder author 5/10/2020



Hello:
It's not exactly what you ask for, but it's functionally the same.
Here is an example of an application with a RESTfull API server:

https://asprunner.com/forums/topic/27323-phprunner-app-with-restful-api/

Here is an example of a RESTfull API client application.

https://asprunner.com/forums/topic/27340-phprunner-app-client-restful-api/

They are very simple and I think they can help you answer questions.
Cheers,
fernando


Thank You, I think this will help me

M
MikeT 5/10/2020

@Sergey: is it planned to use database table as backend (or "cache") for calls To a REST-API? In other words: parse out records/fields from an API-call to an outside API and store the result in a local table.

So far I did this with my own code.
(Didn't check the new REST feature yet, so sorry when this just shows my ignorance).

Sergey Kornilov admin 5/11/2020

We do plan to add caching results coming from the external REST API as a feature.

M
MikeT 5/11/2020



We do plan to add caching results coming from the external REST API as a feature.


Great! I recently had a project that needed a subset of fields from a public API and the option to periodically update this info (while keeping it in a local table).

Local also because it was an amount of data that I felt uncomfortable to load every time (and it's not data that changes every day).
Anyway, some interface to map result fields to local table fields would be great and maybe even with event hooks to do stuff with the incoming data before writing to the table.

(Of course one could do all this with custom code.)