A little help with the mine field of API

I have a supplier who has changed their API and its lets say confusing me some what.

for authorisation I have the following:

$client = new \GuzzleHttp\Client();
$response = $client->post(
‘headers’ => [
‘Content-Type’ => ‘application/json’,
‘Accept’ => ‘application/json’,
‘Authorization’ => ‘Bearer {token}’,
‘Api-Version’ => ‘v1’,
$body = $response->getBody();
print_r(json_decode((string) $body));

How on earth do I put this into Wappler ?
Any suggestions or walkthroughs would be awesome so I can get a connection

Have you tried just setting the endpoint to the https address and adding the 4 headers to the headers section substituting {token} with your api key

Hi Brian, yes I’ve got it working now and its getting the data, just trying to workout how I can get the api results and then insert them into my database, that way I can just do an update once a month.

Just set the api call with output and the data should be available in the picker

Have added the output on it, but it does not show anything, this api stuff is bloody confusing

you sure it is returning a correct JSON response? Can you look at the response in the developers console?

it was, for some reason it was not show but I have added it in manually, at the moment its a work in progress lol