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”