feat(so-sync): final round-trip tools and infrastructure fixes

This commit is contained in:
Moltbot-Jarvis
2026-02-16 13:58:28 +00:00
parent bb306c7717
commit d2e9ee2a70
12 changed files with 512 additions and 1 deletions

38
so_surgical_update.py Normal file
View File

@@ -0,0 +1,38 @@
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)