PHP code example of musheabdulhakim / gohighlevel-php
1. Go to this page and download the library: Download musheabdulhakim/gohighlevel-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
musheabdulhakim / gohighlevel-php example snippets
use MusheAbdulHakim\GoHighLevel\GoHighLevel;
// Initialize the client with your API key
$client = GoHighLevel::client('ACCESS_TOKEN');
// Example: Get a business by its ID
$businessId = 'your_business_id_here';
$businessData = $client->businesses()->get($businessId);
print_r($businessData);
use MusheAbdulHakim\GoHighLevel\GoHighLevel;
use GuzzleHttp\Client as GuzzleClient;
$client = GoHighLevel::factory()
->withApiKey('YOUR_API_KEY')
// Set a custom base URI (optional)
->withBaseUri('https://custom-api-endpoint.com')
// Set the API Version (optional)
->withVersion('2024-05-15')
// Use a custom PSR-18 HTTP client (optional)
->withHttpClient(new GuzzleClient())
->make();
// Now you can use the fully configured client
$contacts = $client->contacts()->all();