Skip to main content

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

Static Badge Static Badge Static Badge Static Badge


Highlevel

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.

Buy Me A Coffee PayPal Logo

Support (from Malawi or USA)

Support via Paychangu

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gohl-1.0.3.tar.gz (60.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gohl-1.0.3-py3-none-any.whl (82.3 kB view details)

Uploaded Python 3

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

Hashes for gohl-1.0.3.tar.gz
Algorithm Hash digest
SHA256 7f2c3dfc876c3e324f53b7847e13bf27abfee753890eeddbb137188b61320e7f
MD5 c978b021e34eed6ff0ac875fab9d2d5b
BLAKE2b-256 cbb20bd1556f1cdc9d11e6502deeb1a12f3d270bf10d6efee1f8520f70cbd8e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for gohl-1.0.3.tar.gz:

Publisher: workflow.yml on M2KDevelopments/gohighlevel-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for gohl-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 21105ae8f9c7b3440c344296382aea8a63eb6551ccf93b7a952ccf2124676d5d
MD5 77619bfb8618cc156f0025c0f6360802
BLAKE2b-256 0912a21b6ca8a9476044905e872d4100e72b16379135a15fa80e23704795be16

See more details on using hashes here.

Provenance

The following attestation bundles were made for gohl-1.0.3-py3-none-any.whl:

Publisher: workflow.yml on M2KDevelopments/gohighlevel-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page