I'm trying to make a POST request using CURL. Using Postman and on my local machine using IIS there is no error but on XAMPP server and Linux server with CA certificate I get:
{"error":"OAUth Error","status":401,"message":"Client authentication failed"}
The code look like this:
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.timewave.se/v3/oauth/token',
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_POSTFIELDS => array('client_id' => '1','client_secret' => 'abc........abc','grant_type' => 'client_credentials'),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Why do I get 'Client authentication failed' on XAMPP server and Linux server?