Files
Brancheneinstufung2/connector-superoffice/tools/so_surgical_update.py
Floke d021b6b71c refactor: [30388f42] Strukturiere Root-Skripte thematisch neu
- Organisiert eine Vielzahl von Skripten aus dem Root-Verzeichnis in thematische Unterordner, um die Übersichtlichkeit zu verbessern und die Migration vorzubereiten.
- Verschiebt SuperOffice-bezogene Test- und Hilfsskripte in .
- Verschiebt Notion-bezogene Synchronisations- und Import-Skripte in .
- Archiviert eindeutig veraltete und ungenutzte Skripte in .
- Die zentralen Helfer  und  bleiben im Root, da sie von mehreren Tools als Abhängigkeit genutzt werden.
2026-03-06 10:16:08 +00:00

39 lines
1.2 KiB
Python

import os
import json
import sys
import requests
from dotenv import load_dotenv
# Path gymnastics
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "connector-superoffice"))
from superoffice_client import SuperOfficeClient
# Load ENV
load_dotenv(dotenv_path="/home/node/clawd/.env", override=True)
def surgical_update(contact_id):
client = SuperOfficeClient()
print(f"--- Surgical Update: Contact {contact_id} ---")
# We use a MINIMAL payload. SuperOffice REST often prefers this for Stammfelder.
# Note: Using 'contactId' as it appeared in your discovery log.
payload = {
"contactId": int(contact_id),
"Department": "Surgical Update 13:20",
"UrlAddress": "http://robo-planet.de"
}
url = f"{client.base_url}/Contact/{contact_id}"
print(f"Sending PUT to {url} with payload: {payload}")
resp = requests.put(url, headers=client.headers, json=payload)
print(f"Status Code: {resp.status_code}")
print("Full Response Body:")
print(json.dumps(resp.json() if resp.content else {}, indent=2))
if __name__ == "__main__":
surgical_update(2)