Hi community.
It's my first time using composer, passport and getcandy, so please be patience.
How can i use the keys generated by passport via CURL?
I want access to the api via PHP CURL.
`<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "..api/v1/users/current",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}`
I get message error:
{"message":"Unauthenticated."}
Thank you!