Estoy intentando hacer esta petición post por medio de curl, pero no me funcion, en las indicaciones dice esto:
I've got an API Key... How can I make an API request? You can send your requests with an Authorization Header with a value like this: Authorization: apiKey {api_key}.
Example using curl:
curl -H "Authorization: apiKey {api_key}" https://api.connectif.cloud Important notes Connectif HTTP API is open, it means that we do not have to add your IP's in a whitelist.
Intente con esto:
curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.connectif.cloud/purchases/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => array(
'apiKey: aquipusemiapi',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl); echo $response;
Pero me lanza que la autenticación no es correcta. Podrían apoyarme por favor.
Authorization
.array('Authorization: apiKey <api_key>', ...