@kichat/n8n-nodes-kirimchat 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,6 +5,8 @@ This is an n8n community node for [KirimChat](https://kirim.chat) - a messaging
5
5
  ## Features
6
6
 
7
7
  - **Send Message** - Send text, image, document, audio, video, template, or interactive messages via WhatsApp, Instagram, or Messenger
8
+ - **List Templates** - List all WhatsApp message templates with filtering
9
+ - **Get Template** - Get a specific template by ID
8
10
  - **Mark as Read** - Mark messages as read and send read receipts
9
11
  - **Send Typing Indicator** - Show typing indicator to customers
10
12
  - **Flexible Customer Lookup** - Find customers by ID, phone number, or Instagram username
@@ -133,6 +135,73 @@ Mark a message as read and send read receipt to the customer.
133
135
  |-----------|-------------|
134
136
  | Message ID | The ID of the message to mark as read (e.g., `msg_xyz789`) |
135
137
 
138
+ ### List Templates
139
+
140
+ List all WhatsApp message templates with optional filtering.
141
+
142
+ | Parameter | Description |
143
+ |-----------|-------------|
144
+ | Filter by Status | `All`, `APPROVED`, `PENDING`, or `REJECTED` |
145
+ | Filter by Category | `All`, `MARKETING`, `UTILITY`, or `AUTHENTICATION` |
146
+ | Limit | Maximum templates to return (1-500, default 100) |
147
+
148
+ **Example Response:**
149
+ ```json
150
+ {
151
+ "success": true,
152
+ "data": {
153
+ "templates": [
154
+ {
155
+ "id": "tpl_abc123",
156
+ "templateName": "order_confirmation",
157
+ "language": "en",
158
+ "status": "APPROVED",
159
+ "category": "UTILITY",
160
+ "content": "Your order {{1}} has been confirmed.",
161
+ "headerType": "TEXT",
162
+ "headerContent": "Order Update",
163
+ "footerContent": "Thank you for shopping!",
164
+ "variables": ["order_number"],
165
+ "createdAt": "2025-01-15T10:00:00.000Z"
166
+ }
167
+ ],
168
+ "total": 1
169
+ }
170
+ }
171
+ ```
172
+
173
+ ### Get Template
174
+
175
+ Get a specific WhatsApp message template by ID.
176
+
177
+ | Parameter | Description |
178
+ |-----------|-------------|
179
+ | Template ID | The ID of the template (e.g., `tpl_abc123`) |
180
+
181
+ **Example Response:**
182
+ ```json
183
+ {
184
+ "success": true,
185
+ "data": {
186
+ "id": "tpl_abc123",
187
+ "templateName": "order_confirmation",
188
+ "language": "en",
189
+ "status": "APPROVED",
190
+ "category": "UTILITY",
191
+ "content": "Your order {{1}} has been confirmed.",
192
+ "headerType": "TEXT",
193
+ "headerContent": "Order Update",
194
+ "footerContent": "Thank you for shopping!",
195
+ "buttons": [
196
+ { "type": "URL", "text": "Track Order", "url": "https://..." }
197
+ ],
198
+ "variables": ["order_number"],
199
+ "createdAt": "2025-01-15T10:00:00.000Z",
200
+ "updatedAt": "2025-01-15T10:00:00.000Z"
201
+ }
202
+ }
203
+ ```
204
+
136
205
  ### Send Typing Indicator
137
206
 
138
207
  Show typing indicator to a customer before sending a message.
@@ -218,7 +287,13 @@ The node returns standard error responses:
218
287
 
219
288
  ## Changelog
220
289
 
221
- ### v1.1.0 (Latest)
290
+ ### v1.2.0 (Latest)
291
+ - ✅ Added **List Templates** operation - List all WhatsApp templates with filtering
292
+ - ✅ Added **Get Template** operation - Get template details by ID
293
+ - ✅ Filter templates by status (Approved, Pending, Rejected)
294
+ - ✅ Filter templates by category (Marketing, Utility, Authentication)
295
+
296
+ ### v1.1.0
222
297
  - ✅ Added Messenger channel support
223
298
  - ✅ Added customer lookup by phone number and Instagram username
224
299
  - ✅ Added WhatsApp Interactive messages (CTA URL buttons, Reply buttons)
@@ -75,6 +75,18 @@ class KirimChat {
75
75
  description: 'Send a message to a customer via WhatsApp, Instagram, or Messenger',
76
76
  action: 'Send a message',
77
77
  },
78
+ {
79
+ name: 'List Templates',
80
+ value: 'listTemplates',
81
+ description: 'List WhatsApp message templates',
82
+ action: 'List templates',
83
+ },
84
+ {
85
+ name: 'Get Template',
86
+ value: 'getTemplate',
87
+ description: 'Get a specific WhatsApp message template by ID',
88
+ action: 'Get template',
89
+ },
78
90
  {
79
91
  name: 'Mark as Read',
80
92
  value: 'markAsRead',
@@ -556,6 +568,110 @@ class KirimChat {
556
568
  placeholder: 'msg_xyz789',
557
569
  },
558
570
  // ============================================
571
+ // LIST TEMPLATES FIELDS
572
+ // ============================================
573
+ {
574
+ displayName: 'Filter by Status',
575
+ name: 'templateStatus',
576
+ type: 'options',
577
+ displayOptions: {
578
+ show: {
579
+ operation: ['listTemplates'],
580
+ },
581
+ },
582
+ options: [
583
+ {
584
+ name: 'All',
585
+ value: '',
586
+ description: 'Return all templates',
587
+ },
588
+ {
589
+ name: 'Approved',
590
+ value: 'APPROVED',
591
+ description: 'Only approved templates (ready to use)',
592
+ },
593
+ {
594
+ name: 'Pending',
595
+ value: 'PENDING',
596
+ description: 'Templates pending approval',
597
+ },
598
+ {
599
+ name: 'Rejected',
600
+ value: 'REJECTED',
601
+ description: 'Rejected templates',
602
+ },
603
+ ],
604
+ default: '',
605
+ description: 'Filter templates by approval status',
606
+ },
607
+ {
608
+ displayName: 'Filter by Category',
609
+ name: 'templateCategory',
610
+ type: 'options',
611
+ displayOptions: {
612
+ show: {
613
+ operation: ['listTemplates'],
614
+ },
615
+ },
616
+ options: [
617
+ {
618
+ name: 'All',
619
+ value: '',
620
+ description: 'Return all categories',
621
+ },
622
+ {
623
+ name: 'Marketing',
624
+ value: 'MARKETING',
625
+ description: 'Marketing templates',
626
+ },
627
+ {
628
+ name: 'Utility',
629
+ value: 'UTILITY',
630
+ description: 'Utility templates (order updates, etc.)',
631
+ },
632
+ {
633
+ name: 'Authentication',
634
+ value: 'AUTHENTICATION',
635
+ description: 'Authentication templates (OTP, etc.)',
636
+ },
637
+ ],
638
+ default: '',
639
+ description: 'Filter templates by category',
640
+ },
641
+ {
642
+ displayName: 'Limit',
643
+ name: 'templateLimit',
644
+ type: 'number',
645
+ displayOptions: {
646
+ show: {
647
+ operation: ['listTemplates'],
648
+ },
649
+ },
650
+ default: 100,
651
+ description: 'Maximum number of templates to return (max 500)',
652
+ typeOptions: {
653
+ minValue: 1,
654
+ maxValue: 500,
655
+ },
656
+ },
657
+ // ============================================
658
+ // GET TEMPLATE FIELDS
659
+ // ============================================
660
+ {
661
+ displayName: 'Template ID',
662
+ name: 'templateId',
663
+ type: 'string',
664
+ required: true,
665
+ displayOptions: {
666
+ show: {
667
+ operation: ['getTemplate'],
668
+ },
669
+ },
670
+ default: '',
671
+ description: 'The ID of the template to retrieve',
672
+ placeholder: 'tpl_abc123',
673
+ },
674
+ // ============================================
559
675
  // SEND TYPING FIELDS
560
676
  // ============================================
561
677
  {
@@ -827,6 +943,42 @@ class KirimChat {
827
943
  json: true,
828
944
  });
829
945
  }
946
+ else if (operation === 'listTemplates') {
947
+ // ============================================
948
+ // LIST TEMPLATES OPERATION
949
+ // ============================================
950
+ const templateStatus = this.getNodeParameter('templateStatus', i, '');
951
+ const templateCategory = this.getNodeParameter('templateCategory', i, '');
952
+ const templateLimit = this.getNodeParameter('templateLimit', i, 100);
953
+ // Build query string
954
+ const queryParams = [];
955
+ if (templateStatus) {
956
+ queryParams.push(`status=${templateStatus}`);
957
+ }
958
+ if (templateCategory) {
959
+ queryParams.push(`category=${templateCategory}`);
960
+ }
961
+ if (templateLimit) {
962
+ queryParams.push(`limit=${templateLimit}`);
963
+ }
964
+ const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
965
+ responseData = await this.helpers.httpRequestWithAuthentication.call(this, 'kirimChatApi', {
966
+ method: 'GET',
967
+ url: `${baseUrl}/templates${queryString}`,
968
+ json: true,
969
+ });
970
+ }
971
+ else if (operation === 'getTemplate') {
972
+ // ============================================
973
+ // GET TEMPLATE OPERATION
974
+ // ============================================
975
+ const templateId = this.getNodeParameter('templateId', i);
976
+ responseData = await this.helpers.httpRequestWithAuthentication.call(this, 'kirimChatApi', {
977
+ method: 'GET',
978
+ url: `${baseUrl}/templates/${templateId}`,
979
+ json: true,
980
+ });
981
+ }
830
982
  else if (operation === 'sendTyping') {
831
983
  // ============================================
832
984
  // SEND TYPING INDICATOR OPERATION
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kichat/n8n-nodes-kirimchat",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "n8n community node for KirimChat - Send WhatsApp, Instagram & Messenger messages with interactive buttons, flexible customer lookup, and typing indicators",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",