Verify purchase

Hello, how can I check if a user has purchased my article?
I tried this:
$code = $_GET["code"]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"https://api.envato.com/"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,"tokengrant_type=authorization_code&code=$code&client_id=CLIENTID&client_secret=SECRET"); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded')); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $server_output = curl_exec ($ch); curl_close ($ch); var_dump($server_output);

But I get only the response: “Not found”

Fixed.
$code = $_GET[“code”];
$data = array(
‘grant_type’ => ‘authorization_code’,
‘code’ => $code,
‘client_id’ => ‘CLIENTID’,
‘client_secret’ => ‘SECRET’,
);
$url = ‘https://api.envato.com/token’;
$ch = curl_init($url);
$postString = http_build_query($data, ‘’, ‘&’);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
var_dump($response);
curl_close($ch);