Zoho Creator REST API / Unable to generate Refresh and Acess Token

Zoho Creator REST API / Unable to generate Refresh and Acess Token

Learn to use Zoho Creator API V2 - for PHP developers - YouTube

I've been following this video, but it doesn't do anything. This is my code:

  1. $client_id = '1000.DVWESFDFGH1UI51RA0GHGHHDXTSOM2F';
    $client_secret = '9e7a518438be1cfb456b6ce92fc2ij3kj20c67b';
    $code = '1000.2626eccb001d3b6859b5c4ab9456ccfb.dccd2d8a876ddc92be381231235ac14346e';
    $base_acc_url = 'https://accounts.zoho.com';
    $service_url = 'https://creator.zoho.com';

    $token_url =  $base_acc_url . '/oauth/v2/token?grant_type=authorization_code&client_id=' . $client_id. '&
    client_secret=' . $client_secret . '&redirect_uri=http://localhost&code=' . $code;

    generate_refresh_token($token_url);

    function generate_refresh_token($url){
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POST, 1);
        $result = curl_exec($ch);
        curl_close($ch);
        print_r($result);
        return $result;
    }
Am I doing something wrong?