<?php
$ratesRequest = [
    'grant_type' => 'client_credentials',
    'client_id'  => 'l7b12d7a7111ed4d6780f368c8cf681f94',
    'client_secret' => 'af0862ad22ff486b8bfa7cb0e4ef0abe',
];

$url = "https://a...content-available-to-author-only...x.com/oauth/token";
$request = curl_init();
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($request, CURLOPT_TIMEOUT, 60);
curl_setopt($request, CURLOPT_POST, 1);
curl_setopt($request, CURLOPT_HTTPHEADER, array(
    'Content-Type' => 'application/x-www-form-urlencoded'
));
curl_setopt($request, CURLOPT_URL, $url);

curl_setopt($request, CURLOPT_POSTFIELDS, http_build_query($ratesRequest));
                
$response = curl_exec($request);
$response = json_decode($response, 1);
echo $response;
?>
