@@ -6,156 +6,7 @@ Interfaces
66Within CRUDs pre-configured Interfaces have been created. To use an Interface
77import them from interface packages under ``cruds.interfaces.<name> ``.
88
9- Currently available:
9+ .. toctree ::
10+ :maxdepth: 1
1011
11- * Planhat
12-
13- Planhat
14- -------
15-
16- Planhat is a comprehensive customer success platform with immense capabilities. CRUDs offers a
17- full implementation of the Planhat platform as an Interface, providing complete API coverage
18- for all major Planhat features and data models.
19-
20- **Official Documentation URL: ** https://docs.planhat.com/
21-
22- **API Endpoints: **
23-
24- * Main API: https://api.planhat.com/
25- * Analytics API: https://analytics.planhat.com/
26-
27- **Authentication: **
28-
29- * Primary authentication via API token
30- * Secondary authentication via tenant token for analytics endpoints
31- * Configurable rate limiting (default: 200 calls per minute)
32-
33- **Core Features Supported: **
34-
35- **Data Models (20+ entities): **
36-
37- * **Asset ** - Track nested objects like product instances, devices, or custom entities
38- * **Campaign ** - Manage customer campaigns and adoption initiatives
39- * **Churn ** - Log customer churn events and reasons
40- * **Company ** - Core customer accounts with hierarchical structure support
41- * **Conversation ** - Email, chat, support tickets, and custom communication types
42- * **Custom_Field ** - Extend any object with custom properties
43- * **Enduser ** - Individual contacts at customer companies with domain auto-assignment
44- * **Invoice ** - Track billing and invoicing history
45- * **Issue ** - Bug reports and feature requests (Jira integration support)
46- * **License ** - Subscription management with MRR/ARR calculations
47- * **Metrics ** - Dimension data for customer success metrics
48- * **NPS ** - Net Promoter Score survey responses and scoring
49- * **Note ** - Manual notes and conversation logging
50- * **Objective ** - Customer success goals and health tracking
51- * **Opportunity ** - Sales opportunities and expansion tracking
52- * **Project ** - Time-bound initiatives with custom fields
53- * **Sale ** - Non-recurring revenue tracking
54- * **Task ** - Task management with calendar integration
55- * **Ticket ** - Support ticket management with external system sync
56- * **User ** - Team member management and access control
57- * **Workspace ** - Sub-instance tracking for multi-department engagement
58-
59- **Standard CRUD Operations: **
60-
61- All models support the following operations:
62-
63- * ``create() `` - Create new records
64- * ``update() `` - Update existing records by ID, External ID, or Source ID
65- * ``get_by_id() `` - Retrieve records by ID, External ID, or Source ID
66- * ``get_list() `` - Retrieve paginated lists with filtering and sorting
67- * ``delete() `` - Remove records
68- * ``bulk_upsert() `` - Batch create/update operations (up to 5,000 items per request)
69-
70- **Specialized Methods: **
71-
72- **Company Model: **
73-
74- * ``get_lean_list() `` - Lightweight company list for ID matching
75-
76- **Metrics Model: **
77-
78- * ``epoc_days_format() `` - Convert dates to epoch days format
79- * ``get_dimension_data() `` - Retrieve time-series metrics data
80- * ``bulk_insert_metrics() `` - Batch insert metrics with auto-chunking
81-
82- **User Activity Model: **
83-
84- * ``create_activity() `` - Track user engagement events
85- * ``segment() `` - User segmentation and analytics
86-
87- **Advanced Features: **
88-
89- **Bulk Operations: **
90-
91- * Auto-chunking for large datasets
92- * Configurable chunk sizes
93- * Response aggregation and error handling
94- * Rate limiting with automatic delays
95-
96- **Data Formatting: **
97-
98- * Epoch days date format support
99- * External ID and Source ID reference support
100- * Custom field extensibility
101-
102- **Integration Capabilities: **
103-
104- * CRM system synchronization (Salesforce, etc.)
105- * Ticketing system integration (Zendesk, etc.)
106- * Product management tool integration (Jira, Product Board, Aha!)
107- * NPS tool imports
108- * Calendar system integration (Google Calendar)
109- * Webhook support for real-time data sync
110-
111- **Error Handling: **
112-
113- * Custom exception classes for bulk operations
114- * Comprehensive error reporting
115- * Automatic retry mechanisms
116-
117- Example Usage:
118-
119- .. code-block :: python
120-
121- >> > from cruds.interfaces.planhat import Planhat
122- >> >
123- >> > # Initialize with API token and optional tenant token
124- >> > planhat = Planhat(
125- ... api_token = " hJA4eO3tJPhDck1aKLvQ5osvNUfKYdJ7H" ,
126- ... tenant_token = " 1d5df0f5-f217-49da-8997-2878f5986a9f"
127- ... )
128- >> >
129- >> > # Get comprehensive help
130- >> > help (planhat)
131- >> >
132- >> > # Retrieve a company by external ID
133- >> > company = planhat.company.get_by_id(" extid-21432948" )
134- >> >
135- >> > # Bulk upsert licenses
136- >> > licenses_data = [
137- ... {" name" : " Premium Plan" , " companyId" : " extid-123" , " value" : 1000 },
138- ... {" name" : " Basic Plan" , " companyId" : " extid-456" , " value" : 500 }
139- ... ]
140- >> > result = planhat.license.bulk_upsert(licenses_data)
141- >> >
142- >> > # Track user activity
143- >> > activity_data = {
144- ... " event" : " login" ,
145- ... " userId" : " user123" ,
146- ... " companyId" : " extid-123" ,
147- ... " timestamp" : " 2024-01-15T10:30:00Z"
148- ... }
149- >> > planhat.user_activity.create_activity(activity_data)
150- >> >
151- >> > # Insert metrics data
152- >> > metrics_data = {
153- ... " dimensionId" : " daily_logins" ,
154- ... " companyId" : " extid-123" ,
155- ... " value" : 150 ,
156- ... " time" : " 2024-01-15T00:00:00Z"
157- ... }
158- >> > planhat.metrics.bulk_insert_metrics([metrics_data])
159-
160- The configuration file for this Interface can be found on
161- `Github <https://github.com/johnbrandborg/cruds/blob/main/src/cruds/interfaces/planhat/configuration.yaml >`_.
12+ planhat
0 commit comments