Bot & Automation

jorgasisten

/root/hermes-projects/jorgasisten

set_webhook.py text
import http.client
import json

conn = http.client.HTTPConnection("localhost", 8082)
payload = json.dumps({
    "webhook": {
        "enabled": True,
        "url": "http://jorgasisten-bot:8000/webhook/whatsapp",
        "by": "SENDING",
        "events": ["MESSAGES_UPSERT"]
    }
})
headers = {
    'apikey': 'ApiKeyJorgAsisten2026',
    'Content-Type': 'application/json'
}
try:
    conn.request("POST", "/webhook/set/jorgasisten-wa", payload, headers)
    res = conn.getresponse()
    data = res.read()
    print("WEBHOOK RESPONSE:", data.decode("utf-8"))
except Exception as e:
    print("ERROR:", str(e))