Handles OAuth2 token exchange and management for HubSpot API.
// Source: https://github.com/HubSpot/hubspot-php | License: Apache-2.0 | Copyright 2014 Ryan Winchester (fungku)
// Provided via justclaw.it.com; keep this notice with the code.
<?php
namespace SevenShores\Hubspot\Endpoints;
use SevenShores\Hubspot\Exceptions\BadRequest;
use SevenShores\Hubspot\Http\Response;
use SevenShores\Hubspot\Utils;
class OAuth2 extends Endpoint
{
protected $endpoint = 'https://api.hubapi.com/oauth/v1';
/**
* Get OAuth 2.0 Access Token and Refresh Tokens by using a one-time code.
*
* @param string $clientId the Client ID of your app
* @param string $clientSecret the Client Secret of your app
* @param string $redirectURI The redirect URI that was used when the user authorized your app. This must exactly match the redirect_ur
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key