Closed devexpart closed 6 years ago
It's working quite fine when you enable SSL and check the response code / response header to redirect to the userAuth form on Zuhu:
$curl = new Curl();
/** @var Curl $response */
$curl->setGetParams([
'scope' => 'ZohoBugTracker.projects.ALL,ZohoBugTracker.bugs.ALL',
'client_id' => '1000',
'response_type' => 'code',
'access_type' => 'offline',
'redirect_uri' => 'http://11.111.111.111:7000/api/oauth/zoho_auth',
])->setOption(CURLOPT_SSL_VERIFYPEER, true)
->setOption(CURLOPT_SSL_VERIFYHOST, false)
->setOption(CURLOPT_CAINFO, 'C:/Ampps/apache/conf/ssl_crt/cacert.pem')
->get('https://accounts.zoho.com/oauth/v2/auth');
$responseHeaders = $curl->responseHeaders;
if ($curl->responseCode === 302 && isset($responseHeaders['Location'])) {
header("location: ".$responseHeaders['Location']);
die();
}
I also answered this on stackoverflow. Feel free to accept this answer :).
Solved
I am trying to use a GET method to carry of some data from the a URL. I am trying to get a code from a URL by following this Zoho Link
Below is my code
I am using POSTMAN for testing my API but all I see a empty screen. I have also put this question on StackOverFlow.
Can anyone please help me out