Files
Brancheneinstufung2/connector-superoffice/tools/so_write_debug.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

45 lines
1.3 KiB
Python

import os
import json
import sys
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 debug_update(contact_id):
client = SuperOfficeClient()
print(f"--- Hard-Debug: Update Contact {contact_id} ---")
# 1. Fetch full existing object
contact = client._get(f"Contact/{contact_id}")
if not contact:
print("❌ Could not fetch contact.")
return
print(f"Current Name: {contact.get('Name')}")
print(f"Current Dept: {contact.get('Department')}")
# 2. Modify only one simple field
contact["Department"] = "AI-Test 13:10"
# 3. PUT it back
print("Sending full object back with modified Department...")
result = client._put(f"Contact/{contact_id}", contact)
if result:
print("✅ API accepted the update.")
# Verify immediately
updated = client._get(f"Contact/{contact_id}")
print(f"New Department in SO: {updated.get('Department')}")
else:
print("❌ Update failed.")
if __name__ == "__main__":
debug_update(2)