Api calling a json datasource to get parameters

hi guys, have you plans to offer a json datasource inside a api flow
i’d like to consult informations insite a json file to process data inside an api flow
but in database conections i have no jsondatsource option
is there other way to do this ?

I don’t think there have been any requests for this before.
The challenge would be to get the schema right I suppose.
You do have JSON Data source option in front-end, so maybe doing the same on server-side, should not be too complex.

You can easily create a custom module for the same - but the only problem with custom modules is that you cannot set the schema dynamically.

P.S.: You can vote for your own request.

hey friend
I remembered this workaround
if you call a jsonfile as if it were an api
the return will be the content of the file

This worked when getting the schema

but when trying to execute this call (GET/POST) I received this error message

{“code”:7,“file”:"/var/www/html/dmxConnectLib/modules/api.php",“line”:213,“message”:“Failed to connect to localhost port 8200 after 1 ms: Couldn’t connect to server”,“trace”:"#0 /var/www/html/dmxConnectLib/lib/App.php(206): modules\api->send(Object(stdClass), ‘api’, Array)\n#1 /var/www/html/dmxConnectLib/lib/App.php(146): lib\App->execSteps(Object(stdClass))\n#2 /var/www/html/dmxConnectLib/lib/App.php(113): lib\App->exec(Object(stdClass))\n#3 /var/www/html/dmxConnect/api/nuvemfiscal/test-jsonfile.php(7): lib\App->define(Object(stdClass))\n#4 {main}"}

Let me guess… You’re using Docker, right?

yes, i’ll read it

this …

@mebeingken
Jan 17
Sorry, I wasn’t clear. My idea (I have not tried this) was that you would replace localhost:8080 with host.docker.internal:8080 in the URL of your API Action.

It didn’t work here for me.
I’m using docker mounted by wappler, appache with php
Where can I see what this internal domain would be that he must have set up?

image

But that’s right, I’m getting close
thanks

[SOLVED]
thanks @Apple for show me the path
wappler mount a docker with a lot of info
using docker inspector you can enter networks/aliases indicating the domain that should be used
image
but, to make it easier…
apparently the default is the container name
wappler gurus can confirm this…

1 Like