I'm having problems to get an API to return the answer based on search parameters entered by the user. I have managed to return the general list (in Json) and print it, consuming only the data that I consider relevant. However I can not get back only those data that match the search entered by the user.
I leave the code to see if you can lend a hand and thank you very much.
<?php
$opciones = $_GET['opciones'];
$postData = http_build_query(array(
'q' => $opciones
));
$opts = array(
'http'=>array(
'header'=>"x-access-token: <My access token>",
'content'=> $postData
));
$context = stream_context_create($opts);
$resp = file_get_contents('https://affiliate.tutellus.com/api/v1/courses/',
false, $context);
$json_response = json_decode($resp, true);
//var_dump($json_response);
foreach ($json_response as $course) {
#$imagen = $course["image_url"];
echo $course["name"], "<br>";
#echo '<img src="' . $imagen .'" />';
echo $course["description"], "<br>";
echo $course["url"], "<br>";
}