@xnkee/n8n-nodes-instagram 1.7.0 → 2.1.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/{LICENSE.md → LICENSE} +21 -21
- package/README.md +132 -437
- package/dist/credentials/InstagramApi.credentials.d.ts +10 -0
- package/dist/credentials/InstagramApi.credentials.js +55 -0
- package/dist/credentials/InstagramApi.credentials.js.map +1 -0
- package/dist/credentials/InstagramOAuth2Api.credentials.d.ts +2 -2
- package/dist/credentials/InstagramOAuth2Api.credentials.js +33 -113
- package/dist/credentials/InstagramOAuth2Api.credentials.js.map +1 -1
- package/dist/credentials/InstagramUnifiedLoginOAuth2Api.credentials.d.ts +17 -0
- package/dist/credentials/InstagramUnifiedLoginOAuth2Api.credentials.js +116 -0
- package/dist/credentials/InstagramUnifiedLoginOAuth2Api.credentials.js.map +1 -0
- package/dist/credentials/instagram.svg +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes/Instagram/GenericFunctions.d.ts +27 -23
- package/dist/nodes/Instagram/GenericFunctions.js +182 -223
- package/dist/nodes/Instagram/GenericFunctions.js.map +1 -1
- package/dist/nodes/Instagram/Instagram.node.d.ts +1 -1
- package/dist/nodes/Instagram/Instagram.node.js +109 -2353
- package/dist/nodes/Instagram/Instagram.node.js.map +1 -1
- package/dist/nodes/Instagram/Instagram.node.json +17 -0
- package/dist/nodes/Instagram/InstagramChatTrigger.node.d.ts +17 -0
- package/dist/nodes/Instagram/InstagramChatTrigger.node.js +415 -0
- package/dist/nodes/Instagram/InstagramChatTrigger.node.js.map +1 -0
- package/dist/nodes/Instagram/InstagramChatTrigger.node.json +16 -0
- package/dist/nodes/Instagram/descriptions/comment/Comment.fields.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/comment/Comment.fields.js +161 -0
- package/dist/nodes/Instagram/descriptions/comment/Comment.fields.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/comment/Comment.operations.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/comment/Comment.operations.js +62 -0
- package/dist/nodes/Instagram/descriptions/comment/Comment.operations.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/comment/index.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/comment/index.js +8 -0
- package/dist/nodes/Instagram/descriptions/comment/index.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/custom/Custom.fields.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/custom/Custom.fields.js +65 -0
- package/dist/nodes/Instagram/descriptions/custom/Custom.fields.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/custom/Custom.operations.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/custom/Custom.operations.js +26 -0
- package/dist/nodes/Instagram/descriptions/custom/Custom.operations.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/custom/index.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/custom/index.js +8 -0
- package/dist/nodes/Instagram/descriptions/custom/index.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/index.d.ts +7 -0
- package/dist/nodes/Instagram/descriptions/index.js +24 -0
- package/dist/nodes/Instagram/descriptions/index.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/insight/AccountInsight.fields.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/insight/AccountInsight.fields.js +164 -0
- package/dist/nodes/Instagram/descriptions/insight/AccountInsight.fields.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/insight/Insight.operations.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/insight/Insight.operations.js +32 -0
- package/dist/nodes/Instagram/descriptions/insight/Insight.operations.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/insight/MediaInsight.fields.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/insight/MediaInsight.fields.js +87 -0
- package/dist/nodes/Instagram/descriptions/insight/MediaInsight.fields.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/insight/index.d.ts +4 -0
- package/dist/nodes/Instagram/descriptions/insight/index.js +12 -0
- package/dist/nodes/Instagram/descriptions/insight/index.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/media/Media.operations.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/media/Media.operations.js +62 -0
- package/dist/nodes/Instagram/descriptions/media/Media.operations.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/media/MediaGet.fields.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/media/MediaGet.fields.js +163 -0
- package/dist/nodes/Instagram/descriptions/media/MediaGet.fields.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/media/MediaPublish.fields.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/media/MediaPublish.fields.js +285 -0
- package/dist/nodes/Instagram/descriptions/media/MediaPublish.fields.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/media/index.d.ts +4 -0
- package/dist/nodes/Instagram/descriptions/media/index.js +12 -0
- package/dist/nodes/Instagram/descriptions/media/index.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/mention/Mention.fields.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/mention/Mention.fields.js +122 -0
- package/dist/nodes/Instagram/descriptions/mention/Mention.fields.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/mention/Mention.operations.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/mention/Mention.operations.js +38 -0
- package/dist/nodes/Instagram/descriptions/mention/Mention.operations.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/mention/index.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/mention/index.js +8 -0
- package/dist/nodes/Instagram/descriptions/mention/index.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/message/Message.fields.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/message/Message.fields.js +123 -0
- package/dist/nodes/Instagram/descriptions/message/Message.fields.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/message/Message.operations.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/message/Message.operations.js +44 -0
- package/dist/nodes/Instagram/descriptions/message/Message.operations.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/message/index.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/message/index.js +8 -0
- package/dist/nodes/Instagram/descriptions/message/index.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/user/User.operations.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/user/User.operations.js +38 -0
- package/dist/nodes/Instagram/descriptions/user/User.operations.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/user/UserInsights.fields.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/user/UserInsights.fields.js +164 -0
- package/dist/nodes/Instagram/descriptions/user/UserInsights.fields.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/user/UserProfile.fields.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/user/UserProfile.fields.js +83 -0
- package/dist/nodes/Instagram/descriptions/user/UserProfile.fields.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/user/index.d.ts +4 -0
- package/dist/nodes/Instagram/descriptions/user/index.js +12 -0
- package/dist/nodes/Instagram/descriptions/user/index.js.map +1 -0
- package/dist/nodes/Instagram/handlers/CommentHandler.d.ts +2 -0
- package/dist/nodes/Instagram/handlers/CommentHandler.js +63 -0
- package/dist/nodes/Instagram/handlers/CommentHandler.js.map +1 -0
- package/dist/nodes/Instagram/handlers/CustomHandler.d.ts +2 -0
- package/dist/nodes/Instagram/handlers/CustomHandler.js +28 -0
- package/dist/nodes/Instagram/handlers/CustomHandler.js.map +1 -0
- package/dist/nodes/Instagram/handlers/InsightHandler.d.ts +2 -0
- package/dist/nodes/Instagram/handlers/InsightHandler.js +42 -0
- package/dist/nodes/Instagram/handlers/InsightHandler.js.map +1 -0
- package/dist/nodes/Instagram/handlers/MediaHandler.d.ts +2 -0
- package/dist/nodes/Instagram/handlers/MediaHandler.js +172 -0
- package/dist/nodes/Instagram/handlers/MediaHandler.js.map +1 -0
- package/dist/nodes/Instagram/handlers/MentionHandler.d.ts +2 -0
- package/dist/nodes/Instagram/handlers/MentionHandler.js +48 -0
- package/dist/nodes/Instagram/handlers/MentionHandler.js.map +1 -0
- package/dist/nodes/Instagram/handlers/MessageHandler.d.ts +2 -0
- package/dist/nodes/Instagram/handlers/MessageHandler.js +57 -0
- package/dist/nodes/Instagram/handlers/MessageHandler.js.map +1 -0
- package/dist/nodes/Instagram/handlers/UserHandler.d.ts +2 -0
- package/dist/nodes/Instagram/handlers/UserHandler.js +48 -0
- package/dist/nodes/Instagram/handlers/UserHandler.js.map +1 -0
- package/dist/nodes/Instagram/instagram.svg +1 -0
- package/package.json +34 -46
- package/API_REFERENCE.md +0 -907
- package/AUTHENTICATION_GUIDE.md +0 -718
- package/CHANGELOG.md +0 -391
- package/dist/credentials/InstagramUnifiedLoginApi.credentials.d.ts +0 -9
- package/dist/credentials/InstagramUnifiedLoginApi.credentials.js +0 -481
- package/dist/credentials/InstagramUnifiedLoginApi.credentials.js.map +0 -1
- package/dist/nodes/Instagram/InstagramTrigger.node.d.ts +0 -17
- package/dist/nodes/Instagram/InstagramTrigger.node.js +0 -398
- package/dist/nodes/Instagram/InstagramTrigger.node.js.map +0 -1
- package/dist/nodes/Instagram/instagram-large.svg +0 -27
- package/dist/nodes/Instagram/instagram-small.svg +0 -14
- package/dist/nodes/Instagram/types.d.ts +0 -171
- package/dist/nodes/Instagram/types.js +0 -3
- package/dist/nodes/Instagram/types.js.map +0 -1
- package/dist/package.json +0 -76
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/index.js +0 -0
|
@@ -1,123 +1,89 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.Instagram = void 0;
|
|
37
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
38
|
-
const
|
|
5
|
+
const descriptions_1 = require("./descriptions");
|
|
6
|
+
const UserHandler_1 = require("./handlers/UserHandler");
|
|
7
|
+
const MediaHandler_1 = require("./handlers/MediaHandler");
|
|
8
|
+
const CommentHandler_1 = require("./handlers/CommentHandler");
|
|
9
|
+
const MessageHandler_1 = require("./handlers/MessageHandler");
|
|
10
|
+
const InsightHandler_1 = require("./handlers/InsightHandler");
|
|
11
|
+
const MentionHandler_1 = require("./handlers/MentionHandler");
|
|
12
|
+
const CustomHandler_1 = require("./handlers/CustomHandler");
|
|
13
|
+
const resourceHandlers = {
|
|
14
|
+
user: UserHandler_1.handleUser,
|
|
15
|
+
media: MediaHandler_1.handleMedia,
|
|
16
|
+
comment: CommentHandler_1.handleComment,
|
|
17
|
+
message: MessageHandler_1.handleMessage,
|
|
18
|
+
insight: InsightHandler_1.handleInsight,
|
|
19
|
+
mention: MentionHandler_1.handleMention,
|
|
20
|
+
custom: CustomHandler_1.handleCustom,
|
|
21
|
+
};
|
|
39
22
|
class Instagram {
|
|
40
23
|
constructor() {
|
|
41
24
|
this.description = {
|
|
42
|
-
displayName: 'Instagram',
|
|
25
|
+
displayName: 'Instagram (Business Login)',
|
|
43
26
|
name: 'instagram',
|
|
44
|
-
icon: 'file:instagram
|
|
27
|
+
icon: 'file:instagram.svg',
|
|
45
28
|
group: ['transform'],
|
|
46
|
-
version:
|
|
47
|
-
defaultVersion: 2,
|
|
29
|
+
version: 1,
|
|
48
30
|
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
49
|
-
description: '
|
|
31
|
+
description: 'Interact with Instagram Graph API using Instagram Login (Publish Posts/Reels/Stories/Carousels, Manage Comments, Send DMs, Read Insights, and Mentions)',
|
|
50
32
|
defaults: {
|
|
51
|
-
name: 'Instagram',
|
|
33
|
+
name: 'Instagram (Business Login)',
|
|
52
34
|
},
|
|
53
|
-
|
|
54
|
-
|
|
35
|
+
usableAsTool: true,
|
|
36
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
37
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
55
38
|
credentials: [
|
|
56
39
|
{
|
|
57
|
-
name: '
|
|
40
|
+
name: 'instagramOAuth2Api',
|
|
58
41
|
required: true,
|
|
59
42
|
displayOptions: {
|
|
60
43
|
show: {
|
|
61
|
-
authentication: ['
|
|
44
|
+
authentication: ['oAuth2'],
|
|
62
45
|
},
|
|
63
46
|
},
|
|
64
47
|
},
|
|
65
48
|
{
|
|
66
|
-
name: '
|
|
49
|
+
name: 'instagramApi',
|
|
67
50
|
required: true,
|
|
68
51
|
displayOptions: {
|
|
69
52
|
show: {
|
|
70
|
-
authentication: ['
|
|
53
|
+
authentication: ['accessToken'],
|
|
71
54
|
},
|
|
72
55
|
},
|
|
73
56
|
},
|
|
74
|
-
],
|
|
75
|
-
properties: [
|
|
76
57
|
{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
type: 'options',
|
|
80
|
-
options: [
|
|
81
|
-
{
|
|
82
|
-
name: 'Unified Login (Recommended)',
|
|
83
|
-
value: 'unifiedLogin',
|
|
84
|
-
description: 'Instagram API with Unified Login: client logs in with Instagram or Facebook (graph.facebook.com)',
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
name: 'Instagram Login',
|
|
88
|
-
value: 'instagramLogin',
|
|
89
|
-
description: 'Instagram API with Instagram Login (graph.instagram.com)',
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
default: 'instagramLogin',
|
|
58
|
+
name: 'instagramUnifiedLoginOAuth2Api',
|
|
59
|
+
required: true,
|
|
93
60
|
displayOptions: {
|
|
94
61
|
show: {
|
|
95
|
-
|
|
62
|
+
authentication: ['unifiedLogin'],
|
|
96
63
|
},
|
|
97
64
|
},
|
|
98
65
|
},
|
|
66
|
+
],
|
|
67
|
+
properties: [
|
|
99
68
|
{
|
|
100
69
|
displayName: 'Authentication',
|
|
101
70
|
name: 'authentication',
|
|
102
71
|
type: 'options',
|
|
103
72
|
options: [
|
|
104
73
|
{
|
|
105
|
-
name: '
|
|
106
|
-
value: '
|
|
107
|
-
description: 'Instagram API with Unified Login: client logs in with Instagram or Facebook (graph.facebook.com)',
|
|
74
|
+
name: 'OAuth2 (Business Login - Recommended)',
|
|
75
|
+
value: 'oAuth2',
|
|
108
76
|
},
|
|
109
77
|
{
|
|
110
|
-
name: '
|
|
111
|
-
value: '
|
|
112
|
-
description: 'Instagram API with Instagram Login (graph.instagram.com)',
|
|
78
|
+
name: 'Access Token (Long-Lived User Token)',
|
|
79
|
+
value: 'accessToken',
|
|
113
80
|
},
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
show: {
|
|
118
|
-
'@version': [2],
|
|
81
|
+
{
|
|
82
|
+
name: 'Unified Login (Instagram or Facebook Login)',
|
|
83
|
+
value: 'unifiedLogin',
|
|
119
84
|
},
|
|
120
|
-
|
|
85
|
+
],
|
|
86
|
+
default: 'oAuth2',
|
|
121
87
|
},
|
|
122
88
|
{
|
|
123
89
|
displayName: 'Resource',
|
|
@@ -128,2300 +94,90 @@ class Instagram {
|
|
|
128
94
|
{
|
|
129
95
|
name: 'Comment',
|
|
130
96
|
value: 'comment',
|
|
97
|
+
description: 'Manage comments, replies, hide/unhide, and delete comments on media posts',
|
|
131
98
|
},
|
|
132
99
|
{
|
|
133
|
-
name: '
|
|
134
|
-
value: '
|
|
100
|
+
name: 'Custom API Request',
|
|
101
|
+
value: 'custom',
|
|
102
|
+
description: 'Execute arbitrary Graph API HTTP requests',
|
|
135
103
|
},
|
|
136
104
|
{
|
|
137
|
-
name: 'Message',
|
|
105
|
+
name: 'Direct Message',
|
|
138
106
|
value: 'message',
|
|
107
|
+
description: 'Send text & media direct messages, read conversations and chat history',
|
|
139
108
|
},
|
|
140
109
|
{
|
|
141
|
-
name: '
|
|
142
|
-
value: '
|
|
143
|
-
|
|
144
|
-
{
|
|
145
|
-
name: 'Story',
|
|
146
|
-
value: 'story',
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
name: 'User',
|
|
150
|
-
value: 'user',
|
|
151
|
-
},
|
|
152
|
-
],
|
|
153
|
-
default: 'message',
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
displayName: 'Operation',
|
|
157
|
-
name: 'operation',
|
|
158
|
-
type: 'options',
|
|
159
|
-
noDataExpression: true,
|
|
160
|
-
displayOptions: {
|
|
161
|
-
show: {
|
|
162
|
-
resource: ['comment'],
|
|
163
|
-
},
|
|
164
|
-
},
|
|
165
|
-
options: [
|
|
166
|
-
{
|
|
167
|
-
name: 'Delete',
|
|
168
|
-
value: 'deleteComment',
|
|
169
|
-
description: 'Delete a comment on your media',
|
|
170
|
-
action: 'Delete a comment',
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
name: 'Get Comments',
|
|
174
|
-
value: 'getComments',
|
|
175
|
-
description: 'Get comments on a media post',
|
|
176
|
-
action: 'Get comments on a media post',
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
name: 'Get Replies',
|
|
180
|
-
value: 'getReplies',
|
|
181
|
-
description: 'Get replies to a comment',
|
|
182
|
-
action: 'Get replies to a comment',
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
name: 'Hide/Unhide',
|
|
186
|
-
value: 'toggleVisibility',
|
|
187
|
-
description: 'Hide or unhide a comment',
|
|
188
|
-
action: 'Hide or unhide a comment',
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
name: 'Reply',
|
|
192
|
-
value: 'replyToComment',
|
|
193
|
-
description: 'Reply to a comment publicly',
|
|
194
|
-
action: 'Reply to a comment',
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
name: 'Send Private Reply',
|
|
198
|
-
value: 'sendPrivateReply',
|
|
199
|
-
description: 'Send a private DM to a commenter',
|
|
200
|
-
action: 'Send a private reply to a commenter',
|
|
201
|
-
},
|
|
202
|
-
],
|
|
203
|
-
default: 'getComments',
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
displayName: 'Operation',
|
|
207
|
-
name: 'operation',
|
|
208
|
-
type: 'options',
|
|
209
|
-
noDataExpression: true,
|
|
210
|
-
displayOptions: {
|
|
211
|
-
show: {
|
|
212
|
-
resource: ['message'],
|
|
213
|
-
},
|
|
214
|
-
},
|
|
215
|
-
options: [
|
|
216
|
-
{
|
|
217
|
-
name: 'Send Audio',
|
|
218
|
-
value: 'sendAudio',
|
|
219
|
-
description: 'Send an audio message',
|
|
220
|
-
action: 'Send an audio message',
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
name: 'Send Button Template',
|
|
224
|
-
value: 'sendButtonTemplate',
|
|
225
|
-
description: 'Send a message with buttons',
|
|
226
|
-
action: 'Send a button template message',
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
name: 'Send Generic Template',
|
|
230
|
-
value: 'sendGenericTemplate',
|
|
231
|
-
description: 'Send a carousel of cards',
|
|
232
|
-
action: 'Send a generic template message',
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
name: 'Send Image',
|
|
236
|
-
value: 'sendImage',
|
|
237
|
-
description: 'Send an image message',
|
|
238
|
-
action: 'Send an image message',
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
name: 'Send Quick Replies',
|
|
242
|
-
value: 'sendQuickReplies',
|
|
243
|
-
description: 'Send a message with quick reply options',
|
|
244
|
-
action: 'Send a message with quick replies',
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
name: 'Send Text',
|
|
248
|
-
value: 'sendText',
|
|
249
|
-
description: 'Send a text message',
|
|
250
|
-
action: 'Send a text message',
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
name: 'Send Video',
|
|
254
|
-
value: 'sendVideo',
|
|
255
|
-
description: 'Send a video message',
|
|
256
|
-
action: 'Send a video message',
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
name: 'Upload Media',
|
|
260
|
-
value: 'uploadMedia',
|
|
261
|
-
description: 'Upload media to Instagram',
|
|
262
|
-
action: 'Upload media',
|
|
263
|
-
},
|
|
264
|
-
],
|
|
265
|
-
default: 'sendText',
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
displayName: 'Operation',
|
|
269
|
-
name: 'operation',
|
|
270
|
-
type: 'options',
|
|
271
|
-
noDataExpression: true,
|
|
272
|
-
displayOptions: {
|
|
273
|
-
show: {
|
|
274
|
-
resource: ['media'],
|
|
275
|
-
},
|
|
276
|
-
},
|
|
277
|
-
options: [
|
|
278
|
-
{
|
|
279
|
-
name: 'Get Media',
|
|
280
|
-
value: 'getMedia',
|
|
281
|
-
description: 'Get media object information',
|
|
282
|
-
action: 'Get media',
|
|
283
|
-
},
|
|
284
|
-
{
|
|
285
|
-
name: 'Get Media Children',
|
|
286
|
-
value: 'getMediaChildren',
|
|
287
|
-
description: 'Get children of a carousel album',
|
|
288
|
-
action: 'Get media children',
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
name: 'List Media',
|
|
292
|
-
value: 'listMedia',
|
|
293
|
-
description: 'Get list of media objects',
|
|
294
|
-
action: 'List media',
|
|
295
|
-
},
|
|
296
|
-
],
|
|
297
|
-
default: 'listMedia',
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
displayName: 'Operation',
|
|
301
|
-
name: 'operation',
|
|
302
|
-
type: 'options',
|
|
303
|
-
noDataExpression: true,
|
|
304
|
-
displayOptions: {
|
|
305
|
-
show: {
|
|
306
|
-
resource: ['post'],
|
|
307
|
-
},
|
|
308
|
-
},
|
|
309
|
-
options: [
|
|
310
|
-
{
|
|
311
|
-
name: 'Create Single Post',
|
|
312
|
-
value: 'createSinglePost',
|
|
313
|
-
description: 'Create a single image or video post',
|
|
314
|
-
action: 'Create a single post',
|
|
315
|
-
},
|
|
316
|
-
{
|
|
317
|
-
name: 'Create Carousel Post',
|
|
318
|
-
value: 'createCarouselPost',
|
|
319
|
-
description: 'Create a carousel post with multiple images/videos',
|
|
320
|
-
action: 'Create a carousel post',
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
name: 'Create Reel',
|
|
324
|
-
value: 'createReel',
|
|
325
|
-
description: 'Create a reel (short video)',
|
|
326
|
-
action: 'Create a reel',
|
|
327
|
-
},
|
|
328
|
-
{
|
|
329
|
-
name: 'Publish Post',
|
|
330
|
-
value: 'publishPost',
|
|
331
|
-
description: 'Publish a media container',
|
|
332
|
-
action: 'Publish a post',
|
|
333
|
-
},
|
|
334
|
-
],
|
|
335
|
-
default: 'createSinglePost',
|
|
336
|
-
},
|
|
337
|
-
{
|
|
338
|
-
displayName: 'Operation',
|
|
339
|
-
name: 'operation',
|
|
340
|
-
type: 'options',
|
|
341
|
-
noDataExpression: true,
|
|
342
|
-
displayOptions: {
|
|
343
|
-
show: {
|
|
344
|
-
resource: ['story'],
|
|
345
|
-
},
|
|
346
|
-
},
|
|
347
|
-
options: [
|
|
348
|
-
{
|
|
349
|
-
name: 'Create Story',
|
|
350
|
-
value: 'createStory',
|
|
351
|
-
description: 'Create a story (image or video)',
|
|
352
|
-
action: 'Create a story',
|
|
353
|
-
},
|
|
354
|
-
],
|
|
355
|
-
default: 'createStory',
|
|
356
|
-
},
|
|
357
|
-
{
|
|
358
|
-
displayName: 'Operation',
|
|
359
|
-
name: 'operation',
|
|
360
|
-
type: 'options',
|
|
361
|
-
noDataExpression: true,
|
|
362
|
-
displayOptions: {
|
|
363
|
-
show: {
|
|
364
|
-
resource: ['user'],
|
|
365
|
-
},
|
|
366
|
-
},
|
|
367
|
-
options: [
|
|
368
|
-
{
|
|
369
|
-
name: 'Get My Profile',
|
|
370
|
-
value: 'getMyProfile',
|
|
371
|
-
description: 'Get authenticated account profile information',
|
|
372
|
-
action: 'Get my profile',
|
|
110
|
+
name: 'Insight',
|
|
111
|
+
value: 'insight',
|
|
112
|
+
description: 'Retrieve detailed metrics and statistics for accounts and media items',
|
|
373
113
|
},
|
|
374
114
|
{
|
|
375
|
-
name: '
|
|
376
|
-
value: '
|
|
377
|
-
description: '
|
|
378
|
-
action: 'Get user profile',
|
|
379
|
-
},
|
|
380
|
-
],
|
|
381
|
-
default: 'getMyProfile',
|
|
382
|
-
},
|
|
383
|
-
{
|
|
384
|
-
displayName: 'Media ID',
|
|
385
|
-
name: 'commentMediaId',
|
|
386
|
-
type: 'string',
|
|
387
|
-
required: true,
|
|
388
|
-
displayOptions: {
|
|
389
|
-
show: {
|
|
390
|
-
resource: ['comment'],
|
|
391
|
-
operation: ['getComments'],
|
|
392
|
-
},
|
|
393
|
-
},
|
|
394
|
-
default: '',
|
|
395
|
-
placeholder: '17895695668004550',
|
|
396
|
-
description: 'ID of the media post to get comments from',
|
|
397
|
-
},
|
|
398
|
-
{
|
|
399
|
-
displayName: 'Return All',
|
|
400
|
-
name: 'returnAll',
|
|
401
|
-
type: 'boolean',
|
|
402
|
-
displayOptions: {
|
|
403
|
-
show: {
|
|
404
|
-
resource: ['comment'],
|
|
405
|
-
operation: ['getComments'],
|
|
406
|
-
},
|
|
407
|
-
},
|
|
408
|
-
default: false,
|
|
409
|
-
description: 'Whether to return all comments or only up to a given limit',
|
|
410
|
-
},
|
|
411
|
-
{
|
|
412
|
-
displayName: 'Limit',
|
|
413
|
-
name: 'limit',
|
|
414
|
-
type: 'number',
|
|
415
|
-
displayOptions: {
|
|
416
|
-
show: {
|
|
417
|
-
resource: ['comment'],
|
|
418
|
-
operation: ['getComments'],
|
|
419
|
-
returnAll: [false],
|
|
420
|
-
},
|
|
421
|
-
},
|
|
422
|
-
typeOptions: {
|
|
423
|
-
minValue: 1,
|
|
424
|
-
},
|
|
425
|
-
default: 50,
|
|
426
|
-
description: 'Max number of comments to return',
|
|
427
|
-
},
|
|
428
|
-
{
|
|
429
|
-
displayName: 'Comment ID',
|
|
430
|
-
name: 'commentId',
|
|
431
|
-
type: 'string',
|
|
432
|
-
required: true,
|
|
433
|
-
displayOptions: {
|
|
434
|
-
show: {
|
|
435
|
-
resource: ['comment'],
|
|
436
|
-
operation: ['getReplies'],
|
|
437
|
-
},
|
|
438
|
-
},
|
|
439
|
-
default: '',
|
|
440
|
-
placeholder: '17870913679156914',
|
|
441
|
-
description: 'ID of the comment to get replies from',
|
|
442
|
-
},
|
|
443
|
-
{
|
|
444
|
-
displayName: 'Comment ID',
|
|
445
|
-
name: 'commentId',
|
|
446
|
-
type: 'string',
|
|
447
|
-
required: true,
|
|
448
|
-
displayOptions: {
|
|
449
|
-
show: {
|
|
450
|
-
resource: ['comment'],
|
|
451
|
-
operation: ['replyToComment'],
|
|
452
|
-
},
|
|
453
|
-
},
|
|
454
|
-
default: '',
|
|
455
|
-
placeholder: '17870913679156914',
|
|
456
|
-
description: 'ID of the comment to reply to',
|
|
457
|
-
},
|
|
458
|
-
{
|
|
459
|
-
displayName: 'Reply Message',
|
|
460
|
-
name: 'replyMessage',
|
|
461
|
-
type: 'string',
|
|
462
|
-
required: true,
|
|
463
|
-
displayOptions: {
|
|
464
|
-
show: {
|
|
465
|
-
resource: ['comment'],
|
|
466
|
-
operation: ['replyToComment'],
|
|
467
|
-
},
|
|
468
|
-
},
|
|
469
|
-
default: '',
|
|
470
|
-
placeholder: 'Thanks for your comment!',
|
|
471
|
-
description: 'The message to post as a reply to the comment',
|
|
472
|
-
},
|
|
473
|
-
{
|
|
474
|
-
displayName: 'Comment ID',
|
|
475
|
-
name: 'commentId',
|
|
476
|
-
type: 'string',
|
|
477
|
-
required: true,
|
|
478
|
-
displayOptions: {
|
|
479
|
-
show: {
|
|
480
|
-
resource: ['comment'],
|
|
481
|
-
operation: ['sendPrivateReply'],
|
|
482
|
-
},
|
|
483
|
-
},
|
|
484
|
-
default: '',
|
|
485
|
-
placeholder: '17870913679156914',
|
|
486
|
-
description: 'ID of the comment to reply to privately. The commenter will receive a DM.',
|
|
487
|
-
},
|
|
488
|
-
{
|
|
489
|
-
displayName: 'Private Message',
|
|
490
|
-
name: 'privateMessage',
|
|
491
|
-
type: 'string',
|
|
492
|
-
required: true,
|
|
493
|
-
displayOptions: {
|
|
494
|
-
show: {
|
|
495
|
-
resource: ['comment'],
|
|
496
|
-
operation: ['sendPrivateReply'],
|
|
497
|
-
},
|
|
498
|
-
},
|
|
499
|
-
default: '',
|
|
500
|
-
placeholder: 'Thanks for commenting! Here is more info...',
|
|
501
|
-
description: 'The private message to send to the commenter via DM. Must be sent within 7 days of the comment.',
|
|
502
|
-
},
|
|
503
|
-
{
|
|
504
|
-
displayName: 'Comment ID',
|
|
505
|
-
name: 'commentId',
|
|
506
|
-
type: 'string',
|
|
507
|
-
required: true,
|
|
508
|
-
displayOptions: {
|
|
509
|
-
show: {
|
|
510
|
-
resource: ['comment'],
|
|
511
|
-
operation: ['deleteComment'],
|
|
512
|
-
},
|
|
513
|
-
},
|
|
514
|
-
default: '',
|
|
515
|
-
placeholder: '17870913679156914',
|
|
516
|
-
description: 'ID of the comment to delete',
|
|
517
|
-
},
|
|
518
|
-
{
|
|
519
|
-
displayName: 'Comment ID',
|
|
520
|
-
name: 'commentId',
|
|
521
|
-
type: 'string',
|
|
522
|
-
required: true,
|
|
523
|
-
displayOptions: {
|
|
524
|
-
show: {
|
|
525
|
-
resource: ['comment'],
|
|
526
|
-
operation: ['toggleVisibility'],
|
|
527
|
-
},
|
|
528
|
-
},
|
|
529
|
-
default: '',
|
|
530
|
-
placeholder: '17870913679156914',
|
|
531
|
-
description: 'ID of the comment to hide or unhide',
|
|
532
|
-
},
|
|
533
|
-
{
|
|
534
|
-
displayName: 'Action',
|
|
535
|
-
name: 'hideAction',
|
|
536
|
-
type: 'options',
|
|
537
|
-
required: true,
|
|
538
|
-
displayOptions: {
|
|
539
|
-
show: {
|
|
540
|
-
resource: ['comment'],
|
|
541
|
-
operation: ['toggleVisibility'],
|
|
115
|
+
name: 'Media / Post',
|
|
116
|
+
value: 'media',
|
|
117
|
+
description: 'Publish photos, videos, reels, stories, carousels, and manage posts',
|
|
542
118
|
},
|
|
543
|
-
},
|
|
544
|
-
options: [
|
|
545
119
|
{
|
|
546
|
-
name: '
|
|
547
|
-
value: '
|
|
548
|
-
description: '
|
|
120
|
+
name: 'Mention',
|
|
121
|
+
value: 'mention',
|
|
122
|
+
description: 'Handle mentions in captions/comments and reply to tagged media',
|
|
549
123
|
},
|
|
550
124
|
{
|
|
551
|
-
name: '
|
|
552
|
-
value: '
|
|
553
|
-
description: '
|
|
554
|
-
},
|
|
555
|
-
],
|
|
556
|
-
default: '
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
125
|
+
name: 'User / Profile',
|
|
126
|
+
value: 'user',
|
|
127
|
+
description: 'Get authenticated user or target user profile details and insights',
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
default: 'user',
|
|
131
|
+
},
|
|
132
|
+
// Operations & Fields definitions
|
|
133
|
+
...descriptions_1.userOperations,
|
|
134
|
+
...descriptions_1.userFields,
|
|
135
|
+
...descriptions_1.mediaOperations,
|
|
136
|
+
...descriptions_1.mediaFields,
|
|
137
|
+
...descriptions_1.commentOperations,
|
|
138
|
+
...descriptions_1.commentFields,
|
|
139
|
+
...descriptions_1.messageOperations,
|
|
140
|
+
...descriptions_1.messageFields,
|
|
141
|
+
...descriptions_1.insightOperations,
|
|
142
|
+
...descriptions_1.insightFields,
|
|
143
|
+
...descriptions_1.mentionOperations,
|
|
144
|
+
...descriptions_1.mentionFields,
|
|
145
|
+
...descriptions_1.customOperations,
|
|
146
|
+
...descriptions_1.customFields,
|
|
147
|
+
],
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
async execute() {
|
|
151
|
+
const items = this.getInputData();
|
|
152
|
+
const returnData = [];
|
|
153
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
154
|
+
const operation = this.getNodeParameter('operation', 0, '');
|
|
155
|
+
const handler = resourceHandlers[resource];
|
|
156
|
+
if (!handler) {
|
|
157
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported resource: ${resource}`);
|
|
158
|
+
}
|
|
159
|
+
for (let i = 0; i < items.length; i++) {
|
|
160
|
+
try {
|
|
161
|
+
const responseData = await handler.call(this, operation, i);
|
|
162
|
+
const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
|
|
163
|
+
returnData.push(...executionData);
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
if (this.continueOnFail()) {
|
|
167
|
+
returnData.push({
|
|
168
|
+
json: {
|
|
169
|
+
error: error.message,
|
|
170
|
+
details: error.description || error.context || undefined,
|
|
583
171
|
},
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
placeholder: 'Hello from N8N!',
|
|
587
|
-
description: 'Text message to send (max 1000 characters)',
|
|
588
|
-
},
|
|
589
|
-
{
|
|
590
|
-
displayName: 'Recipient ID',
|
|
591
|
-
name: 'recipientId',
|
|
592
|
-
type: 'string',
|
|
593
|
-
required: true,
|
|
594
|
-
displayOptions: {
|
|
595
|
-
show: {
|
|
596
|
-
resource: ['message'],
|
|
597
|
-
operation: ['sendImage'],
|
|
172
|
+
pairedItem: {
|
|
173
|
+
item: i,
|
|
598
174
|
},
|
|
599
|
-
},
|
|
600
|
-
default: '',
|
|
601
|
-
placeholder: '1234567890',
|
|
602
|
-
description: 'Instagram-scoped user ID (IGSID) of the recipient',
|
|
603
|
-
},
|
|
604
|
-
{
|
|
605
|
-
displayName: 'Image URL',
|
|
606
|
-
name: 'imageUrl',
|
|
607
|
-
type: 'string',
|
|
608
|
-
required: true,
|
|
609
|
-
displayOptions: {
|
|
610
|
-
show: {
|
|
611
|
-
resource: ['message'],
|
|
612
|
-
operation: ['sendImage'],
|
|
613
|
-
},
|
|
614
|
-
},
|
|
615
|
-
default: '',
|
|
616
|
-
placeholder: 'https://example.com/photo.jpg',
|
|
617
|
-
description: 'Public HTTPS URL of the image (JPG, PNG)',
|
|
618
|
-
},
|
|
619
|
-
{
|
|
620
|
-
displayName: 'Is Reusable',
|
|
621
|
-
name: 'isReusable',
|
|
622
|
-
type: 'boolean',
|
|
623
|
-
displayOptions: {
|
|
624
|
-
show: {
|
|
625
|
-
resource: ['message'],
|
|
626
|
-
operation: ['sendImage'],
|
|
627
|
-
},
|
|
628
|
-
},
|
|
629
|
-
default: false,
|
|
630
|
-
description: 'Whether to make the attachment reusable for multiple recipients',
|
|
631
|
-
},
|
|
632
|
-
{
|
|
633
|
-
displayName: 'Recipient ID',
|
|
634
|
-
name: 'recipientId',
|
|
635
|
-
type: 'string',
|
|
636
|
-
required: true,
|
|
637
|
-
displayOptions: {
|
|
638
|
-
show: {
|
|
639
|
-
resource: ['message'],
|
|
640
|
-
operation: ['sendAudio'],
|
|
641
|
-
},
|
|
642
|
-
},
|
|
643
|
-
default: '',
|
|
644
|
-
placeholder: '1234567890',
|
|
645
|
-
description: 'Instagram-scoped user ID (IGSID) of the recipient',
|
|
646
|
-
},
|
|
647
|
-
{
|
|
648
|
-
displayName: 'Audio URL',
|
|
649
|
-
name: 'audioUrl',
|
|
650
|
-
type: 'string',
|
|
651
|
-
required: true,
|
|
652
|
-
displayOptions: {
|
|
653
|
-
show: {
|
|
654
|
-
resource: ['message'],
|
|
655
|
-
operation: ['sendAudio'],
|
|
656
|
-
},
|
|
657
|
-
},
|
|
658
|
-
default: '',
|
|
659
|
-
placeholder: 'https://example.com/voice.mp3',
|
|
660
|
-
description: 'Public HTTPS URL of the audio file',
|
|
661
|
-
},
|
|
662
|
-
{
|
|
663
|
-
displayName: 'Is Reusable',
|
|
664
|
-
name: 'isReusable',
|
|
665
|
-
type: 'boolean',
|
|
666
|
-
displayOptions: {
|
|
667
|
-
show: {
|
|
668
|
-
resource: ['message'],
|
|
669
|
-
operation: ['sendAudio'],
|
|
670
|
-
},
|
|
671
|
-
},
|
|
672
|
-
default: false,
|
|
673
|
-
description: 'Whether to make the attachment reusable for multiple recipients',
|
|
674
|
-
},
|
|
675
|
-
{
|
|
676
|
-
displayName: 'Recipient ID',
|
|
677
|
-
name: 'recipientId',
|
|
678
|
-
type: 'string',
|
|
679
|
-
required: true,
|
|
680
|
-
displayOptions: {
|
|
681
|
-
show: {
|
|
682
|
-
resource: ['message'],
|
|
683
|
-
operation: ['sendVideo'],
|
|
684
|
-
},
|
|
685
|
-
},
|
|
686
|
-
default: '',
|
|
687
|
-
placeholder: '1234567890',
|
|
688
|
-
description: 'Instagram-scoped user ID (IGSID) of the recipient',
|
|
689
|
-
},
|
|
690
|
-
{
|
|
691
|
-
displayName: 'Video URL',
|
|
692
|
-
name: 'videoUrl',
|
|
693
|
-
type: 'string',
|
|
694
|
-
required: true,
|
|
695
|
-
displayOptions: {
|
|
696
|
-
show: {
|
|
697
|
-
resource: ['message'],
|
|
698
|
-
operation: ['sendVideo'],
|
|
699
|
-
},
|
|
700
|
-
},
|
|
701
|
-
default: '',
|
|
702
|
-
placeholder: 'https://example.com/video.mp4',
|
|
703
|
-
description: 'Public HTTPS URL of the video file',
|
|
704
|
-
},
|
|
705
|
-
{
|
|
706
|
-
displayName: 'Is Reusable',
|
|
707
|
-
name: 'isReusable',
|
|
708
|
-
type: 'boolean',
|
|
709
|
-
displayOptions: {
|
|
710
|
-
show: {
|
|
711
|
-
resource: ['message'],
|
|
712
|
-
operation: ['sendVideo'],
|
|
713
|
-
},
|
|
714
|
-
},
|
|
715
|
-
default: false,
|
|
716
|
-
description: 'Whether to make the attachment reusable for multiple recipients',
|
|
717
|
-
},
|
|
718
|
-
{
|
|
719
|
-
displayName: 'Recipient ID',
|
|
720
|
-
name: 'recipientId',
|
|
721
|
-
type: 'string',
|
|
722
|
-
required: true,
|
|
723
|
-
displayOptions: {
|
|
724
|
-
show: {
|
|
725
|
-
resource: ['message'],
|
|
726
|
-
operation: ['sendButtonTemplate'],
|
|
727
|
-
},
|
|
728
|
-
},
|
|
729
|
-
default: '',
|
|
730
|
-
placeholder: '1234567890',
|
|
731
|
-
description: 'Instagram-scoped user ID (IGSID) of the recipient',
|
|
732
|
-
},
|
|
733
|
-
{
|
|
734
|
-
displayName: 'Message Text',
|
|
735
|
-
name: 'messageText',
|
|
736
|
-
type: 'string',
|
|
737
|
-
required: true,
|
|
738
|
-
displayOptions: {
|
|
739
|
-
show: {
|
|
740
|
-
resource: ['message'],
|
|
741
|
-
operation: ['sendButtonTemplate'],
|
|
742
|
-
},
|
|
743
|
-
},
|
|
744
|
-
default: '',
|
|
745
|
-
placeholder: 'Choose an option:',
|
|
746
|
-
description: 'Text to display above buttons (max 640 characters)',
|
|
747
|
-
},
|
|
748
|
-
{
|
|
749
|
-
displayName: 'Buttons',
|
|
750
|
-
name: 'buttons',
|
|
751
|
-
type: 'fixedCollection',
|
|
752
|
-
typeOptions: {
|
|
753
|
-
multipleValues: true,
|
|
754
|
-
maxValues: 3,
|
|
755
|
-
},
|
|
756
|
-
displayOptions: {
|
|
757
|
-
show: {
|
|
758
|
-
resource: ['message'],
|
|
759
|
-
operation: ['sendButtonTemplate'],
|
|
760
|
-
},
|
|
761
|
-
},
|
|
762
|
-
default: {},
|
|
763
|
-
placeholder: 'Add Button',
|
|
764
|
-
options: [
|
|
765
|
-
{
|
|
766
|
-
name: 'button',
|
|
767
|
-
displayName: 'Button',
|
|
768
|
-
values: [
|
|
769
|
-
{
|
|
770
|
-
displayName: 'Type',
|
|
771
|
-
name: 'type',
|
|
772
|
-
type: 'options',
|
|
773
|
-
options: [
|
|
774
|
-
{
|
|
775
|
-
name: 'Web URL',
|
|
776
|
-
value: 'web_url',
|
|
777
|
-
},
|
|
778
|
-
{
|
|
779
|
-
name: 'Postback',
|
|
780
|
-
value: 'postback',
|
|
781
|
-
},
|
|
782
|
-
],
|
|
783
|
-
default: 'web_url',
|
|
784
|
-
description: 'Type of button',
|
|
785
|
-
},
|
|
786
|
-
{
|
|
787
|
-
displayName: 'Title',
|
|
788
|
-
name: 'title',
|
|
789
|
-
type: 'string',
|
|
790
|
-
default: '',
|
|
791
|
-
placeholder: 'Click Me',
|
|
792
|
-
description: 'Button title (max 20 characters)',
|
|
793
|
-
},
|
|
794
|
-
{
|
|
795
|
-
displayName: 'URL',
|
|
796
|
-
name: 'url',
|
|
797
|
-
type: 'string',
|
|
798
|
-
displayOptions: {
|
|
799
|
-
show: {
|
|
800
|
-
type: ['web_url'],
|
|
801
|
-
},
|
|
802
|
-
},
|
|
803
|
-
default: '',
|
|
804
|
-
placeholder: 'https://example.com',
|
|
805
|
-
description: 'Button URL (must be HTTPS)',
|
|
806
|
-
},
|
|
807
|
-
{
|
|
808
|
-
displayName: 'Payload',
|
|
809
|
-
name: 'payload',
|
|
810
|
-
type: 'string',
|
|
811
|
-
displayOptions: {
|
|
812
|
-
show: {
|
|
813
|
-
type: ['postback'],
|
|
814
|
-
},
|
|
815
|
-
},
|
|
816
|
-
default: '',
|
|
817
|
-
placeholder: 'BUTTON_CLICKED',
|
|
818
|
-
description: 'Postback payload (max 1000 characters)',
|
|
819
|
-
},
|
|
820
|
-
],
|
|
821
|
-
},
|
|
822
|
-
],
|
|
823
|
-
},
|
|
824
|
-
{
|
|
825
|
-
displayName: 'Recipient ID',
|
|
826
|
-
name: 'recipientId',
|
|
827
|
-
type: 'string',
|
|
828
|
-
required: true,
|
|
829
|
-
displayOptions: {
|
|
830
|
-
show: {
|
|
831
|
-
resource: ['message'],
|
|
832
|
-
operation: ['sendGenericTemplate'],
|
|
833
|
-
},
|
|
834
|
-
},
|
|
835
|
-
default: '',
|
|
836
|
-
placeholder: '1234567890',
|
|
837
|
-
description: 'Instagram-scoped user ID (IGSID) of the recipient',
|
|
838
|
-
},
|
|
839
|
-
{
|
|
840
|
-
displayName: 'Elements',
|
|
841
|
-
name: 'elements',
|
|
842
|
-
type: 'fixedCollection',
|
|
843
|
-
typeOptions: {
|
|
844
|
-
multipleValues: true,
|
|
845
|
-
maxValues: 10,
|
|
846
|
-
},
|
|
847
|
-
displayOptions: {
|
|
848
|
-
show: {
|
|
849
|
-
resource: ['message'],
|
|
850
|
-
operation: ['sendGenericTemplate'],
|
|
851
|
-
},
|
|
852
|
-
},
|
|
853
|
-
default: {},
|
|
854
|
-
placeholder: 'Add Element',
|
|
855
|
-
options: [
|
|
856
|
-
{
|
|
857
|
-
name: 'element',
|
|
858
|
-
displayName: 'Element',
|
|
859
|
-
values: [
|
|
860
|
-
{
|
|
861
|
-
displayName: 'Buttons',
|
|
862
|
-
name: 'buttons',
|
|
863
|
-
type: 'fixedCollection',
|
|
864
|
-
typeOptions: {
|
|
865
|
-
multipleValues: true,
|
|
866
|
-
maxValues: 3,
|
|
867
|
-
},
|
|
868
|
-
default: {},
|
|
869
|
-
placeholder: 'Add Button',
|
|
870
|
-
options: [
|
|
871
|
-
{
|
|
872
|
-
name: 'button',
|
|
873
|
-
displayName: 'Button',
|
|
874
|
-
values: [
|
|
875
|
-
{
|
|
876
|
-
displayName: 'Type',
|
|
877
|
-
name: 'type',
|
|
878
|
-
type: 'options',
|
|
879
|
-
options: [
|
|
880
|
-
{
|
|
881
|
-
name: 'Web URL',
|
|
882
|
-
value: 'web_url',
|
|
883
|
-
},
|
|
884
|
-
{
|
|
885
|
-
name: 'Postback',
|
|
886
|
-
value: 'postback',
|
|
887
|
-
},
|
|
888
|
-
],
|
|
889
|
-
default: 'web_url',
|
|
890
|
-
description: 'Type of button',
|
|
891
|
-
},
|
|
892
|
-
{
|
|
893
|
-
displayName: 'Title',
|
|
894
|
-
name: 'title',
|
|
895
|
-
type: 'string',
|
|
896
|
-
default: '',
|
|
897
|
-
placeholder: 'Click Me',
|
|
898
|
-
description: 'Button title (max 20 characters)',
|
|
899
|
-
},
|
|
900
|
-
{
|
|
901
|
-
displayName: 'URL',
|
|
902
|
-
name: 'url',
|
|
903
|
-
type: 'string',
|
|
904
|
-
default: '',
|
|
905
|
-
placeholder: 'https://example.com',
|
|
906
|
-
description: 'Button URL (must be HTTPS)',
|
|
907
|
-
},
|
|
908
|
-
{
|
|
909
|
-
displayName: 'Payload',
|
|
910
|
-
name: 'payload',
|
|
911
|
-
type: 'string',
|
|
912
|
-
default: '',
|
|
913
|
-
placeholder: 'BUTTON_CLICKED',
|
|
914
|
-
description: 'Postback payload (max 1000 characters)',
|
|
915
|
-
},
|
|
916
|
-
],
|
|
917
|
-
},
|
|
918
|
-
],
|
|
919
|
-
},
|
|
920
|
-
{
|
|
921
|
-
displayName: 'Default Action',
|
|
922
|
-
name: 'default_action',
|
|
923
|
-
type: 'fixedCollection',
|
|
924
|
-
default: {},
|
|
925
|
-
options: [
|
|
926
|
-
{
|
|
927
|
-
name: 'action',
|
|
928
|
-
displayName: 'Action',
|
|
929
|
-
values: [
|
|
930
|
-
{
|
|
931
|
-
displayName: 'URL',
|
|
932
|
-
name: 'url',
|
|
933
|
-
type: 'string',
|
|
934
|
-
default: '',
|
|
935
|
-
placeholder: 'https://example.com',
|
|
936
|
-
description: 'URL to open when card is tapped (must be HTTPS)',
|
|
937
|
-
},
|
|
938
|
-
],
|
|
939
|
-
},
|
|
940
|
-
],
|
|
941
|
-
},
|
|
942
|
-
{
|
|
943
|
-
displayName: 'Image URL',
|
|
944
|
-
name: 'image_url',
|
|
945
|
-
type: 'string',
|
|
946
|
-
default: '',
|
|
947
|
-
placeholder: 'https://example.com/image.jpg',
|
|
948
|
-
description: 'Image URL for the card',
|
|
949
|
-
},
|
|
950
|
-
{
|
|
951
|
-
displayName: 'Subtitle',
|
|
952
|
-
name: 'subtitle',
|
|
953
|
-
type: 'string',
|
|
954
|
-
default: '',
|
|
955
|
-
placeholder: 'Card subtitle',
|
|
956
|
-
description: 'Element subtitle (max 80 characters)',
|
|
957
|
-
},
|
|
958
|
-
{
|
|
959
|
-
displayName: 'Title',
|
|
960
|
-
name: 'title',
|
|
961
|
-
type: 'string',
|
|
962
|
-
default: '',
|
|
963
|
-
placeholder: 'Card Title',
|
|
964
|
-
description: 'Element title (max 80 characters)',
|
|
965
|
-
},
|
|
966
|
-
],
|
|
967
|
-
},
|
|
968
|
-
],
|
|
969
|
-
},
|
|
970
|
-
{
|
|
971
|
-
displayName: 'Recipient ID',
|
|
972
|
-
name: 'recipientId',
|
|
973
|
-
type: 'string',
|
|
974
|
-
required: true,
|
|
975
|
-
displayOptions: {
|
|
976
|
-
show: {
|
|
977
|
-
resource: ['message'],
|
|
978
|
-
operation: ['sendQuickReplies'],
|
|
979
|
-
},
|
|
980
|
-
},
|
|
981
|
-
default: '',
|
|
982
|
-
placeholder: '1234567890',
|
|
983
|
-
description: 'Instagram-scoped user ID (IGSID) of the recipient',
|
|
984
|
-
},
|
|
985
|
-
{
|
|
986
|
-
displayName: 'Message Text',
|
|
987
|
-
name: 'messageText',
|
|
988
|
-
type: 'string',
|
|
989
|
-
required: true,
|
|
990
|
-
displayOptions: {
|
|
991
|
-
show: {
|
|
992
|
-
resource: ['message'],
|
|
993
|
-
operation: ['sendQuickReplies'],
|
|
994
|
-
},
|
|
995
|
-
},
|
|
996
|
-
default: '',
|
|
997
|
-
placeholder: 'Choose an option:',
|
|
998
|
-
description: 'Text message to display with quick replies',
|
|
999
|
-
},
|
|
1000
|
-
{
|
|
1001
|
-
displayName: 'Quick Replies',
|
|
1002
|
-
name: 'quickReplies',
|
|
1003
|
-
type: 'fixedCollection',
|
|
1004
|
-
typeOptions: {
|
|
1005
|
-
multipleValues: true,
|
|
1006
|
-
maxValues: 13,
|
|
1007
|
-
},
|
|
1008
|
-
displayOptions: {
|
|
1009
|
-
show: {
|
|
1010
|
-
resource: ['message'],
|
|
1011
|
-
operation: ['sendQuickReplies'],
|
|
1012
|
-
},
|
|
1013
|
-
},
|
|
1014
|
-
default: {},
|
|
1015
|
-
placeholder: 'Add Quick Reply',
|
|
1016
|
-
options: [
|
|
1017
|
-
{
|
|
1018
|
-
name: 'quickReply',
|
|
1019
|
-
displayName: 'Quick Reply',
|
|
1020
|
-
values: [
|
|
1021
|
-
{
|
|
1022
|
-
displayName: 'Title',
|
|
1023
|
-
name: 'title',
|
|
1024
|
-
type: 'string',
|
|
1025
|
-
default: '',
|
|
1026
|
-
placeholder: 'Option 1',
|
|
1027
|
-
description: 'Quick reply title (max 20 characters)',
|
|
1028
|
-
},
|
|
1029
|
-
{
|
|
1030
|
-
displayName: 'Payload',
|
|
1031
|
-
name: 'payload',
|
|
1032
|
-
type: 'string',
|
|
1033
|
-
default: '',
|
|
1034
|
-
placeholder: 'OPTION_1',
|
|
1035
|
-
description: 'Payload sent back when clicked (max 1000 characters)',
|
|
1036
|
-
},
|
|
1037
|
-
],
|
|
1038
|
-
},
|
|
1039
|
-
],
|
|
1040
|
-
},
|
|
1041
|
-
{
|
|
1042
|
-
displayName: 'Media Type',
|
|
1043
|
-
name: 'mediaType',
|
|
1044
|
-
type: 'options',
|
|
1045
|
-
displayOptions: {
|
|
1046
|
-
show: {
|
|
1047
|
-
resource: ['message'],
|
|
1048
|
-
operation: ['uploadMedia'],
|
|
1049
|
-
},
|
|
1050
|
-
},
|
|
1051
|
-
options: [
|
|
1052
|
-
{
|
|
1053
|
-
name: 'Image',
|
|
1054
|
-
value: 'IMAGE',
|
|
1055
|
-
},
|
|
1056
|
-
{
|
|
1057
|
-
name: 'Video',
|
|
1058
|
-
value: 'VIDEO',
|
|
1059
|
-
},
|
|
1060
|
-
{
|
|
1061
|
-
name: 'Reels',
|
|
1062
|
-
value: 'REELS',
|
|
1063
|
-
},
|
|
1064
|
-
{
|
|
1065
|
-
name: 'Stories',
|
|
1066
|
-
value: 'STORIES',
|
|
1067
|
-
},
|
|
1068
|
-
],
|
|
1069
|
-
default: 'IMAGE',
|
|
1070
|
-
description: 'Type of media to upload',
|
|
1071
|
-
},
|
|
1072
|
-
{
|
|
1073
|
-
displayName: 'Media URL',
|
|
1074
|
-
name: 'mediaUrl',
|
|
1075
|
-
type: 'string',
|
|
1076
|
-
required: true,
|
|
1077
|
-
displayOptions: {
|
|
1078
|
-
show: {
|
|
1079
|
-
resource: ['message'],
|
|
1080
|
-
operation: ['uploadMedia'],
|
|
1081
|
-
},
|
|
1082
|
-
},
|
|
1083
|
-
default: '',
|
|
1084
|
-
placeholder: 'https://example.com/image.jpg',
|
|
1085
|
-
description: 'Public URL of the media file',
|
|
1086
|
-
},
|
|
1087
|
-
{
|
|
1088
|
-
displayName: 'Caption',
|
|
1089
|
-
name: 'caption',
|
|
1090
|
-
type: 'string',
|
|
1091
|
-
displayOptions: {
|
|
1092
|
-
show: {
|
|
1093
|
-
resource: ['message'],
|
|
1094
|
-
operation: ['uploadMedia'],
|
|
1095
|
-
},
|
|
1096
|
-
},
|
|
1097
|
-
default: '',
|
|
1098
|
-
placeholder: 'Check out this photo!',
|
|
1099
|
-
description: 'Caption for the media',
|
|
1100
|
-
},
|
|
1101
|
-
{
|
|
1102
|
-
displayName: 'Return All',
|
|
1103
|
-
name: 'returnAll',
|
|
1104
|
-
type: 'boolean',
|
|
1105
|
-
displayOptions: {
|
|
1106
|
-
show: {
|
|
1107
|
-
resource: ['media'],
|
|
1108
|
-
operation: ['listMedia'],
|
|
1109
|
-
},
|
|
1110
|
-
},
|
|
1111
|
-
default: false,
|
|
1112
|
-
description: 'Whether to return all results or only up to a given limit',
|
|
1113
|
-
},
|
|
1114
|
-
{
|
|
1115
|
-
displayName: 'Limit',
|
|
1116
|
-
name: 'limit',
|
|
1117
|
-
type: 'number',
|
|
1118
|
-
displayOptions: {
|
|
1119
|
-
show: {
|
|
1120
|
-
resource: ['media'],
|
|
1121
|
-
operation: ['listMedia'],
|
|
1122
|
-
returnAll: [false],
|
|
1123
|
-
},
|
|
1124
|
-
},
|
|
1125
|
-
typeOptions: {
|
|
1126
|
-
minValue: 1,
|
|
1127
|
-
},
|
|
1128
|
-
default: 50,
|
|
1129
|
-
description: 'Max number of results to return',
|
|
1130
|
-
},
|
|
1131
|
-
{
|
|
1132
|
-
displayName: 'Fields',
|
|
1133
|
-
name: 'mediaFields',
|
|
1134
|
-
type: 'multiOptions',
|
|
1135
|
-
displayOptions: {
|
|
1136
|
-
show: {
|
|
1137
|
-
resource: ['media'],
|
|
1138
|
-
operation: ['listMedia'],
|
|
1139
|
-
},
|
|
1140
|
-
},
|
|
1141
|
-
options: [
|
|
1142
|
-
{ name: 'Caption', value: 'caption' },
|
|
1143
|
-
{ name: 'Comments Count', value: 'comments_count' },
|
|
1144
|
-
{ name: 'ID', value: 'id' },
|
|
1145
|
-
{ name: 'Is Comment Enabled', value: 'is_comment_enabled' },
|
|
1146
|
-
{ name: 'Like Count', value: 'like_count' },
|
|
1147
|
-
{ name: 'Media Type', value: 'media_type' },
|
|
1148
|
-
{ name: 'Media URL', value: 'media_url' },
|
|
1149
|
-
{ name: 'Owner', value: 'owner' },
|
|
1150
|
-
{ name: 'Permalink', value: 'permalink' },
|
|
1151
|
-
{ name: 'Thumbnail URL', value: 'thumbnail_url' },
|
|
1152
|
-
{ name: 'Timestamp', value: 'timestamp' },
|
|
1153
|
-
{ name: 'Username', value: 'username' },
|
|
1154
|
-
],
|
|
1155
|
-
default: ['id', 'media_type', 'media_url', 'permalink', 'timestamp'],
|
|
1156
|
-
description: 'Fields to retrieve for each media item',
|
|
1157
|
-
},
|
|
1158
|
-
{
|
|
1159
|
-
displayName: 'Media ID',
|
|
1160
|
-
name: 'mediaId',
|
|
1161
|
-
type: 'string',
|
|
1162
|
-
required: true,
|
|
1163
|
-
displayOptions: {
|
|
1164
|
-
show: {
|
|
1165
|
-
resource: ['media'],
|
|
1166
|
-
operation: ['getMedia', 'getMediaChildren'],
|
|
1167
|
-
},
|
|
1168
|
-
},
|
|
1169
|
-
default: '',
|
|
1170
|
-
placeholder: '17895695668004550',
|
|
1171
|
-
description: 'ID of the media object',
|
|
1172
|
-
},
|
|
1173
|
-
{
|
|
1174
|
-
displayName: 'Fields',
|
|
1175
|
-
name: 'mediaDetailFields',
|
|
1176
|
-
type: 'multiOptions',
|
|
1177
|
-
displayOptions: {
|
|
1178
|
-
show: {
|
|
1179
|
-
resource: ['media'],
|
|
1180
|
-
operation: ['getMedia'],
|
|
1181
|
-
},
|
|
1182
|
-
},
|
|
1183
|
-
options: [
|
|
1184
|
-
{ name: 'Caption', value: 'caption' },
|
|
1185
|
-
{ name: 'Children', value: 'children' },
|
|
1186
|
-
{ name: 'Comments Count', value: 'comments_count' },
|
|
1187
|
-
{ name: 'ID', value: 'id' },
|
|
1188
|
-
{ name: 'Is Comment Enabled', value: 'is_comment_enabled' },
|
|
1189
|
-
{ name: 'Like Count', value: 'like_count' },
|
|
1190
|
-
{ name: 'Media Product Type', value: 'media_product_type' },
|
|
1191
|
-
{ name: 'Media Type', value: 'media_type' },
|
|
1192
|
-
{ name: 'Media URL', value: 'media_url' },
|
|
1193
|
-
{ name: 'Owner', value: 'owner' },
|
|
1194
|
-
{ name: 'Permalink', value: 'permalink' },
|
|
1195
|
-
{ name: 'Shortcode', value: 'shortcode' },
|
|
1196
|
-
{ name: 'Thumbnail URL', value: 'thumbnail_url' },
|
|
1197
|
-
{ name: 'Timestamp', value: 'timestamp' },
|
|
1198
|
-
{ name: 'Username', value: 'username' },
|
|
1199
|
-
],
|
|
1200
|
-
default: ['id', 'media_type', 'media_url', 'permalink', 'caption'],
|
|
1201
|
-
description: 'Fields to retrieve for the media object',
|
|
1202
|
-
},
|
|
1203
|
-
{
|
|
1204
|
-
displayName: 'Media Type',
|
|
1205
|
-
name: 'postMediaType',
|
|
1206
|
-
type: 'options',
|
|
1207
|
-
required: true,
|
|
1208
|
-
displayOptions: {
|
|
1209
|
-
show: {
|
|
1210
|
-
resource: ['post'],
|
|
1211
|
-
operation: ['createSinglePost'],
|
|
1212
|
-
},
|
|
1213
|
-
},
|
|
1214
|
-
options: [
|
|
1215
|
-
{ name: 'Image', value: 'IMAGE' },
|
|
1216
|
-
{ name: 'Video', value: 'VIDEO' },
|
|
1217
|
-
],
|
|
1218
|
-
default: 'IMAGE',
|
|
1219
|
-
description: 'Type of media for the post',
|
|
1220
|
-
},
|
|
1221
|
-
{
|
|
1222
|
-
displayName: 'Image URL',
|
|
1223
|
-
name: 'postImageUrl',
|
|
1224
|
-
type: 'string',
|
|
1225
|
-
required: true,
|
|
1226
|
-
displayOptions: {
|
|
1227
|
-
show: {
|
|
1228
|
-
resource: ['post'],
|
|
1229
|
-
operation: ['createSinglePost'],
|
|
1230
|
-
postMediaType: ['IMAGE'],
|
|
1231
|
-
},
|
|
1232
|
-
},
|
|
1233
|
-
default: '',
|
|
1234
|
-
placeholder: 'https://example.com/image.jpg',
|
|
1235
|
-
description: 'Public URL of the image (must be HTTPS)',
|
|
1236
|
-
},
|
|
1237
|
-
{
|
|
1238
|
-
displayName: 'Video URL',
|
|
1239
|
-
name: 'postVideoUrl',
|
|
1240
|
-
type: 'string',
|
|
1241
|
-
required: true,
|
|
1242
|
-
displayOptions: {
|
|
1243
|
-
show: {
|
|
1244
|
-
resource: ['post'],
|
|
1245
|
-
operation: ['createSinglePost'],
|
|
1246
|
-
postMediaType: ['VIDEO'],
|
|
1247
|
-
},
|
|
1248
|
-
},
|
|
1249
|
-
default: '',
|
|
1250
|
-
placeholder: 'https://example.com/video.mp4',
|
|
1251
|
-
description: 'Public URL of the video (must be HTTPS)',
|
|
1252
|
-
},
|
|
1253
|
-
{
|
|
1254
|
-
displayName: 'Caption',
|
|
1255
|
-
name: 'postCaption',
|
|
1256
|
-
type: 'string',
|
|
1257
|
-
displayOptions: {
|
|
1258
|
-
show: {
|
|
1259
|
-
resource: ['post'],
|
|
1260
|
-
operation: ['createSinglePost'],
|
|
1261
|
-
},
|
|
1262
|
-
},
|
|
1263
|
-
default: '',
|
|
1264
|
-
placeholder: 'Check out this amazing photo! #instagram',
|
|
1265
|
-
description: 'Caption for the post (supports hashtags and @mentions)',
|
|
1266
|
-
},
|
|
1267
|
-
{
|
|
1268
|
-
displayName: 'Additional Options',
|
|
1269
|
-
name: 'postAdditionalOptions',
|
|
1270
|
-
type: 'collection',
|
|
1271
|
-
placeholder: 'Add Option',
|
|
1272
|
-
default: {},
|
|
1273
|
-
displayOptions: {
|
|
1274
|
-
show: {
|
|
1275
|
-
resource: ['post'],
|
|
1276
|
-
operation: ['createSinglePost'],
|
|
1277
|
-
},
|
|
1278
|
-
},
|
|
1279
|
-
options: [
|
|
1280
|
-
{
|
|
1281
|
-
displayName: 'Collaborators',
|
|
1282
|
-
name: 'collaborators',
|
|
1283
|
-
type: 'string',
|
|
1284
|
-
default: '',
|
|
1285
|
-
placeholder: '["17841400001234567","17841400009876543"]',
|
|
1286
|
-
description: 'JSON array of Instagram account IDs to tag as collaborators',
|
|
1287
|
-
},
|
|
1288
|
-
{
|
|
1289
|
-
displayName: 'Location ID',
|
|
1290
|
-
name: 'location_id',
|
|
1291
|
-
type: 'string',
|
|
1292
|
-
default: '',
|
|
1293
|
-
placeholder: '123456789',
|
|
1294
|
-
description: 'Facebook Page ID to tag the post location',
|
|
1295
|
-
},
|
|
1296
|
-
{
|
|
1297
|
-
displayName: 'Product Tags',
|
|
1298
|
-
name: 'product_tags',
|
|
1299
|
-
type: 'fixedCollection',
|
|
1300
|
-
typeOptions: {
|
|
1301
|
-
multipleValues: true,
|
|
1302
|
-
},
|
|
1303
|
-
default: {},
|
|
1304
|
-
placeholder: 'Add Product Tag',
|
|
1305
|
-
description: 'Tag products in the photo (requires Instagram Shopping)',
|
|
1306
|
-
options: [
|
|
1307
|
-
{
|
|
1308
|
-
name: 'tag',
|
|
1309
|
-
displayName: 'Product Tag',
|
|
1310
|
-
values: [
|
|
1311
|
-
{
|
|
1312
|
-
displayName: 'Product ID',
|
|
1313
|
-
name: 'product_id',
|
|
1314
|
-
type: 'string',
|
|
1315
|
-
default: '',
|
|
1316
|
-
placeholder: '1234567890',
|
|
1317
|
-
description: 'Facebook catalog product ID',
|
|
1318
|
-
},
|
|
1319
|
-
{
|
|
1320
|
-
displayName: 'X Position',
|
|
1321
|
-
name: 'x',
|
|
1322
|
-
type: 'number',
|
|
1323
|
-
typeOptions: {
|
|
1324
|
-
minValue: 0,
|
|
1325
|
-
maxValue: 1,
|
|
1326
|
-
numberPrecision: 2,
|
|
1327
|
-
},
|
|
1328
|
-
default: 0.5,
|
|
1329
|
-
description: 'X coordinate (0.0 to 1.0)',
|
|
1330
|
-
},
|
|
1331
|
-
{
|
|
1332
|
-
displayName: 'Y Position',
|
|
1333
|
-
name: 'y',
|
|
1334
|
-
type: 'number',
|
|
1335
|
-
typeOptions: {
|
|
1336
|
-
minValue: 0,
|
|
1337
|
-
maxValue: 1,
|
|
1338
|
-
numberPrecision: 2,
|
|
1339
|
-
},
|
|
1340
|
-
default: 0.5,
|
|
1341
|
-
description: 'Y coordinate (0.0 to 1.0)',
|
|
1342
|
-
},
|
|
1343
|
-
],
|
|
1344
|
-
},
|
|
1345
|
-
],
|
|
1346
|
-
},
|
|
1347
|
-
{
|
|
1348
|
-
displayName: 'Share to Feed',
|
|
1349
|
-
name: 'share_to_feed',
|
|
1350
|
-
type: 'boolean',
|
|
1351
|
-
default: true,
|
|
1352
|
-
description: 'Whether to share this post to feed (for reels)',
|
|
1353
|
-
},
|
|
1354
|
-
{
|
|
1355
|
-
displayName: 'Thumb Offset',
|
|
1356
|
-
name: 'thumb_offset',
|
|
1357
|
-
type: 'number',
|
|
1358
|
-
displayOptions: {
|
|
1359
|
-
show: {
|
|
1360
|
-
'/postMediaType': ['VIDEO'],
|
|
1361
|
-
},
|
|
1362
|
-
},
|
|
1363
|
-
default: 0,
|
|
1364
|
-
description: 'Video thumbnail frame offset in milliseconds',
|
|
1365
|
-
},
|
|
1366
|
-
{
|
|
1367
|
-
displayName: 'User Tags',
|
|
1368
|
-
name: 'user_tags',
|
|
1369
|
-
type: 'fixedCollection',
|
|
1370
|
-
typeOptions: {
|
|
1371
|
-
multipleValues: true,
|
|
1372
|
-
},
|
|
1373
|
-
default: {},
|
|
1374
|
-
placeholder: 'Add User Tag',
|
|
1375
|
-
description: 'Tag users in the photo',
|
|
1376
|
-
options: [
|
|
1377
|
-
{
|
|
1378
|
-
name: 'tag',
|
|
1379
|
-
displayName: 'Tag',
|
|
1380
|
-
values: [
|
|
1381
|
-
{
|
|
1382
|
-
displayName: 'Username',
|
|
1383
|
-
name: 'username',
|
|
1384
|
-
type: 'string',
|
|
1385
|
-
default: '',
|
|
1386
|
-
placeholder: 'johndoe',
|
|
1387
|
-
description: 'Instagram username to tag',
|
|
1388
|
-
},
|
|
1389
|
-
{
|
|
1390
|
-
displayName: 'X Position',
|
|
1391
|
-
name: 'x',
|
|
1392
|
-
type: 'number',
|
|
1393
|
-
typeOptions: {
|
|
1394
|
-
minValue: 0,
|
|
1395
|
-
maxValue: 1,
|
|
1396
|
-
numberPrecision: 2,
|
|
1397
|
-
},
|
|
1398
|
-
default: 0.5,
|
|
1399
|
-
description: 'X coordinate (0.0 to 1.0)',
|
|
1400
|
-
},
|
|
1401
|
-
{
|
|
1402
|
-
displayName: 'Y Position',
|
|
1403
|
-
name: 'y',
|
|
1404
|
-
type: 'number',
|
|
1405
|
-
typeOptions: {
|
|
1406
|
-
minValue: 0,
|
|
1407
|
-
maxValue: 1,
|
|
1408
|
-
numberPrecision: 2,
|
|
1409
|
-
},
|
|
1410
|
-
default: 0.5,
|
|
1411
|
-
description: 'Y coordinate (0.0 to 1.0)',
|
|
1412
|
-
},
|
|
1413
|
-
],
|
|
1414
|
-
},
|
|
1415
|
-
],
|
|
1416
|
-
},
|
|
1417
|
-
],
|
|
1418
|
-
},
|
|
1419
|
-
{
|
|
1420
|
-
displayName: 'Children',
|
|
1421
|
-
name: 'carouselChildren',
|
|
1422
|
-
type: 'fixedCollection',
|
|
1423
|
-
typeOptions: {
|
|
1424
|
-
multipleValues: true,
|
|
1425
|
-
minValues: 2,
|
|
1426
|
-
maxValues: 10,
|
|
1427
|
-
},
|
|
1428
|
-
required: true,
|
|
1429
|
-
displayOptions: {
|
|
1430
|
-
show: {
|
|
1431
|
-
resource: ['post'],
|
|
1432
|
-
operation: ['createCarouselPost'],
|
|
1433
|
-
},
|
|
1434
|
-
},
|
|
1435
|
-
default: {},
|
|
1436
|
-
placeholder: 'Add Media Item',
|
|
1437
|
-
description: 'Media items for the carousel (2-10 items)',
|
|
1438
|
-
options: [
|
|
1439
|
-
{
|
|
1440
|
-
name: 'child',
|
|
1441
|
-
displayName: 'Media Item',
|
|
1442
|
-
values: [
|
|
1443
|
-
{
|
|
1444
|
-
displayName: 'Media Type',
|
|
1445
|
-
name: 'media_type',
|
|
1446
|
-
type: 'options',
|
|
1447
|
-
options: [
|
|
1448
|
-
{ name: 'Image', value: 'IMAGE' },
|
|
1449
|
-
{ name: 'Video', value: 'VIDEO' },
|
|
1450
|
-
],
|
|
1451
|
-
default: 'IMAGE',
|
|
1452
|
-
description: 'Type of media',
|
|
1453
|
-
},
|
|
1454
|
-
{
|
|
1455
|
-
displayName: 'Image URL',
|
|
1456
|
-
name: 'image_url',
|
|
1457
|
-
type: 'string',
|
|
1458
|
-
displayOptions: {
|
|
1459
|
-
show: {
|
|
1460
|
-
media_type: ['IMAGE'],
|
|
1461
|
-
},
|
|
1462
|
-
},
|
|
1463
|
-
default: '',
|
|
1464
|
-
placeholder: 'https://example.com/image.jpg',
|
|
1465
|
-
description: 'Public URL of the image',
|
|
1466
|
-
},
|
|
1467
|
-
{
|
|
1468
|
-
displayName: 'Video URL',
|
|
1469
|
-
name: 'video_url',
|
|
1470
|
-
type: 'string',
|
|
1471
|
-
displayOptions: {
|
|
1472
|
-
show: {
|
|
1473
|
-
media_type: ['VIDEO'],
|
|
1474
|
-
},
|
|
1475
|
-
},
|
|
1476
|
-
default: '',
|
|
1477
|
-
placeholder: 'https://example.com/video.mp4',
|
|
1478
|
-
description: 'Public URL of the video',
|
|
1479
|
-
},
|
|
1480
|
-
{
|
|
1481
|
-
displayName: 'User Tags',
|
|
1482
|
-
name: 'user_tags',
|
|
1483
|
-
type: 'string',
|
|
1484
|
-
default: '',
|
|
1485
|
-
placeholder: '[{"username":"johndoe","x":0.5,"y":0.5}]',
|
|
1486
|
-
description: 'JSON array of user tags for this media item',
|
|
1487
|
-
},
|
|
1488
|
-
],
|
|
1489
|
-
},
|
|
1490
|
-
],
|
|
1491
|
-
},
|
|
1492
|
-
{
|
|
1493
|
-
displayName: 'Caption',
|
|
1494
|
-
name: 'carouselCaption',
|
|
1495
|
-
type: 'string',
|
|
1496
|
-
displayOptions: {
|
|
1497
|
-
show: {
|
|
1498
|
-
resource: ['post'],
|
|
1499
|
-
operation: ['createCarouselPost'],
|
|
1500
|
-
},
|
|
1501
|
-
},
|
|
1502
|
-
default: '',
|
|
1503
|
-
placeholder: 'Swipe to see more! #carousel',
|
|
1504
|
-
description: 'Caption for the carousel post',
|
|
1505
|
-
},
|
|
1506
|
-
{
|
|
1507
|
-
displayName: 'Additional Options',
|
|
1508
|
-
name: 'carouselAdditionalOptions',
|
|
1509
|
-
type: 'collection',
|
|
1510
|
-
placeholder: 'Add Option',
|
|
1511
|
-
default: {},
|
|
1512
|
-
displayOptions: {
|
|
1513
|
-
show: {
|
|
1514
|
-
resource: ['post'],
|
|
1515
|
-
operation: ['createCarouselPost'],
|
|
1516
|
-
},
|
|
1517
|
-
},
|
|
1518
|
-
options: [
|
|
1519
|
-
{
|
|
1520
|
-
displayName: 'Location ID',
|
|
1521
|
-
name: 'location_id',
|
|
1522
|
-
type: 'string',
|
|
1523
|
-
default: '',
|
|
1524
|
-
placeholder: '123456789',
|
|
1525
|
-
description: 'Facebook Page ID to tag the post location',
|
|
1526
|
-
},
|
|
1527
|
-
{
|
|
1528
|
-
displayName: 'Collaborators',
|
|
1529
|
-
name: 'collaborators',
|
|
1530
|
-
type: 'string',
|
|
1531
|
-
default: '',
|
|
1532
|
-
placeholder: '["17841400001234567"]',
|
|
1533
|
-
description: 'JSON array of Instagram account IDs to tag as collaborators',
|
|
1534
|
-
},
|
|
1535
|
-
],
|
|
1536
|
-
},
|
|
1537
|
-
{
|
|
1538
|
-
displayName: 'Video URL',
|
|
1539
|
-
name: 'reelVideoUrl',
|
|
1540
|
-
type: 'string',
|
|
1541
|
-
required: true,
|
|
1542
|
-
displayOptions: {
|
|
1543
|
-
show: {
|
|
1544
|
-
resource: ['post'],
|
|
1545
|
-
operation: ['createReel'],
|
|
1546
|
-
},
|
|
1547
|
-
},
|
|
1548
|
-
default: '',
|
|
1549
|
-
placeholder: 'https://example.com/reel.mp4',
|
|
1550
|
-
description: 'Public URL of the video (must be HTTPS, max 60 seconds)',
|
|
1551
|
-
},
|
|
1552
|
-
{
|
|
1553
|
-
displayName: 'Caption',
|
|
1554
|
-
name: 'reelCaption',
|
|
1555
|
-
type: 'string',
|
|
1556
|
-
displayOptions: {
|
|
1557
|
-
show: {
|
|
1558
|
-
resource: ['post'],
|
|
1559
|
-
operation: ['createReel'],
|
|
1560
|
-
},
|
|
1561
|
-
},
|
|
1562
|
-
default: '',
|
|
1563
|
-
placeholder: 'Check out this reel! #reels',
|
|
1564
|
-
description: 'Caption for the reel',
|
|
1565
|
-
},
|
|
1566
|
-
{
|
|
1567
|
-
displayName: 'Additional Options',
|
|
1568
|
-
name: 'reelAdditionalOptions',
|
|
1569
|
-
type: 'collection',
|
|
1570
|
-
placeholder: 'Add Option',
|
|
1571
|
-
default: {},
|
|
1572
|
-
displayOptions: {
|
|
1573
|
-
show: {
|
|
1574
|
-
resource: ['post'],
|
|
1575
|
-
operation: ['createReel'],
|
|
1576
|
-
},
|
|
1577
|
-
},
|
|
1578
|
-
options: [
|
|
1579
|
-
{
|
|
1580
|
-
displayName: 'Audio Name',
|
|
1581
|
-
name: 'audio_name',
|
|
1582
|
-
type: 'string',
|
|
1583
|
-
default: '',
|
|
1584
|
-
placeholder: 'Original Audio - Username',
|
|
1585
|
-
description: 'Name of the audio track',
|
|
1586
|
-
},
|
|
1587
|
-
{
|
|
1588
|
-
displayName: 'Collaborators',
|
|
1589
|
-
name: 'collaborators',
|
|
1590
|
-
type: 'string',
|
|
1591
|
-
default: '',
|
|
1592
|
-
placeholder: '["17841400001234567"]',
|
|
1593
|
-
description: 'JSON array of Instagram account IDs',
|
|
1594
|
-
},
|
|
1595
|
-
{
|
|
1596
|
-
displayName: 'Cover URL',
|
|
1597
|
-
name: 'cover_url',
|
|
1598
|
-
type: 'string',
|
|
1599
|
-
default: '',
|
|
1600
|
-
placeholder: 'https://example.com/cover.jpg',
|
|
1601
|
-
description: 'Public URL of the reel cover image',
|
|
1602
|
-
},
|
|
1603
|
-
{
|
|
1604
|
-
displayName: 'Location ID',
|
|
1605
|
-
name: 'location_id',
|
|
1606
|
-
type: 'string',
|
|
1607
|
-
default: '',
|
|
1608
|
-
placeholder: '123456789',
|
|
1609
|
-
description: 'Facebook Page ID to tag the location',
|
|
1610
|
-
},
|
|
1611
|
-
{
|
|
1612
|
-
displayName: 'Share to Feed',
|
|
1613
|
-
name: 'share_to_feed',
|
|
1614
|
-
type: 'boolean',
|
|
1615
|
-
default: true,
|
|
1616
|
-
description: 'Whether to share this reel to feed',
|
|
1617
|
-
},
|
|
1618
|
-
{
|
|
1619
|
-
displayName: 'Thumb Offset',
|
|
1620
|
-
name: 'thumb_offset',
|
|
1621
|
-
type: 'number',
|
|
1622
|
-
default: 0,
|
|
1623
|
-
description: 'Video thumbnail frame offset in milliseconds',
|
|
1624
|
-
},
|
|
1625
|
-
],
|
|
1626
|
-
},
|
|
1627
|
-
{
|
|
1628
|
-
displayName: 'Creation ID',
|
|
1629
|
-
name: 'creationId',
|
|
1630
|
-
type: 'string',
|
|
1631
|
-
required: true,
|
|
1632
|
-
displayOptions: {
|
|
1633
|
-
show: {
|
|
1634
|
-
resource: ['post'],
|
|
1635
|
-
operation: ['publishPost'],
|
|
1636
|
-
},
|
|
1637
|
-
},
|
|
1638
|
-
default: '',
|
|
1639
|
-
placeholder: '17895695668004550',
|
|
1640
|
-
description: 'ID of the media container to publish (from create operation)',
|
|
1641
|
-
},
|
|
1642
|
-
{
|
|
1643
|
-
displayName: 'Media Type',
|
|
1644
|
-
name: 'storyMediaType',
|
|
1645
|
-
type: 'options',
|
|
1646
|
-
required: true,
|
|
1647
|
-
displayOptions: {
|
|
1648
|
-
show: {
|
|
1649
|
-
resource: ['story'],
|
|
1650
|
-
operation: ['createStory'],
|
|
1651
|
-
},
|
|
1652
|
-
},
|
|
1653
|
-
options: [
|
|
1654
|
-
{ name: 'Image', value: 'IMAGE' },
|
|
1655
|
-
{ name: 'Video', value: 'VIDEO' },
|
|
1656
|
-
],
|
|
1657
|
-
default: 'IMAGE',
|
|
1658
|
-
description: 'Type of media for the story',
|
|
1659
|
-
},
|
|
1660
|
-
{
|
|
1661
|
-
displayName: 'Image URL',
|
|
1662
|
-
name: 'storyImageUrl',
|
|
1663
|
-
type: 'string',
|
|
1664
|
-
required: true,
|
|
1665
|
-
displayOptions: {
|
|
1666
|
-
show: {
|
|
1667
|
-
resource: ['story'],
|
|
1668
|
-
operation: ['createStory'],
|
|
1669
|
-
storyMediaType: ['IMAGE'],
|
|
1670
|
-
},
|
|
1671
|
-
},
|
|
1672
|
-
default: '',
|
|
1673
|
-
placeholder: 'https://example.com/story.jpg',
|
|
1674
|
-
description: 'Public URL of the image (must be HTTPS)',
|
|
1675
|
-
},
|
|
1676
|
-
{
|
|
1677
|
-
displayName: 'Video URL',
|
|
1678
|
-
name: 'storyVideoUrl',
|
|
1679
|
-
type: 'string',
|
|
1680
|
-
required: true,
|
|
1681
|
-
displayOptions: {
|
|
1682
|
-
show: {
|
|
1683
|
-
resource: ['story'],
|
|
1684
|
-
operation: ['createStory'],
|
|
1685
|
-
storyMediaType: ['VIDEO'],
|
|
1686
|
-
},
|
|
1687
|
-
},
|
|
1688
|
-
default: '',
|
|
1689
|
-
placeholder: 'https://example.com/story.mp4',
|
|
1690
|
-
description: 'Public URL of the video (must be HTTPS, max 60 seconds)',
|
|
1691
|
-
},
|
|
1692
|
-
{
|
|
1693
|
-
displayName: 'Additional Options',
|
|
1694
|
-
name: 'storyAdditionalOptions',
|
|
1695
|
-
type: 'collection',
|
|
1696
|
-
placeholder: 'Add Option',
|
|
1697
|
-
default: {},
|
|
1698
|
-
displayOptions: {
|
|
1699
|
-
show: {
|
|
1700
|
-
resource: ['story'],
|
|
1701
|
-
operation: ['createStory'],
|
|
1702
|
-
},
|
|
1703
|
-
},
|
|
1704
|
-
options: [
|
|
1705
|
-
{
|
|
1706
|
-
displayName: 'Location ID',
|
|
1707
|
-
name: 'location_id',
|
|
1708
|
-
type: 'string',
|
|
1709
|
-
default: '',
|
|
1710
|
-
placeholder: '123456789',
|
|
1711
|
-
description: 'Facebook Page ID to tag the story location',
|
|
1712
|
-
},
|
|
1713
|
-
{
|
|
1714
|
-
displayName: 'Collaborators',
|
|
1715
|
-
name: 'collaborators',
|
|
1716
|
-
type: 'string',
|
|
1717
|
-
default: '',
|
|
1718
|
-
placeholder: '["17841400001234567"]',
|
|
1719
|
-
description: 'JSON array of Instagram account IDs',
|
|
1720
|
-
},
|
|
1721
|
-
],
|
|
1722
|
-
},
|
|
1723
|
-
{
|
|
1724
|
-
displayName: 'User ID',
|
|
1725
|
-
name: 'userId',
|
|
1726
|
-
type: 'string',
|
|
1727
|
-
required: true,
|
|
1728
|
-
displayOptions: {
|
|
1729
|
-
show: {
|
|
1730
|
-
resource: ['user'],
|
|
1731
|
-
operation: ['getProfile'],
|
|
1732
|
-
},
|
|
1733
|
-
},
|
|
1734
|
-
default: '',
|
|
1735
|
-
placeholder: '1234567890',
|
|
1736
|
-
description: 'Instagram-scoped user ID (IGSID)',
|
|
1737
|
-
},
|
|
1738
|
-
{
|
|
1739
|
-
displayName: 'Fields',
|
|
1740
|
-
name: 'fields',
|
|
1741
|
-
type: 'multiOptions',
|
|
1742
|
-
displayOptions: {
|
|
1743
|
-
show: {
|
|
1744
|
-
resource: ['user'],
|
|
1745
|
-
operation: ['getProfile'],
|
|
1746
|
-
},
|
|
1747
|
-
},
|
|
1748
|
-
options: [
|
|
1749
|
-
{
|
|
1750
|
-
name: 'Follower Count',
|
|
1751
|
-
value: 'follower_count',
|
|
1752
|
-
},
|
|
1753
|
-
{
|
|
1754
|
-
name: 'ID',
|
|
1755
|
-
value: 'id',
|
|
1756
|
-
},
|
|
1757
|
-
{
|
|
1758
|
-
name: 'Is Business Follow User',
|
|
1759
|
-
value: 'is_business_follow_user',
|
|
1760
|
-
},
|
|
1761
|
-
{
|
|
1762
|
-
name: 'Is User Follow Business',
|
|
1763
|
-
value: 'is_user_follow_business',
|
|
1764
|
-
},
|
|
1765
|
-
{
|
|
1766
|
-
name: 'Is Verified User',
|
|
1767
|
-
value: 'is_verified_user',
|
|
1768
|
-
},
|
|
1769
|
-
{
|
|
1770
|
-
name: 'Name',
|
|
1771
|
-
value: 'name',
|
|
1772
|
-
},
|
|
1773
|
-
{
|
|
1774
|
-
name: 'Profile Picture',
|
|
1775
|
-
value: 'profile_pic',
|
|
1776
|
-
},
|
|
1777
|
-
{
|
|
1778
|
-
name: 'Username',
|
|
1779
|
-
value: 'username',
|
|
1780
|
-
},
|
|
1781
|
-
],
|
|
1782
|
-
default: ['id', 'name', 'username', 'follower_count'],
|
|
1783
|
-
description: 'Fields to retrieve from user profile',
|
|
1784
|
-
},
|
|
1785
|
-
{
|
|
1786
|
-
displayName: 'Fields',
|
|
1787
|
-
name: 'myProfileFields',
|
|
1788
|
-
type: 'multiOptions',
|
|
1789
|
-
displayOptions: {
|
|
1790
|
-
show: {
|
|
1791
|
-
resource: ['user'],
|
|
1792
|
-
operation: ['getMyProfile'],
|
|
1793
|
-
authentication: ['unifiedLogin'],
|
|
1794
|
-
},
|
|
1795
|
-
},
|
|
1796
|
-
options: [
|
|
1797
|
-
{ name: 'Biography', value: 'biography' },
|
|
1798
|
-
{ name: 'Followers Count', value: 'followers_count' },
|
|
1799
|
-
{ name: 'Follows Count', value: 'follows_count' },
|
|
1800
|
-
{ name: 'ID', value: 'id' },
|
|
1801
|
-
{ name: 'Media Count', value: 'media_count' },
|
|
1802
|
-
{ name: 'Name', value: 'name' },
|
|
1803
|
-
{ name: 'Profile Picture URL', value: 'profile_picture_url' },
|
|
1804
|
-
{ name: 'Username', value: 'username' },
|
|
1805
|
-
{ name: 'Website', value: 'website' },
|
|
1806
|
-
],
|
|
1807
|
-
default: ['id', 'username', 'name', 'followers_count', 'media_count'],
|
|
1808
|
-
description: 'Fields to retrieve from the connected Instagram professional account',
|
|
1809
|
-
},
|
|
1810
|
-
{
|
|
1811
|
-
displayName: 'Fields',
|
|
1812
|
-
name: 'myProfileFields',
|
|
1813
|
-
type: 'multiOptions',
|
|
1814
|
-
displayOptions: {
|
|
1815
|
-
show: {
|
|
1816
|
-
resource: ['user'],
|
|
1817
|
-
operation: ['getMyProfile'],
|
|
1818
|
-
authentication: ['instagramLogin'],
|
|
1819
|
-
},
|
|
1820
|
-
},
|
|
1821
|
-
options: [
|
|
1822
|
-
{
|
|
1823
|
-
name: 'Account Type',
|
|
1824
|
-
value: 'account_type',
|
|
1825
|
-
},
|
|
1826
|
-
{
|
|
1827
|
-
name: 'Followers Count',
|
|
1828
|
-
value: 'followers_count',
|
|
1829
|
-
},
|
|
1830
|
-
{
|
|
1831
|
-
name: 'Follows Count',
|
|
1832
|
-
value: 'follows_count',
|
|
1833
|
-
},
|
|
1834
|
-
{
|
|
1835
|
-
name: 'ID',
|
|
1836
|
-
value: 'id',
|
|
1837
|
-
},
|
|
1838
|
-
{
|
|
1839
|
-
name: 'Media Count',
|
|
1840
|
-
value: 'media_count',
|
|
1841
|
-
},
|
|
1842
|
-
{
|
|
1843
|
-
name: 'Name',
|
|
1844
|
-
value: 'name',
|
|
1845
|
-
},
|
|
1846
|
-
{
|
|
1847
|
-
name: 'Profile Picture URL',
|
|
1848
|
-
value: 'profile_picture_url',
|
|
1849
|
-
},
|
|
1850
|
-
{
|
|
1851
|
-
name: 'User ID',
|
|
1852
|
-
value: 'user_id',
|
|
1853
|
-
},
|
|
1854
|
-
{
|
|
1855
|
-
name: 'Username',
|
|
1856
|
-
value: 'username',
|
|
1857
|
-
},
|
|
1858
|
-
],
|
|
1859
|
-
default: ['id', 'username', 'name', 'account_type'],
|
|
1860
|
-
description: 'Fields to retrieve from authenticated user profile',
|
|
1861
|
-
},
|
|
1862
|
-
],
|
|
1863
|
-
};
|
|
1864
|
-
}
|
|
1865
|
-
async execute() {
|
|
1866
|
-
var _a, _b, _c;
|
|
1867
|
-
const items = this.getInputData();
|
|
1868
|
-
const returnData = [];
|
|
1869
|
-
const resource = this.getNodeParameter('resource', 0);
|
|
1870
|
-
const operation = this.getNodeParameter('operation', 0);
|
|
1871
|
-
let instagramAccountId;
|
|
1872
|
-
const getAccountId = async () => {
|
|
1873
|
-
if (!instagramAccountId) {
|
|
1874
|
-
instagramAccountId = await GenericFunctions_1.getInstagramAccountId.call(this);
|
|
1875
|
-
}
|
|
1876
|
-
return instagramAccountId;
|
|
1877
|
-
};
|
|
1878
|
-
let messagesEndpoint;
|
|
1879
|
-
const getMessagesPath = async () => {
|
|
1880
|
-
if (!messagesEndpoint) {
|
|
1881
|
-
messagesEndpoint = await GenericFunctions_1.getMessagesEndpoint.call(this);
|
|
1882
|
-
}
|
|
1883
|
-
return messagesEndpoint;
|
|
1884
|
-
};
|
|
1885
|
-
for (let i = 0; i < items.length; i++) {
|
|
1886
|
-
try {
|
|
1887
|
-
if (resource === 'message') {
|
|
1888
|
-
if (operation === 'sendText') {
|
|
1889
|
-
const recipientId = this.getNodeParameter('recipientId', i);
|
|
1890
|
-
const messageText = this.getNodeParameter('messageText', i);
|
|
1891
|
-
const body = {
|
|
1892
|
-
recipient: { id: recipientId },
|
|
1893
|
-
message: { text: messageText },
|
|
1894
|
-
};
|
|
1895
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', await getMessagesPath(), body);
|
|
1896
|
-
returnData.push({ json: responseData, pairedItem: { item: i } });
|
|
1897
|
-
}
|
|
1898
|
-
else if (operation === 'sendImage') {
|
|
1899
|
-
const recipientId = this.getNodeParameter('recipientId', i);
|
|
1900
|
-
const imageUrl = this.getNodeParameter('imageUrl', i);
|
|
1901
|
-
const isReusable = this.getNodeParameter('isReusable', i);
|
|
1902
|
-
const body = {
|
|
1903
|
-
recipient: { id: recipientId },
|
|
1904
|
-
message: {
|
|
1905
|
-
attachment: {
|
|
1906
|
-
type: 'image',
|
|
1907
|
-
payload: {
|
|
1908
|
-
url: imageUrl,
|
|
1909
|
-
is_reusable: isReusable,
|
|
1910
|
-
},
|
|
1911
|
-
},
|
|
1912
|
-
},
|
|
1913
|
-
};
|
|
1914
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', await getMessagesPath(), body);
|
|
1915
|
-
returnData.push({ json: responseData, pairedItem: { item: i } });
|
|
1916
|
-
}
|
|
1917
|
-
else if (operation === 'sendAudio') {
|
|
1918
|
-
const recipientId = this.getNodeParameter('recipientId', i);
|
|
1919
|
-
const audioUrl = this.getNodeParameter('audioUrl', i);
|
|
1920
|
-
const isReusable = this.getNodeParameter('isReusable', i);
|
|
1921
|
-
const body = {
|
|
1922
|
-
recipient: { id: recipientId },
|
|
1923
|
-
message: {
|
|
1924
|
-
attachment: {
|
|
1925
|
-
type: 'audio',
|
|
1926
|
-
payload: {
|
|
1927
|
-
url: audioUrl,
|
|
1928
|
-
is_reusable: isReusable,
|
|
1929
|
-
},
|
|
1930
|
-
},
|
|
1931
|
-
},
|
|
1932
|
-
};
|
|
1933
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', await getMessagesPath(), body);
|
|
1934
|
-
returnData.push({ json: responseData, pairedItem: { item: i } });
|
|
1935
|
-
}
|
|
1936
|
-
else if (operation === 'sendVideo') {
|
|
1937
|
-
const recipientId = this.getNodeParameter('recipientId', i);
|
|
1938
|
-
const videoUrl = this.getNodeParameter('videoUrl', i);
|
|
1939
|
-
const isReusable = this.getNodeParameter('isReusable', i);
|
|
1940
|
-
const body = {
|
|
1941
|
-
recipient: { id: recipientId },
|
|
1942
|
-
message: {
|
|
1943
|
-
attachment: {
|
|
1944
|
-
type: 'video',
|
|
1945
|
-
payload: {
|
|
1946
|
-
url: videoUrl,
|
|
1947
|
-
is_reusable: isReusable,
|
|
1948
|
-
},
|
|
1949
|
-
},
|
|
1950
|
-
},
|
|
1951
|
-
};
|
|
1952
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', await getMessagesPath(), body);
|
|
1953
|
-
returnData.push({ json: responseData, pairedItem: { item: i } });
|
|
1954
|
-
}
|
|
1955
|
-
else if (operation === 'sendButtonTemplate') {
|
|
1956
|
-
const recipientId = this.getNodeParameter('recipientId', i);
|
|
1957
|
-
const messageText = this.getNodeParameter('messageText', i);
|
|
1958
|
-
const buttonsData = this.getNodeParameter('buttons', i);
|
|
1959
|
-
const buttons = [];
|
|
1960
|
-
if (buttonsData.button) {
|
|
1961
|
-
for (const button of buttonsData.button) {
|
|
1962
|
-
const buttonObj = {
|
|
1963
|
-
type: button.type,
|
|
1964
|
-
title: button.title,
|
|
1965
|
-
};
|
|
1966
|
-
if (button.type === 'web_url') {
|
|
1967
|
-
buttonObj.url = button.url;
|
|
1968
|
-
}
|
|
1969
|
-
else {
|
|
1970
|
-
buttonObj.payload = button.payload;
|
|
1971
|
-
}
|
|
1972
|
-
buttons.push(buttonObj);
|
|
1973
|
-
}
|
|
1974
|
-
}
|
|
1975
|
-
const body = {
|
|
1976
|
-
recipient: { id: recipientId },
|
|
1977
|
-
message: {
|
|
1978
|
-
attachment: {
|
|
1979
|
-
type: 'template',
|
|
1980
|
-
payload: {
|
|
1981
|
-
template_type: 'button',
|
|
1982
|
-
text: messageText,
|
|
1983
|
-
buttons,
|
|
1984
|
-
},
|
|
1985
|
-
},
|
|
1986
|
-
},
|
|
1987
|
-
};
|
|
1988
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', await getMessagesPath(), body);
|
|
1989
|
-
returnData.push({ json: responseData, pairedItem: { item: i } });
|
|
1990
|
-
}
|
|
1991
|
-
else if (operation === 'sendGenericTemplate') {
|
|
1992
|
-
const recipientId = this.getNodeParameter('recipientId', i);
|
|
1993
|
-
const elementsData = this.getNodeParameter('elements', i);
|
|
1994
|
-
const elements = [];
|
|
1995
|
-
if (elementsData.element && Array.isArray(elementsData.element)) {
|
|
1996
|
-
for (const elem of elementsData.element) {
|
|
1997
|
-
const element = {
|
|
1998
|
-
title: elem.title,
|
|
1999
|
-
};
|
|
2000
|
-
if (elem.subtitle)
|
|
2001
|
-
element.subtitle = elem.subtitle;
|
|
2002
|
-
if (elem.image_url)
|
|
2003
|
-
element.image_url = elem.image_url;
|
|
2004
|
-
if ((_b = (_a = elem.default_action) === null || _a === void 0 ? void 0 : _a.action) === null || _b === void 0 ? void 0 : _b.url) {
|
|
2005
|
-
element.default_action = {
|
|
2006
|
-
type: 'web_url',
|
|
2007
|
-
url: elem.default_action.action.url,
|
|
2008
|
-
};
|
|
2009
|
-
}
|
|
2010
|
-
if (((_c = elem.buttons) === null || _c === void 0 ? void 0 : _c.button) && Array.isArray(elem.buttons.button)) {
|
|
2011
|
-
element.buttons = [];
|
|
2012
|
-
for (const button of elem.buttons.button) {
|
|
2013
|
-
const buttonObj = {
|
|
2014
|
-
type: button.type,
|
|
2015
|
-
title: button.title,
|
|
2016
|
-
};
|
|
2017
|
-
if (button.type === 'web_url') {
|
|
2018
|
-
buttonObj.url = button.url;
|
|
2019
|
-
}
|
|
2020
|
-
else {
|
|
2021
|
-
buttonObj.payload = button.payload;
|
|
2022
|
-
}
|
|
2023
|
-
element.buttons.push(buttonObj);
|
|
2024
|
-
}
|
|
2025
|
-
}
|
|
2026
|
-
elements.push(element);
|
|
2027
|
-
}
|
|
2028
|
-
}
|
|
2029
|
-
const body = {
|
|
2030
|
-
recipient: { id: recipientId },
|
|
2031
|
-
message: {
|
|
2032
|
-
attachment: {
|
|
2033
|
-
type: 'template',
|
|
2034
|
-
payload: {
|
|
2035
|
-
template_type: 'generic',
|
|
2036
|
-
elements,
|
|
2037
|
-
},
|
|
2038
|
-
},
|
|
2039
|
-
},
|
|
2040
|
-
};
|
|
2041
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', await getMessagesPath(), body);
|
|
2042
|
-
returnData.push({ json: responseData, pairedItem: { item: i } });
|
|
2043
|
-
}
|
|
2044
|
-
else if (operation === 'sendQuickReplies') {
|
|
2045
|
-
const recipientId = this.getNodeParameter('recipientId', i);
|
|
2046
|
-
const messageText = this.getNodeParameter('messageText', i);
|
|
2047
|
-
const quickRepliesData = this.getNodeParameter('quickReplies', i);
|
|
2048
|
-
const quickReplies = [];
|
|
2049
|
-
if (quickRepliesData.quickReply && Array.isArray(quickRepliesData.quickReply)) {
|
|
2050
|
-
for (const qr of quickRepliesData.quickReply) {
|
|
2051
|
-
const quickReply = {
|
|
2052
|
-
content_type: 'text',
|
|
2053
|
-
title: qr.title,
|
|
2054
|
-
payload: qr.payload,
|
|
2055
|
-
};
|
|
2056
|
-
quickReplies.push(quickReply);
|
|
2057
|
-
}
|
|
2058
|
-
}
|
|
2059
|
-
const body = {
|
|
2060
|
-
recipient: { id: recipientId },
|
|
2061
|
-
message: {
|
|
2062
|
-
text: messageText,
|
|
2063
|
-
quick_replies: quickReplies,
|
|
2064
|
-
},
|
|
2065
|
-
};
|
|
2066
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', await getMessagesPath(), body);
|
|
2067
|
-
returnData.push({ json: responseData, pairedItem: { item: i } });
|
|
2068
|
-
}
|
|
2069
|
-
else if (operation === 'uploadMedia') {
|
|
2070
|
-
const igUserId = await getAccountId();
|
|
2071
|
-
const mediaType = this.getNodeParameter('mediaType', i);
|
|
2072
|
-
const mediaUrl = this.getNodeParameter('mediaUrl', i);
|
|
2073
|
-
const caption = this.getNodeParameter('caption', i, '');
|
|
2074
|
-
const body = {
|
|
2075
|
-
image_url: mediaUrl,
|
|
2076
|
-
caption,
|
|
2077
|
-
};
|
|
2078
|
-
if (mediaType === 'VIDEO' || mediaType === 'REELS') {
|
|
2079
|
-
body.video_url = mediaUrl;
|
|
2080
|
-
delete body.image_url;
|
|
2081
|
-
body.media_type = mediaType;
|
|
2082
|
-
}
|
|
2083
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', `/${igUserId}/media`, body);
|
|
2084
|
-
returnData.push({ json: responseData, pairedItem: { item: i } });
|
|
2085
|
-
}
|
|
2086
|
-
}
|
|
2087
|
-
else if (resource === 'media') {
|
|
2088
|
-
const igUserId = await getAccountId();
|
|
2089
|
-
if (operation === 'listMedia') {
|
|
2090
|
-
const returnAll = this.getNodeParameter('returnAll', i);
|
|
2091
|
-
const fields = this.getNodeParameter('mediaFields', i);
|
|
2092
|
-
const qs = {
|
|
2093
|
-
fields: fields.join(','),
|
|
2094
|
-
};
|
|
2095
|
-
if (returnAll) {
|
|
2096
|
-
const { instagramApiRequestAllItems } = await Promise.resolve().then(() => __importStar(require('./GenericFunctions')));
|
|
2097
|
-
const responseData = await instagramApiRequestAllItems.call(this, 'GET', `/${igUserId}/media`, {}, qs);
|
|
2098
|
-
responseData.forEach((item) => {
|
|
2099
|
-
returnData.push({ json: item, pairedItem: { item: i } });
|
|
2100
|
-
});
|
|
2101
|
-
}
|
|
2102
|
-
else {
|
|
2103
|
-
const limit = this.getNodeParameter('limit', i);
|
|
2104
|
-
qs.limit = limit;
|
|
2105
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'GET', `/${igUserId}/media`, {}, qs);
|
|
2106
|
-
if (responseData.data) {
|
|
2107
|
-
responseData.data.forEach((item) => {
|
|
2108
|
-
returnData.push({ json: item, pairedItem: { item: i } });
|
|
2109
|
-
});
|
|
2110
|
-
}
|
|
2111
|
-
}
|
|
2112
|
-
}
|
|
2113
|
-
else if (operation === 'getMedia') {
|
|
2114
|
-
const mediaId = this.getNodeParameter('mediaId', i);
|
|
2115
|
-
const fields = this.getNodeParameter('mediaDetailFields', i);
|
|
2116
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'GET', `/${mediaId}`, {}, { fields: fields.join(',') });
|
|
2117
|
-
returnData.push({ json: responseData, pairedItem: { item: i } });
|
|
2118
|
-
}
|
|
2119
|
-
else if (operation === 'getMediaChildren') {
|
|
2120
|
-
const mediaId = this.getNodeParameter('mediaId', i);
|
|
2121
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'GET', `/${mediaId}/children`, {}, { fields: 'id,media_type,media_url,permalink,timestamp' });
|
|
2122
|
-
if (responseData.data) {
|
|
2123
|
-
responseData.data.forEach((item) => {
|
|
2124
|
-
returnData.push({ json: item, pairedItem: { item: i } });
|
|
2125
|
-
});
|
|
2126
|
-
}
|
|
2127
|
-
}
|
|
2128
|
-
}
|
|
2129
|
-
else if (resource === 'post') {
|
|
2130
|
-
const igUserId = await getAccountId();
|
|
2131
|
-
if (operation === 'createSinglePost') {
|
|
2132
|
-
const mediaType = this.getNodeParameter('postMediaType', i);
|
|
2133
|
-
const caption = this.getNodeParameter('postCaption', i, '');
|
|
2134
|
-
const additionalOptions = this.getNodeParameter('postAdditionalOptions', i, {});
|
|
2135
|
-
const body = {
|
|
2136
|
-
caption,
|
|
2137
|
-
media_type: mediaType,
|
|
2138
|
-
};
|
|
2139
|
-
if (mediaType === 'IMAGE') {
|
|
2140
|
-
body.image_url = this.getNodeParameter('postImageUrl', i);
|
|
2141
|
-
}
|
|
2142
|
-
else {
|
|
2143
|
-
body.video_url = this.getNodeParameter('postVideoUrl', i);
|
|
2144
|
-
}
|
|
2145
|
-
if (additionalOptions.location_id) {
|
|
2146
|
-
body.location_id = additionalOptions.location_id;
|
|
2147
|
-
}
|
|
2148
|
-
if (additionalOptions.user_tags) {
|
|
2149
|
-
const userTags = additionalOptions.user_tags.tag || [];
|
|
2150
|
-
if (userTags.length > 0) {
|
|
2151
|
-
body.user_tags = JSON.stringify(userTags);
|
|
2152
|
-
}
|
|
2153
|
-
}
|
|
2154
|
-
if (additionalOptions.product_tags) {
|
|
2155
|
-
const productTags = additionalOptions.product_tags.tag || [];
|
|
2156
|
-
if (productTags.length > 0) {
|
|
2157
|
-
body.product_tags = JSON.stringify(productTags);
|
|
2158
|
-
}
|
|
2159
|
-
}
|
|
2160
|
-
if (additionalOptions.collaborators) {
|
|
2161
|
-
body.collaborators = additionalOptions.collaborators;
|
|
2162
|
-
}
|
|
2163
|
-
if (additionalOptions.thumb_offset !== undefined) {
|
|
2164
|
-
body.thumb_offset = additionalOptions.thumb_offset;
|
|
2165
|
-
}
|
|
2166
|
-
if (additionalOptions.share_to_feed !== undefined) {
|
|
2167
|
-
body.share_to_feed = additionalOptions.share_to_feed;
|
|
2168
|
-
}
|
|
2169
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', `/${igUserId}/media`, body);
|
|
2170
|
-
returnData.push({ json: responseData, pairedItem: { item: i } });
|
|
2171
|
-
}
|
|
2172
|
-
else if (operation === 'createCarouselPost') {
|
|
2173
|
-
const childrenData = this.getNodeParameter('carouselChildren', i);
|
|
2174
|
-
const caption = this.getNodeParameter('carouselCaption', i, '');
|
|
2175
|
-
const additionalOptions = this.getNodeParameter('carouselAdditionalOptions', i, {});
|
|
2176
|
-
const childIds = [];
|
|
2177
|
-
if (childrenData.child && Array.isArray(childrenData.child)) {
|
|
2178
|
-
for (const child of childrenData.child) {
|
|
2179
|
-
const childBody = {
|
|
2180
|
-
is_carousel_item: true,
|
|
2181
|
-
};
|
|
2182
|
-
if (child.media_type === 'IMAGE') {
|
|
2183
|
-
childBody.image_url = child.image_url;
|
|
2184
|
-
childBody.media_type = 'IMAGE';
|
|
2185
|
-
}
|
|
2186
|
-
else {
|
|
2187
|
-
childBody.video_url = child.video_url;
|
|
2188
|
-
childBody.media_type = 'VIDEO';
|
|
2189
|
-
}
|
|
2190
|
-
if (child.user_tags) {
|
|
2191
|
-
childBody.user_tags = child.user_tags;
|
|
2192
|
-
}
|
|
2193
|
-
const childResponse = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', `/${igUserId}/media`, childBody);
|
|
2194
|
-
if (childResponse.id) {
|
|
2195
|
-
childIds.push(childResponse.id);
|
|
2196
|
-
}
|
|
2197
|
-
}
|
|
2198
|
-
}
|
|
2199
|
-
const carouselBody = {
|
|
2200
|
-
media_type: 'CAROUSEL',
|
|
2201
|
-
children: childIds.join(','),
|
|
2202
|
-
caption,
|
|
2203
|
-
};
|
|
2204
|
-
if (additionalOptions.location_id) {
|
|
2205
|
-
carouselBody.location_id = additionalOptions.location_id;
|
|
2206
|
-
}
|
|
2207
|
-
if (additionalOptions.collaborators) {
|
|
2208
|
-
carouselBody.collaborators = additionalOptions.collaborators;
|
|
2209
|
-
}
|
|
2210
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', `/${igUserId}/media`, carouselBody);
|
|
2211
|
-
returnData.push({ json: responseData, pairedItem: { item: i } });
|
|
2212
|
-
}
|
|
2213
|
-
else if (operation === 'createReel') {
|
|
2214
|
-
const videoUrl = this.getNodeParameter('reelVideoUrl', i);
|
|
2215
|
-
const caption = this.getNodeParameter('reelCaption', i, '');
|
|
2216
|
-
const additionalOptions = this.getNodeParameter('reelAdditionalOptions', i, {});
|
|
2217
|
-
const body = {
|
|
2218
|
-
media_type: 'REELS',
|
|
2219
|
-
video_url: videoUrl,
|
|
2220
|
-
caption,
|
|
2221
|
-
};
|
|
2222
|
-
if (additionalOptions.cover_url) {
|
|
2223
|
-
body.cover_url = additionalOptions.cover_url;
|
|
2224
|
-
}
|
|
2225
|
-
if (additionalOptions.audio_name) {
|
|
2226
|
-
body.audio_name = additionalOptions.audio_name;
|
|
2227
|
-
}
|
|
2228
|
-
if (additionalOptions.location_id) {
|
|
2229
|
-
body.location_id = additionalOptions.location_id;
|
|
2230
|
-
}
|
|
2231
|
-
if (additionalOptions.collaborators) {
|
|
2232
|
-
body.collaborators = additionalOptions.collaborators;
|
|
2233
|
-
}
|
|
2234
|
-
if (additionalOptions.share_to_feed !== undefined) {
|
|
2235
|
-
body.share_to_feed = additionalOptions.share_to_feed;
|
|
2236
|
-
}
|
|
2237
|
-
if (additionalOptions.thumb_offset !== undefined) {
|
|
2238
|
-
body.thumb_offset = additionalOptions.thumb_offset;
|
|
2239
|
-
}
|
|
2240
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', `/${igUserId}/media`, body);
|
|
2241
|
-
returnData.push({ json: responseData, pairedItem: { item: i } });
|
|
2242
|
-
}
|
|
2243
|
-
else if (operation === 'publishPost') {
|
|
2244
|
-
const creationId = this.getNodeParameter('creationId', i);
|
|
2245
|
-
const body = {
|
|
2246
|
-
creation_id: creationId,
|
|
2247
|
-
};
|
|
2248
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', `/${igUserId}/media_publish`, body);
|
|
2249
|
-
returnData.push({ json: responseData, pairedItem: { item: i } });
|
|
2250
|
-
}
|
|
2251
|
-
}
|
|
2252
|
-
else if (resource === 'story') {
|
|
2253
|
-
const igUserId = await getAccountId();
|
|
2254
|
-
if (operation === 'createStory') {
|
|
2255
|
-
const mediaType = this.getNodeParameter('storyMediaType', i);
|
|
2256
|
-
const additionalOptions = this.getNodeParameter('storyAdditionalOptions', i, {});
|
|
2257
|
-
const body = {
|
|
2258
|
-
media_type: 'STORIES',
|
|
2259
|
-
};
|
|
2260
|
-
if (mediaType === 'IMAGE') {
|
|
2261
|
-
body.image_url = this.getNodeParameter('storyImageUrl', i);
|
|
2262
|
-
}
|
|
2263
|
-
else {
|
|
2264
|
-
body.video_url = this.getNodeParameter('storyVideoUrl', i);
|
|
2265
|
-
}
|
|
2266
|
-
if (additionalOptions.location_id) {
|
|
2267
|
-
body.location_id = additionalOptions.location_id;
|
|
2268
|
-
}
|
|
2269
|
-
if (additionalOptions.collaborators) {
|
|
2270
|
-
body.collaborators = additionalOptions.collaborators;
|
|
2271
|
-
}
|
|
2272
|
-
const createResponse = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', `/${igUserId}/media`, body);
|
|
2273
|
-
if (createResponse.id) {
|
|
2274
|
-
const containerId = createResponse.id;
|
|
2275
|
-
let status = 'IN_PROGRESS';
|
|
2276
|
-
let attempts = 0;
|
|
2277
|
-
const maxAttempts = 30;
|
|
2278
|
-
while (status === 'IN_PROGRESS' && attempts < maxAttempts) {
|
|
2279
|
-
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
2280
|
-
const statusResponse = await GenericFunctions_1.instagramApiRequest.call(this, 'GET', `/${containerId}`, {}, { fields: 'status_code' });
|
|
2281
|
-
status = statusResponse.status_code || 'IN_PROGRESS';
|
|
2282
|
-
attempts++;
|
|
2283
|
-
if (status === 'FINISHED') {
|
|
2284
|
-
break;
|
|
2285
|
-
}
|
|
2286
|
-
if (status === 'ERROR' || status === 'EXPIRED') {
|
|
2287
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Story creation failed with status: ${status}. Please check your media file and try again.`);
|
|
2288
|
-
}
|
|
2289
|
-
}
|
|
2290
|
-
if (status === 'IN_PROGRESS') {
|
|
2291
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Story creation timed out. The media is taking too long to process. Please try with a smaller file or try again later.');
|
|
2292
|
-
}
|
|
2293
|
-
const publishResponse = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', `/${igUserId}/media_publish`, { creation_id: containerId });
|
|
2294
|
-
returnData.push({
|
|
2295
|
-
json: {
|
|
2296
|
-
...publishResponse,
|
|
2297
|
-
status: 'published',
|
|
2298
|
-
container_id: containerId,
|
|
2299
|
-
attempts_taken: attempts,
|
|
2300
|
-
},
|
|
2301
|
-
pairedItem: { item: i },
|
|
2302
|
-
});
|
|
2303
|
-
}
|
|
2304
|
-
else {
|
|
2305
|
-
returnData.push({ json: createResponse, pairedItem: { item: i } });
|
|
2306
|
-
}
|
|
2307
|
-
}
|
|
2308
|
-
}
|
|
2309
|
-
else if (resource === 'comment') {
|
|
2310
|
-
if (operation === 'getComments') {
|
|
2311
|
-
const mediaId = this.getNodeParameter('commentMediaId', i);
|
|
2312
|
-
const returnAll = this.getNodeParameter('returnAll', i);
|
|
2313
|
-
const qs = {
|
|
2314
|
-
fields: 'id,text,timestamp,username,like_count,replies{id,text,timestamp,username}',
|
|
2315
|
-
};
|
|
2316
|
-
if (returnAll) {
|
|
2317
|
-
const { instagramApiRequestAllItems } = await Promise.resolve().then(() => __importStar(require('./GenericFunctions')));
|
|
2318
|
-
const responseData = await instagramApiRequestAllItems.call(this, 'GET', `/${mediaId}/comments`, {}, qs);
|
|
2319
|
-
responseData.forEach((item) => {
|
|
2320
|
-
returnData.push({ json: item, pairedItem: { item: i } });
|
|
2321
|
-
});
|
|
2322
|
-
}
|
|
2323
|
-
else {
|
|
2324
|
-
const limit = this.getNodeParameter('limit', i);
|
|
2325
|
-
qs.limit = limit;
|
|
2326
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'GET', `/${mediaId}/comments`, {}, qs);
|
|
2327
|
-
if (responseData.data) {
|
|
2328
|
-
responseData.data.forEach((item) => {
|
|
2329
|
-
returnData.push({ json: item, pairedItem: { item: i } });
|
|
2330
|
-
});
|
|
2331
|
-
}
|
|
2332
|
-
else {
|
|
2333
|
-
returnData.push({ json: responseData, pairedItem: { item: i } });
|
|
2334
|
-
}
|
|
2335
|
-
}
|
|
2336
|
-
}
|
|
2337
|
-
else if (operation === 'getReplies') {
|
|
2338
|
-
const commentId = this.getNodeParameter('commentId', i);
|
|
2339
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'GET', `/${commentId}/replies`, {}, { fields: 'id,text,timestamp,username,like_count' });
|
|
2340
|
-
if (responseData.data) {
|
|
2341
|
-
responseData.data.forEach((item) => {
|
|
2342
|
-
returnData.push({ json: item, pairedItem: { item: i } });
|
|
2343
|
-
});
|
|
2344
|
-
}
|
|
2345
|
-
else {
|
|
2346
|
-
returnData.push({ json: responseData, pairedItem: { item: i } });
|
|
2347
|
-
}
|
|
2348
|
-
}
|
|
2349
|
-
else if (operation === 'replyToComment') {
|
|
2350
|
-
const commentId = this.getNodeParameter('commentId', i);
|
|
2351
|
-
const replyMessage = this.getNodeParameter('replyMessage', i);
|
|
2352
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', `/${commentId}/replies`, { message: replyMessage });
|
|
2353
|
-
returnData.push({ json: responseData, pairedItem: { item: i } });
|
|
2354
|
-
}
|
|
2355
|
-
else if (operation === 'sendPrivateReply') {
|
|
2356
|
-
const commentId = this.getNodeParameter('commentId', i);
|
|
2357
|
-
const privateMessage = this.getNodeParameter('privateMessage', i);
|
|
2358
|
-
const body = {
|
|
2359
|
-
recipient: {
|
|
2360
|
-
comment_id: commentId,
|
|
2361
|
-
},
|
|
2362
|
-
message: {
|
|
2363
|
-
text: privateMessage,
|
|
2364
|
-
},
|
|
2365
|
-
};
|
|
2366
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', await getMessagesPath(), body);
|
|
2367
|
-
returnData.push({ json: responseData, pairedItem: { item: i } });
|
|
2368
|
-
}
|
|
2369
|
-
else if (operation === 'deleteComment') {
|
|
2370
|
-
const commentId = this.getNodeParameter('commentId', i);
|
|
2371
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'DELETE', `/${commentId}`);
|
|
2372
|
-
returnData.push({
|
|
2373
|
-
json: {
|
|
2374
|
-
success: true,
|
|
2375
|
-
deleted_comment_id: commentId,
|
|
2376
|
-
...responseData,
|
|
2377
|
-
},
|
|
2378
|
-
pairedItem: { item: i },
|
|
2379
|
-
});
|
|
2380
|
-
}
|
|
2381
|
-
else if (operation === 'toggleVisibility') {
|
|
2382
|
-
const commentId = this.getNodeParameter('commentId', i);
|
|
2383
|
-
const hideAction = this.getNodeParameter('hideAction', i);
|
|
2384
|
-
const body = {
|
|
2385
|
-
hide: hideAction === 'hide',
|
|
2386
|
-
};
|
|
2387
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', `/${commentId}`, body);
|
|
2388
|
-
returnData.push({
|
|
2389
|
-
json: {
|
|
2390
|
-
success: true,
|
|
2391
|
-
comment_id: commentId,
|
|
2392
|
-
action: hideAction,
|
|
2393
|
-
hidden: hideAction === 'hide',
|
|
2394
|
-
...responseData,
|
|
2395
|
-
},
|
|
2396
|
-
pairedItem: { item: i },
|
|
2397
|
-
});
|
|
2398
|
-
}
|
|
2399
|
-
}
|
|
2400
|
-
else if (resource === 'user') {
|
|
2401
|
-
if (operation === 'getMyProfile') {
|
|
2402
|
-
const fields = this.getNodeParameter('myProfileFields', i);
|
|
2403
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'GET', await GenericFunctions_1.getMyProfileEndpoint.call(this), {}, { fields: fields.join(',') });
|
|
2404
|
-
returnData.push({ json: responseData, pairedItem: { item: i } });
|
|
2405
|
-
}
|
|
2406
|
-
else if (operation === 'getProfile') {
|
|
2407
|
-
const userId = this.getNodeParameter('userId', i);
|
|
2408
|
-
const fields = this.getNodeParameter('fields', i);
|
|
2409
|
-
const responseData = await GenericFunctions_1.instagramApiRequest.call(this, 'GET', `/${userId}`, {}, {
|
|
2410
|
-
fields: fields.join(','),
|
|
2411
|
-
});
|
|
2412
|
-
returnData.push({ json: responseData, pairedItem: { item: i } });
|
|
2413
|
-
}
|
|
2414
|
-
}
|
|
2415
|
-
}
|
|
2416
|
-
catch (error) {
|
|
2417
|
-
if (this.continueOnFail()) {
|
|
2418
|
-
returnData.push({
|
|
2419
|
-
json: { error: error.message },
|
|
2420
|
-
pairedItem: { item: i },
|
|
2421
175
|
});
|
|
2422
176
|
continue;
|
|
2423
177
|
}
|
|
2424
|
-
throw error
|
|
178
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, {
|
|
179
|
+
itemIndex: i,
|
|
180
|
+
});
|
|
2425
181
|
}
|
|
2426
182
|
}
|
|
2427
183
|
return [returnData];
|