Skip to content

Update to work with Zingtree API v1#10

Draft
dtf0 wants to merge 4 commits into
dropbox:masterfrom
dtf0:master
Draft

Update to work with Zingtree API v1#10
dtf0 wants to merge 4 commits into
dropbox:masterfrom
dtf0:master

Conversation

@dtf0

@dtf0 dtf0 commented Jun 21, 2026

Copy link
Copy Markdown

Align zinger with Zingtree API v1

Refactors the CLI and updates it to the v1 API surface, with a matching README.

Script

  • Replaced recursive menu navigation with a while loop; table-driven dispatch.
  • Swapped pycurl for stdlib urllib; python-dotenv now optional. Added a ZingtreeClient with response capture, GET/PUT/DELETE and JSON-body support, and HTTP/network error handling.
    Added an Agent dataclass and a validating zingers.txt parser; type hints and KeyboardInterrupt handling.

API v1 alignment

  • https://help.zingtree.com/hc/en-us/articles/5048766502043-Zingtree-API
  • Base URL to /api/v1/; authentication moved to the X-Api-Key header (token no longer in the path).
  • Removed get_trees (no longer available according to docs). Added get_tree_variables, tree_sessions_last_clicked, delete_file_upload, session_freeze, and vault_files (get/delete).
  • Path encoding keeps ^ literal for search_trees ^^ queries.

README

  • Endpoint list, wildcards (*), date defaults, header auth, and the production 000 suffix updated to match v1.

Unverified

  • Endpoints transcribed from the v1 help doc, not tested against a live key. v1 is the "New Experience" surface.
  • The session_freeze project_id-to-tree-ID mapping needs confirmation.
  • There is also an unconfirmed generation beyond v1: Zingtree v2 public API is documented separately via Postman: Treeqa, new endpoints:
    • GET API Health (/api/v2/health)
    • GET Get Call History (/api/v2/call_history/{{sessionId}})
    • POST Call History (/api/v2/call_history)

dtf0 added 4 commits June 21, 2026 10:52
Added:
- ZingtreeClient over urllib, with response capture and error handling
- Agent dataclass and validating zingers.txt parser
- Lookup tables (MAIN_ITEMS, SUBMENUS, OPERATIONS) for dispatch
- Type hints and KeyboardInterrupt handling

Changed:
- Menu navigation is now a while loop, not recursion
- URL path segments are percent-encoded
- zingers.txt is read only when an operation needs it
- Token check handles a missing variable

Removed:
- pycurl (now stdlib urllib); dotenv import optional
- Duplicate exit helpers, dead branches, sleep delays
Added:
- get_tree_variables, tree_sessions_last_clicked, delete_file_upload,
  session_freeze, vault_files (get/delete), with a new files menu
- PUT/DELETE and JSON body support in ZingtreeClient.call

Changed:
- Base URL to /api/v1/
- Auth to X-Api-Key header; token removed from all paths
- Path encoding keeps ^ literal for search_trees ^^ queries

Removed:
- get_trees (no longer in the API)
- Token-masking logic (token no longer in the URL)
@CLAassistant

CLAassistant commented Jun 21, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants