Go Highlevel Python ease of use library implementation to their API
Project description
Go High Level Python
Go Highlevel Python ease of use library implementation to their API
Go Highlevel ease of use library implementation to their API. Make sure you've create a Go Highlevel App in the Market Place
Brief Overview of the Library
We recommend that you glance over the official Go Highlevel Documentation. We have tried to make the library have a corresponding function for each endpoint. Enjoy the intellisense!
Initialization
from gohighlevel import GoHighLevel
from gohighlevel.classes.auth.credentials import Credentials
credentials=Credentials(api_key="***")
ghl = GoHighLevel(credentials=credentials)
OAuth URL
from gohighlevel import GoHighLevel
from gohighlevel.classes.auth.credentials import Credentials
# Initialize with your client ID and secret
credentials=Credentials(
client_id="your_client_id",
client_secret="your_client_secret"
)
# Initialize with your client ID and secret
ghl = GoHighLevel(credentials=credentials)
# Get OAuth URL
oauth_url = ghl.get_oauth_url(
redirect_uri="your_redirect_uri",
scope=["contacts.readonly", "calendars.write"]
)
print(oauth_url)
OAuth Callback
from gohighlevel import GoHighLevel
from gohighlevel.classes.auth.credentials import Credentials
# Initialize with your client ID and secret
credentials=Credentials(
client_id="your_client_id",
client_secret="your_client_secret"
)
ghl = GoHighLevel(credentials=credentials)
# Exchange code for tokens
tokens = ghl.exchange_code(
code="auth_code_from_callback",
redirect_uri="your_redirect_uri"
)
print(tokens) # Contains access_token, refresh_token, etc.
Calendar Management Examples
# Get all calendars for a location
calendars = ghl.calendar.get_all(location_id="your_location_id")
# Create a new calendar
new_calendar = ghl.calendar.add({
"name": "Team Meetings",
"description": "Calendar for team meetings",
"locationId": "your_location_id"
})
# Get calendar events
events = ghl.calendar.events.get_all(
location_id="your_location_id",
start_time="2024-01-01T00:00:00Z",
end_time="2024-01-31T23:59:59Z"
)
# Create an appointment
appointment = ghl.calendar.events.add_appointment(
location_id="your_location_id",
contact_id="contact_id",
start_time="2024-01-15T10:00:00Z",
calendar={
"title": "Project Review",
"duration": 60,
"calendarId": "calendar_id"
}
)
# Manage calendar groups
groups = ghl.calendar.groups.get_all()
new_group = ghl.calendar.groups.add({
"name": "Sales Team",
"description": "Calendar group for sales team",
"locationId": "your_location_id"
})
# Manage calendar resources
rooms = ghl.calendar.resources.get_all(resource_type="rooms")
new_room = ghl.calendar.resources.add(
resource_type="rooms",
resource={
"name": "Conference Room A",
"capacity": 20,
"locationId": "your_location_id"
}
)
# Manage calendar notifications
notifications = ghl.calendar.notifications.get_all(
calendar_id="calendar_id",
extra={
"is_active": True,
"limit": 10
}
)
# Create appointment notes
note = ghl.calendar.appointmentnotes.add(
appointment_id="appointment_id",
body="Meeting notes: Discussed project timeline",
user_id="user_id"
)
Using Contacts API
# Search contacts
searched_contacts = ghl.contacts.search(query="martin")
# Get all contacts
contacts = ghl.contacts.get_all(location_id="your_location_id")
# Create a new contact
new_contact = ghl.contacts.add({
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phone": "+1234567890",
"locationId": "your_location_id"
})
# Add a task for a contact
task = ghl.contacts.tasks.add(
contact_id="contact_id",
title="Follow up",
due_date="2024-01-15T10:00:00Z"
)
Using Conversations API
# Get all conversations
conversations = ghl.conversations.get_all(location_id="your_location_id")
# Get conversation messages
messages = ghl.conversations.messages.get_all(
conversation_id="conversation_id",
limit=50,
skip=0
)
# Send a message
new_message = ghl.conversations.messages.add(
conversation_id="conversation_id",
message={
"body": "Hello! How can I help you today?",
"type": "text"
}
)
# Send an email in conversation
email_message = ghl.conversations.email.send(
conversation_id="conversation_id",
email={
"subject": "Meeting Follow-up",
"body": "Thank you for your time today...",
"to": ["recipient@example.com"]
}
)
# Get conversation providers
providers = ghl.conversations.providers.get_all(location_id="your_location_id")
# Update conversation status
updated_conversation = ghl.conversations.update(
conversation_id="conversation_id",
data={
"status": "closed",
"assignedTo": "user_id"
}
)
# Search conversations
search_results = ghl.conversations.search(
location_id="your_location_id",
query="customer support",
filters={
"status": "open",
"dateRange": {
"startDate": "2024-01-01T00:00:00Z",
"endDate": "2024-01-31T23:59:59Z"
}
}
)
Support
You can support us with any amount. It's all appreciated.
Support (from Malawi or USA)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gohl-1.0.3.tar.gz.
File metadata
- Download URL: gohl-1.0.3.tar.gz
- Upload date:
- Size: 60.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f2c3dfc876c3e324f53b7847e13bf27abfee753890eeddbb137188b61320e7f
|
|
| MD5 |
c978b021e34eed6ff0ac875fab9d2d5b
|
|
| BLAKE2b-256 |
cbb20bd1556f1cdc9d11e6502deeb1a12f3d270bf10d6efee1f8520f70cbd8e2
|
Provenance
The following attestation bundles were made for gohl-1.0.3.tar.gz:
Publisher:
workflow.yml on M2KDevelopments/gohighlevel-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gohl-1.0.3.tar.gz -
Subject digest:
7f2c3dfc876c3e324f53b7847e13bf27abfee753890eeddbb137188b61320e7f - Sigstore transparency entry: 721997112
- Sigstore integration time:
-
Permalink:
M2KDevelopments/gohighlevel-py@3c72eab5fca31a31371a07111b8ad89a37e17892 -
Branch / Tag:
refs/tags/1.0.3 - Owner: https://github.com/M2KDevelopments
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@3c72eab5fca31a31371a07111b8ad89a37e17892 -
Trigger Event:
release
-
Statement type:
File details
Details for the file gohl-1.0.3-py3-none-any.whl.
File metadata
- Download URL: gohl-1.0.3-py3-none-any.whl
- Upload date:
- Size: 82.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21105ae8f9c7b3440c344296382aea8a63eb6551ccf93b7a952ccf2124676d5d
|
|
| MD5 |
77619bfb8618cc156f0025c0f6360802
|
|
| BLAKE2b-256 |
0912a21b6ca8a9476044905e872d4100e72b16379135a15fa80e23704795be16
|
Provenance
The following attestation bundles were made for gohl-1.0.3-py3-none-any.whl:
Publisher:
workflow.yml on M2KDevelopments/gohighlevel-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gohl-1.0.3-py3-none-any.whl -
Subject digest:
21105ae8f9c7b3440c344296382aea8a63eb6551ccf93b7a952ccf2124676d5d - Sigstore transparency entry: 721997160
- Sigstore integration time:
-
Permalink:
M2KDevelopments/gohighlevel-py@3c72eab5fca31a31371a07111b8ad89a37e17892 -
Branch / Tag:
refs/tags/1.0.3 - Owner: https://github.com/M2KDevelopments
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@3c72eab5fca31a31371a07111b8ad89a37e17892 -
Trigger Event:
release
-
Statement type: