Skip to content

Commit 6201fa0

Browse files
committed
Implement CodeQR API integration with actions for link and QR code management
1 parent 101957f commit 6201fa0

File tree

10 files changed

+688
-4
lines changed

10 files changed

+688
-4
lines changed

components/codeqr/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Overview
2+
3+
The CodeQR API enables you to create and manage dynamic QR Codes, shorten URLs, capture leads, and track engagement through powerful analytics. By integrating CodeQR with Pipedream, you can automate the generation of QR Codes and short links across a wide range of workflows — from marketing automation to customer support — and seamlessly connect these actions to over 2,500 apps. fileciteturn3file0
4+
5+
# Example Use Cases
6+
7+
- **Dynamic QR Code Generation for Marketing Campaigns**
8+
Automatically generate campaign-specific QR Codes when a new campaign is launched in your CRM or marketing tool. Store the QR code image in your cloud drive (e.g., Google Drive or Dropbox), and attach it to your newsletters or printed materials.
9+
10+
- **URL Shortening with Pre-Redirect Lead Capture**
11+
When a new record is added to Airtable or a Google Sheet with a destination URL, create a short link using CodeQR that optionally includes a lead capture page before redirection. Use this to qualify traffic before they reach your landing page.
12+
13+
- **Automated Feedback Collection**
14+
Trigger the creation of a QR code linked to a feedback form after each customer interaction in platforms like Zendesk, Intercom, or HubSpot. Easily track which customers scanned the code and filled the form, and centralize the responses.
15+
16+
- **Analytics Monitoring and Reporting**
17+
Use Pipedream workflows to pull scan and click analytics from CodeQR at regular intervals. Send the data to Slack, update a Google Sheet, or visualize trends on a custom dashboard.
Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
import codeqr from "../../codeqr.app.mjs";
2+
3+
export default {
4+
key: "codeqr-create-link",
5+
name: "Create a CodeQR Link",
6+
description:
7+
"Creates a short link in CodeQR using the CodeQR API. [See the docs here](https://codeqr.mintlify.app/api-reference/endpoint/create-a-link)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
codeqr,
12+
url: {
13+
type: "string",
14+
label: "URL",
15+
description: "The destination URL of the short link.",
16+
},
17+
key: {
18+
type: "string",
19+
label: "Key",
20+
description:
21+
"The short link slug. If not provided, a random 7-character slug will be generated.",
22+
optional: true,
23+
},
24+
domain: {
25+
type: "string",
26+
label: "Domain",
27+
description:
28+
"The domain of the short link. If not provided, the default workspace domain will be used.",
29+
optional: true,
30+
},
31+
externalId: {
32+
type: "string",
33+
label: "External ID",
34+
description:
35+
"This is the ID of the link in your database. Must be prefixed with ext_.",
36+
optional: true,
37+
},
38+
password: {
39+
type: "string",
40+
label: "Password",
41+
description: "The password required to access the destination URL.",
42+
optional: true,
43+
},
44+
flexible: {
45+
type: "boolean",
46+
label: "Flexible Link",
47+
description:
48+
"Whether this is a flexible link with dynamic destination setting.",
49+
optional: true,
50+
},
51+
title: {
52+
type: "string",
53+
label: "Title",
54+
description: "The title displayed on the short link page.",
55+
optional: true,
56+
},
57+
description: {
58+
type: "string",
59+
label: "Description",
60+
description: "A description displayed on the short link page.",
61+
optional: true,
62+
},
63+
image: {
64+
type: "string",
65+
label: "Image URL",
66+
description: "URL of the image displayed on the short link page.",
67+
optional: true,
68+
},
69+
video: {
70+
type: "string",
71+
label: "Video URL",
72+
description: "URL of the video displayed on the short link page.",
73+
optional: true,
74+
},
75+
proxy: {
76+
type: "boolean",
77+
label: "Proxy",
78+
description: "Enable proxy settings.",
79+
optional: true,
80+
},
81+
preRedirection: {
82+
type: "boolean",
83+
label: "Pre-Redirection Page",
84+
description:
85+
"Enable a pre-redirection page before sending users to the destination URL.",
86+
optional: true,
87+
},
88+
pageId: {
89+
type: "string",
90+
label: "Page ID",
91+
description: "ID of your page created in CodeQR.",
92+
optional: true,
93+
},
94+
pageUrl: {
95+
type: "string",
96+
label: "Page URL",
97+
description: "The URL for the pre-redirect page.",
98+
optional: true,
99+
},
100+
rewrite: {
101+
type: "boolean",
102+
label: "Rewrite Link",
103+
description: "Enable link rewriting.",
104+
optional: true,
105+
},
106+
ios: {
107+
type: "string",
108+
label: "iOS URL",
109+
description: "The iOS destination URL for device-specific redirection.",
110+
optional: true,
111+
},
112+
android: {
113+
type: "string",
114+
label: "Android URL",
115+
description:
116+
"The Android destination URL for device-specific redirection.",
117+
optional: true,
118+
},
119+
doIndex: {
120+
type: "boolean",
121+
label: "Allow Indexing",
122+
description: "Enable indexing of the short link.",
123+
optional: true,
124+
},
125+
comments: {
126+
type: "string",
127+
label: "Comments",
128+
description: "Comments or notes about the short link.",
129+
optional: true,
130+
},
131+
expiresAt: {
132+
type: "string",
133+
label: "Expiration Date",
134+
description:
135+
"The date and time when the short link will expire (ISO 8601).",
136+
optional: true,
137+
},
138+
expiredUrl: {
139+
type: "string",
140+
label: "Expired Redirect URL",
141+
description: "The URL to redirect to when the short link has expired.",
142+
optional: true,
143+
},
144+
geo: {
145+
type: "object",
146+
label: "Geo-Targeting",
147+
description:
148+
"Mapping of country codes to destination URLs (JSON format).",
149+
optional: true,
150+
},
151+
publicStats: {
152+
type: "boolean",
153+
label: "Public Stats",
154+
description: "Whether the short link's stats are publicly accessible.",
155+
optional: true,
156+
},
157+
tagIds: {
158+
type: "string[]",
159+
label: "Tag IDs",
160+
description: "Array of tag IDs to apply to the short link.",
161+
optional: true,
162+
},
163+
tagNames: {
164+
type: "string[]",
165+
label: "Tag Names",
166+
description: "Array of tag names to apply to the short link.",
167+
optional: true,
168+
},
169+
},
170+
171+
async run({ $ }) {
172+
const {
173+
url,
174+
key,
175+
domain,
176+
externalId,
177+
password,
178+
flexible,
179+
title,
180+
description,
181+
image,
182+
video,
183+
proxy,
184+
preRedirection,
185+
pageId,
186+
pageUrl,
187+
rewrite,
188+
ios,
189+
android,
190+
doIndex,
191+
comments,
192+
expiresAt,
193+
expiredUrl,
194+
geo,
195+
publicStats,
196+
tagIds,
197+
tagNames,
198+
} = this;
199+
200+
const payload = {
201+
url,
202+
};
203+
key && (payload.key = key);
204+
domain && (payload.domain = domain);
205+
externalId && (payload.externalId = externalId);
206+
password && (payload.password = password);
207+
flexible != null && (payload.flexible = flexible);
208+
title && (payload.title = title);
209+
description && (payload.description = description);
210+
image && (payload.image = image);
211+
video && (payload.video = video);
212+
proxy != null && (payload.proxy = proxy);
213+
preRedirection != null && (payload.preRedirection = preRedirection);
214+
pageId && (payload.pageId = pageId);
215+
pageUrl && (payload.pageUrl = pageUrl);
216+
rewrite != null && (payload.rewrite = rewrite);
217+
ios && (payload.ios = ios);
218+
android && (payload.android = android);
219+
doIndex != null && (payload.doIndex = doIndex);
220+
comments && (payload.comments = comments);
221+
expiresAt && (payload.expiresAt = expiresAt);
222+
expiredUrl && (payload.expiredUrl = expiredUrl);
223+
geo && (payload.geo = geo);
224+
publicStats != null && (payload.publicStats = publicStats);
225+
226+
if (tagIds?.length) payload.tagIds = tagIds;
227+
if (tagNames?.length) payload.tagNames = tagNames;
228+
229+
const response = await this.codeqr.createLink(payload);
230+
response && $.export("$summary", "Link created successfully");
231+
return response;
232+
},
233+
};
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
import codeqr from "../../codeqr.app.mjs";
2+
3+
export default {
4+
key: "codeqr-create-qrcode",
5+
name: "Create a QR Code",
6+
description: "Creates a new QR Code in CodeQR using the QR Codes API. [See the docs here](https://codeqr.mintlify.app/api-reference/endpoint/create-a-qrcode)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
codeqr,
11+
type: {
12+
type: "string",
13+
label: "QR Code Type",
14+
description: "Select the type of QR Code to generate.",
15+
optional: false,
16+
},
17+
static: {
18+
type: "boolean",
19+
label: "Static/Dynamic",
20+
description:
21+
"Yes = Static QR Code (fixed content); No = Dynamic QR Code (editable content).",
22+
optional: false,
23+
default: true,
24+
},
25+
text: {
26+
type: "string",
27+
label: "Text",
28+
description: "Text content stored in the QR Code.",
29+
optional: true,
30+
},
31+
url: {
32+
type: "string",
33+
label: "URL",
34+
description: "The destination URL of the QR Code.",
35+
optional: true,
36+
},
37+
email: {
38+
type: "object",
39+
label: "Email",
40+
description: "Email data for email-based QR Codes (JSON format).",
41+
optional: true,
42+
},
43+
phone: {
44+
type: "string",
45+
label: "Phone",
46+
description: "Phone number stored in the QR Code.",
47+
optional: true,
48+
},
49+
expiresAt: {
50+
type: "string",
51+
label: "Expiration Date",
52+
description: "Expiration date of the QR Code (ISO 8601).",
53+
optional: true,
54+
},
55+
trackConversion: {
56+
type: "boolean",
57+
label: "Track Conversion",
58+
description: "Enable tracking of conversions for the QR Code.",
59+
optional: true,
60+
},
61+
title: {
62+
type: "string",
63+
label: "Title",
64+
description: "Title associated with the QR Code.",
65+
optional: true,
66+
},
67+
description: {
68+
type: "string",
69+
label: "Description",
70+
description: "Description associated with the QR Code.",
71+
optional: true,
72+
},
73+
image: {
74+
type: "string",
75+
label: "Image URL",
76+
description: "URL of an image associated with the QR Code.",
77+
optional: true,
78+
},
79+
bgColor: {
80+
type: "string",
81+
label: "Background Color",
82+
description: "Background color of the QR Code.",
83+
optional: true,
84+
},
85+
fgColor: {
86+
type: "string",
87+
label: "Foreground Color",
88+
description: "Foreground color of the QR Code.",
89+
optional: true,
90+
},
91+
size: {
92+
type: "integer",
93+
label: "Size",
94+
description: "Size of the QR Code in pixels.",
95+
optional: true,
96+
},
97+
showLogo: {
98+
type: "boolean",
99+
label: "Show Logo",
100+
description: "Whether to display a logo in the QR Code.",
101+
optional: true,
102+
},
103+
publicStats: {
104+
type: "boolean",
105+
label: "Public Stats",
106+
description: "Whether the QR Code statistics are publicly accessible.",
107+
optional: true,
108+
},
109+
},
110+
async run({ $ }) {
111+
const payload = {};
112+
for (const key of [
113+
"type",
114+
"static",
115+
"text",
116+
"url",
117+
"email",
118+
"phone",
119+
"expiresAt",
120+
"trackConversion",
121+
"title",
122+
"description",
123+
"image",
124+
"bgColor",
125+
"fgColor",
126+
"size",
127+
"showLogo",
128+
"publicStats",
129+
]) {
130+
if (this[key] != null) payload[key] = this[key];
131+
}
132+
const response = await this.codeqr.createQrcode(payload);
133+
$.export("$summary", "QR Code created successfully.");
134+
return response;
135+
},
136+
};

0 commit comments

Comments
 (0)