feat(so-sync): bidirectional round-trip for company data established [lessons-learned]
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from dotenv import load_dotenv
|
||||
import json
|
||||
from config import Config
|
||||
from logging_config import setup_logging
|
||||
@@ -7,18 +8,15 @@ from superoffice_client import SuperOfficeClient
|
||||
logger = setup_logging("inspector")
|
||||
|
||||
def inspect_person(person_id):
|
||||
auth = AuthHandler()
|
||||
client = SuperOfficeClient(auth)
|
||||
load_dotenv(dotenv_path="/home/node/clawd/.env", override=True)
|
||||
client = SuperOfficeClient()
|
||||
logger.info(f"Fetching Person with ID {person_id} to inspect structure...")
|
||||
url = client._get_url(f"v1/Person/{person_id}")
|
||||
try:
|
||||
resp = client.session.get(url, headers=client._get_headers())
|
||||
resp.raise_for_status()
|
||||
person_data = resp.json()
|
||||
person_data = client._get(f"Person/{person_id}")
|
||||
if person_data:
|
||||
print(f"\n--- PERSON STRUCTURE (ID: {person_id}) ---")
|
||||
print(json.dumps(person_data, indent=2))
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to fetch person data: {e}")
|
||||
else:
|
||||
logger.error(f"Failed to fetch person data.")
|
||||
|
||||
if __name__ == "__main__":
|
||||
target_person_id = 9
|
||||
|
||||
Reference in New Issue
Block a user