Hi i have a problem in retrieving data from a API called healthOs.
i'm getting
cURL Error:Illegal characters found in URL
here i want fetch the data using PHP here is doccumentation:https://documenter.getpostman.com/view/2641261/healthos/6nATBN9#aa477f59-954c-744e-38dc-4e12a833fb70
i have tried this code :
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://www.healthos.co
/api/v1/autocomplete/medicines/brands/CROCIN 125 MG SUSPENSION",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"authorization" => "12b570970d786ebf07c85496f5d2a7212fca81799c93379c43066206b6780885"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error:" . $err;
} else {
echo $response;
}
here is my 100% genuine credentials:
client id :
faf4ad2651a7906fee8fab4c682ecc2721e16cc05771d8b32c807050ff621972
Client Secret:
eb6731289c24359adcc76a98ed643de0b6f48526a4d56071d9c9cdb3656c3a9a
Access Token: 12b570970d786ebf07c85496f5d2a7212fca81799c93379c43066206b6780885
please refer doccumentation:https://documenter.getpostman.com/view/2641261/healthos/6nATBN9#aa477f59-954c-744e-38dc-4e12a833fb70
