Connecting to external API
-
- Posts: 26
- Joined: 2015-11-02 01:22
Connecting to external API
I would like to connect to some of my external vendor websites to bring in dynamic data to my proposed AG application. I do not see anything documented in the forums about it. Is this possible with AG? Thanks!
Jeff MacDougall
Re: Connecting to external API
Sure, nowadays many services do provide their data in JSON format.
As a consumer you can fetch data from remote services using PHP or Javascript.
Just a simple example in PHP:
But beware, for a productive system there is still a lot to consider, for example security and authentication (tokens), versioning of data schemes and validation, received data and error-handling.
As a consumer you can fetch data from remote services using PHP or Javascript.
Just a simple example in PHP:
Code: Select all
// php
$response = file_get_contents("https://your-data-service-provider.com/api/v2/your_request.php?arg1=123");
$data = json_decode($response);
// process $data
// ...
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
-
- Posts: 26
- Joined: 2015-11-02 01:22
Re: Connecting to external API
Thank you for the response. I do see on my various vendor websites where I create the tokens and shared keys. I guess my next step would be, how do I setup field on the AG side to populate with data from GET commands. Forgive me for being an absolute novice here. I just don't know ehere to start.
Jeff MacDougall
-
- AppGini Super Hero
- Posts: 121
- Joined: 2020-02-16 16:29
-
- Posts: 26
- Joined: 2015-11-02 01:22