-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrefresh-token.php
35 lines (29 loc) · 1.24 KB
/
refresh-token.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/**
* Generate Refresh Token
*/
function generate_refresh_token(){
$post = [
'code' => '1000.8223b7ede4813b07017abae80a30f9e1.1ee9854cd3096dda1646771527673ef0',
// 'code' => '1000.f1db3815df0ad132b863e0f9a4dcb30a.3c97c990eb2bf76de34326d742a34cc8', [email protected]
'redirect_uri' => 'https://redesign.bluedotinsights.com/',
'client_id' => '1000.COLQKHAPVIUQUYOL46OFSPTWDERMXE',
'client_secret' => 'fe1c55421bdcf76c19cc133d48eb9ead7a7a4c50ca',
// 'client_id' => '1000.L8KI7KYJ4IFL01S4NLZ0A0X99KU7MB', [email protected]
// 'client_secret' => 'f99dc62ce0be1e791aef69c8273e676112ad601c50', [email protected]
'grant_type' => 'authorization_code'
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://accounts.zoho.com/oauth/v2/token');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
$response = curl_exec( $ch );
$response = json_encode($response);
echo '<pre>';
print_r($response);
}
generate_refresh_token();
?>