Can you show the code that isn't working?
Passing API Data back to view
Hi,
I am experimenting with an API (DirectAdmin), I have a view to select a server which then calls a method in the ServerController and runs the following.
$sock->query('/CMD_API_ALL_USER_USAGE');
$result = $sock->fetch_body();
$result = explode("\n", $result);
That does exactly what it is supposed to do and returns multiple rows of data like this example. ( there is a lot, this is just a small sample of one row):
[
"testuser=bandwidth=7.05128000&creator=adminuser&date_created=1582530762&
default=test.com&email_daily_limit=1000&email_deliveries_outgoing=0&inode=1492 ",
]
What I want to do now is send this data straight back to the view where I can output it in some way. But when I try to send the data in $result back I either get a bad gateway or simply no data at all, that I can tell.
This is just a personal project, I admit I am not great with this kind of thing and it is probably a simple task, just not sure what I am missing.
Any help appreciated
Please or to participate in this conversation.