/** * Exchange the refresh token for access token * @param string $refresh_token * @return Array $response */ function refreshAccessToken($refresh_token) { $uri = $this->oauth . "/token/"; $options = array('client_id' => $this->api_key, 'client_secret' => $this->api_secret, 'grant_type' => 'refresh_token', 'refresh_token' => $refresh_token); $response = $refresh_token ? $this->conn->request($uri, $options, "POST") : null; return $response; }
/** * Upload file from url * @param $url * @param array $options */ function url($url, $options = array()) { $uri = $this->endpoint . "/upload"; $options['image'] = $url; return $this->conn->request($uri, $options, "POST"); }