-
Notifications
You must be signed in to change notification settings - Fork 5.3k
/
Copy pathcreate-note.mjs
55 lines (51 loc) · 1.33 KB
/
create-note.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import activecampaign from "../../activecampaign.app.mjs";
export default {
key: "activecampaign-create-note",
name: "Create Note",
description: "Adds a note, arbitrary information to a contact, deal, or other Active Campaign objects. See the docs [here](https://developers.activecampaign.com/reference/create-a-note).",
version: "0.2.1",
type: "action",
props: {
activecampaign,
note: {
type: "string",
label: "Note",
description: "The note's text.",
},
reltype: {
type: "string",
label: "Type",
description: "The related type where the note will be added to. Possible Values: `Activity`, `Deal`, `DealTask`, `Subscriber`, `CustomerAccount`",
options: [
"Activity",
"Deal",
"DealTask",
"Subscriber",
"CustomerAccount",
],
},
relid: {
type: "integer",
label: "ID",
description: "Id of the related object where the note is being added.",
},
},
async run({ $ }) {
const {
note,
reltype,
relid,
} = this;
const response = await this.activecampaign.createNote({
data: {
note: {
note,
reltype,
relid,
},
},
});
$.export("$summary", `Successfully created a note with ID ${response.note.id}`);
return response;
},
};