API Reference
FreshTotal Control provides two API interfaces for programmatic device control:
| API | Protocol | Best For |
|---|---|---|
| REST API | HTTP/JSON | External tools, CI/CD, cross-language integration |
| JavaScript API | Direct TC scripting | Internal automation, Rhino scripts |
API Categories
Both REST and JS APIs share similar functionality organized into these categories:
| Category | Operations |
|---|---|
| Device | Connect, search, get properties, multi-device |
| App | Open, close, restart, install, uninstall |
| Input | Click, swipe, scroll, send keys |
| Color | Compare, seek, get pixel color |
| Image | Screenshot, seek image, image comparison |
| Text | Input text, clipboard, form fill |
| File | Upload, download, read, write |
| System | ADB, device info, lock/unlock, sleep |
| OCR | Text recognition on screen |
| AAI/FindNode | Query-based UI automation |
| Script | Run, kill, list, wait for scripts |
| Task | Create, manage, monitor parallel tasks |
Quick Comparison
| Feature | REST API | JS API |
|---|---|---|
| Language | Any (HTTP) | JavaScript (Rhino) |
| Authentication | Token-based | None (local) |
| Multi-device | Via device ID param | DeviceArray object |
| Threading | External | TCThread built-in |
| File ops | Upload/download | Full read/write |
| Excel | Not available | Built-in Excel class |
| Triggers | Not available | Event triggers |
| Keyboard shortcuts | Not available | Keyboard class |
Sections
- REST API — HTTP endpoints for external integration
- JavaScript API — Direct scripting interface