You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-2Lines changed: 37 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,5 @@
1
1
# GoHighLevel Python SDK
2
2
3
-
4
3
Official Python SDK for the GoHighLevel API. This library provides a convenient way to interact with GoHighLevel's APIs from applications written in Python.
The SDK provides comprehensive webhook support for handling GoHighLevel webhook events, including automatic token management and session storage integration.
85
+
86
+
### Features
87
+
88
+
-**Automatic Token Management**: Handles `INSTALL` and `UNINSTALL` webhooks automatically
89
+
-**Token Storage**: Generates and stores access tokens on `INSTALL`, removes them on `UNINSTALL`
90
+
-**Session Management**: Integrates with your chosen session storage (Memory/MongoDB)
91
+
-**Auto Token Refresh**: Automatically refreshes expired tokens during API calls if tokens are stored
92
+
93
+
### Webhook Handler Setup
94
+
95
+
```python
96
+
from highlevel import HighLevel
97
+
from highlevel.storage import MemorySessionStorage
98
+
99
+
# Initialize the SDK client with session storage
100
+
client = HighLevel(
101
+
client_id="your_client_id",
102
+
client_secret="your_client_secret",
103
+
session_storage=MemorySessionStorage()
104
+
)
105
+
106
+
# Get the webhook middleware
107
+
webhook_middleware = client.webhooks.subscribe()
108
+
109
+
@app.route('/api/webhooks/ghl', methods=['POST'])
110
+
asyncdefhandle_ghl_webhook():
111
+
"""Handle incoming GoHighLevel webhooks"""
112
+
# Process the webhook using the middleware
113
+
await webhook_middleware(request)
114
+
# Add your custom webhook logic here
115
+
return jsonify({"status": "success"}), 200
116
+
```
117
+
83
118
## Documentation
84
119
85
120
-[Official API Documentation](http://marketplace.gohighlevel.com/docs/)
0 commit comments