Skip to content

Instantly share code, notes, and snippets.

@drmmr763
Created September 9, 2015 21:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drmmr763/7655827234f11f417dda to your computer and use it in GitHub Desktop.
Save drmmr763/7655827234f11f417dda to your computer and use it in GitHub Desktop.
hubspot.api
<?php
$query = array(
'refresh_token' => 'xxx', // $this->keys['refresh_token'],
'client_id' => 'yyy', //$this->keys[$this->getClientIdKey()],
'grant_type' => 'refresh_token',
);
$url = 'https://api.hubapi.com/auth/v1/refresh?' . http_build_query($query);
$ch = curl_init();
$headers = array('Content-Type: application/x-www-form-urlencoded');
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, array());
curl_setopt($ch, CURLOPT_URL, $url);
$result = curl_exec($ch);
var_dump($result);
exit();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment