Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
00e18cf42d | ||
![]() |
b3d2a1167c | ||
![]() |
43c34fcb7b | ||
![]() |
c98f24338f |
@@ -0,0 +1,217 @@
|
||||
import defineAction from '../../../../helpers/define-action.js';
|
||||
|
||||
export default defineAction({
|
||||
name: 'Create contact',
|
||||
key: 'createContact',
|
||||
description: 'Creates a new contact.',
|
||||
arguments: [
|
||||
{
|
||||
label: 'Contact Owner',
|
||||
key: 'contactOwnerId',
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listContactOwners',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'First Name',
|
||||
key: 'firstName',
|
||||
type: 'string',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'Last Name',
|
||||
key: 'lastName',
|
||||
type: 'string',
|
||||
required: true,
|
||||
description: '',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'Title',
|
||||
key: 'title',
|
||||
type: 'string',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'Email',
|
||||
key: 'email',
|
||||
type: 'string',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'Company ID',
|
||||
key: 'companyId',
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listCompanies',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Mobile',
|
||||
key: 'mobile',
|
||||
type: 'string',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'Email Opt Out',
|
||||
key: 'emailOptOut',
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
options: [
|
||||
{ label: 'True', value: true },
|
||||
{ label: 'False', value: false },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'Tags',
|
||||
key: 'tags',
|
||||
type: 'dynamic',
|
||||
required: false,
|
||||
description: '',
|
||||
fields: [
|
||||
{
|
||||
label: 'Tag',
|
||||
key: 'tag',
|
||||
type: 'string',
|
||||
required: false,
|
||||
variables: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'Description',
|
||||
key: 'description',
|
||||
type: 'string',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'Mailing Street',
|
||||
key: 'mailingStreet',
|
||||
type: 'string',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'Mailing City',
|
||||
key: 'mailingCity',
|
||||
type: 'string',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'Mailing State',
|
||||
key: 'mailingState',
|
||||
type: 'string',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'Mailing Country',
|
||||
key: 'mailingCountry',
|
||||
type: 'string',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'Mailing Zip',
|
||||
key: 'mailingZip',
|
||||
type: 'string',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
},
|
||||
],
|
||||
|
||||
async run($) {
|
||||
const {
|
||||
contactOwnerId,
|
||||
firstName,
|
||||
lastName,
|
||||
title,
|
||||
email,
|
||||
companyId,
|
||||
mobile,
|
||||
emailOptOut,
|
||||
tags,
|
||||
description,
|
||||
mailingStreet,
|
||||
mailingCity,
|
||||
mailingState,
|
||||
mailingCountry,
|
||||
mailingZip,
|
||||
} = $.step.parameters;
|
||||
|
||||
const allTags = tags.map((tag) => ({
|
||||
name: tag.tag,
|
||||
}));
|
||||
|
||||
const body = {
|
||||
data: [
|
||||
{
|
||||
Owner: {
|
||||
id: contactOwnerId,
|
||||
},
|
||||
Account_Name: {
|
||||
id: companyId,
|
||||
},
|
||||
First_Name: firstName,
|
||||
Last_Name: lastName,
|
||||
Title: title,
|
||||
Email: email,
|
||||
Mobile: mobile,
|
||||
Email_Opt_Out: emailOptOut,
|
||||
Tag: allTags,
|
||||
Description: description,
|
||||
Mailing_Street: mailingStreet,
|
||||
Mailing_City: mailingCity,
|
||||
Mailing_State: mailingState,
|
||||
Mailing_Country: mailingCountry,
|
||||
Mailing_Zip: mailingZip,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const { data } = await $.http.post(`/bigin/v2/Contacts`, body);
|
||||
|
||||
$.setActionItem({
|
||||
raw: data[0],
|
||||
});
|
||||
},
|
||||
});
|
@@ -0,0 +1,293 @@
|
||||
import defineAction from '../../../../helpers/define-action.js';
|
||||
|
||||
export default defineAction({
|
||||
name: 'Create event',
|
||||
key: 'createEvent',
|
||||
description: 'Creates a new event.',
|
||||
arguments: [
|
||||
{
|
||||
label: 'Host',
|
||||
key: 'hostId',
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listContactOwners',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Title',
|
||||
key: 'title',
|
||||
type: 'string',
|
||||
required: true,
|
||||
description: '',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'From',
|
||||
key: 'from',
|
||||
type: 'string',
|
||||
required: true,
|
||||
description: 'The date format is ISO8601 (yyyy-mm-ddTHH:mm:ssZ).',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'To',
|
||||
key: 'to',
|
||||
type: 'string',
|
||||
required: true,
|
||||
description: 'The date format is ISO8601 (yyyy-mm-ddTHH:mm:ssZ).',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'All Day',
|
||||
key: 'allDay',
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
options: [
|
||||
{ label: 'True', value: true },
|
||||
{ label: 'False', value: false },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'Frequency (Recurring Activity)',
|
||||
key: 'frequency',
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description:
|
||||
'Specifies the frequency of event recurrence. The options include DAILY, WEEKLY, MONTHLY, or YEARLY.',
|
||||
variables: true,
|
||||
options: [
|
||||
{ label: 'Daily Events', value: 'DAILY' },
|
||||
{ label: 'Weekly Events', value: 'WEEKLY' },
|
||||
{ label: 'Monthly Events', value: 'MONTHLY' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'Interval (Recurring Activity)',
|
||||
key: 'interval',
|
||||
type: 'string',
|
||||
required: false,
|
||||
description:
|
||||
'Specifies the time difference between individual events. The INTERVAL can be anywhere from 1 to 99. For instance, with a WEEKLY event set at an INTERVAL of 2, there will be a two-week gap between each occurrence.',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'By Month Day (Recurring Activity)',
|
||||
key: 'byMonthDay',
|
||||
type: 'string',
|
||||
required: false,
|
||||
description:
|
||||
'This specifies the date within the month when the event recurs. The BYMONTHDAY value can be any number from 1 to 31. This rule applies exclusively to events that repeat monthly or yearly.',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'By Week (Recurring Activity)',
|
||||
key: 'byWeek',
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description:
|
||||
'Only relevant for events that occur on a monthly or yearly basis.',
|
||||
variables: true,
|
||||
options: [
|
||||
{ label: 'First week of the month', value: '1' },
|
||||
{ label: 'Second week of the month', value: '2' },
|
||||
{ label: 'Third week of the month', value: '3' },
|
||||
{ label: 'Fourth week of the month', value: '4' },
|
||||
{ label: 'Last week of the month', value: '-1' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'By Day (Recurring Activity)',
|
||||
key: 'byDay',
|
||||
type: 'string',
|
||||
required: false,
|
||||
description:
|
||||
'This signifies the weekday when the event recurs. The options include SU, MO, TU, WE, TH, FR, or SA. This rule applies to events that repeat daily, weekly, monthly, and yearly (should not be combined with INTERVAL).',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'Count (Recurring Activity)',
|
||||
key: 'count',
|
||||
type: 'string',
|
||||
required: false,
|
||||
description:
|
||||
'Specifies the number of events you wish to generate. The count value range from 1 to 99.',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'Until (Recurring Activity)',
|
||||
key: 'until',
|
||||
type: 'string',
|
||||
required: false,
|
||||
description:
|
||||
'Specifies the concluding date for the event recurrence. Please input the date in the YYYY-MM-DD format.',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'Reminder',
|
||||
key: 'reminder',
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description:
|
||||
'Provide the reminder list to notify or prompt participants prior to the event.',
|
||||
variables: true,
|
||||
options: [
|
||||
{ label: '5 min', value: '5 minutes' },
|
||||
{ label: '10 min', value: '10 minutes' },
|
||||
{ label: '15 min', value: '15 minutes' },
|
||||
{ label: '1 hrs', value: '1 hours' },
|
||||
{ label: '2 hrs', value: '2 hours' },
|
||||
{ label: '1 days', value: '1 days' },
|
||||
{ label: '2 days', value: '2 days' },
|
||||
{ label: '1 weeks', value: '1 weeks' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'Location',
|
||||
key: 'location',
|
||||
type: 'string',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'Related Module',
|
||||
key: 'relatedModule',
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
options: [
|
||||
{ label: 'Companies', value: 'Accounts' },
|
||||
{ label: 'Contacts', value: 'Contacts' },
|
||||
{ label: 'Deals', value: 'Deals' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'Participants',
|
||||
key: 'participants',
|
||||
type: 'dynamic',
|
||||
required: false,
|
||||
description: 'Email Address of participants.',
|
||||
fields: [
|
||||
{
|
||||
label: 'Participant',
|
||||
key: 'participant',
|
||||
type: 'string',
|
||||
required: false,
|
||||
variables: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'Description',
|
||||
key: 'description',
|
||||
type: 'string',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'Tags',
|
||||
key: 'tags',
|
||||
type: 'dynamic',
|
||||
required: false,
|
||||
description: '',
|
||||
fields: [
|
||||
{
|
||||
label: 'Tag',
|
||||
key: 'tag',
|
||||
type: 'string',
|
||||
required: false,
|
||||
variables: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
async run($) {
|
||||
const {
|
||||
hostId,
|
||||
title,
|
||||
from,
|
||||
to,
|
||||
allDay,
|
||||
frequency,
|
||||
interval,
|
||||
byMonthDay,
|
||||
byDay,
|
||||
byWeek,
|
||||
count,
|
||||
until,
|
||||
reminder,
|
||||
location,
|
||||
relatedModule,
|
||||
participants,
|
||||
description,
|
||||
tags,
|
||||
} = $.step.parameters;
|
||||
|
||||
const allTags = tags.map((tag) => ({
|
||||
name: tag.tag,
|
||||
}));
|
||||
|
||||
const allParticipants = participants.map((participant) => ({
|
||||
type: 'email',
|
||||
participant: participant.participant,
|
||||
}));
|
||||
|
||||
const [unit, period] = reminder.split(' ');
|
||||
|
||||
let rrule = `FREQ=${frequency};INTERVAL=${interval};`;
|
||||
if (count) rrule += `COUNT=${count};`;
|
||||
if (byMonthDay) rrule += `BYMONTHDAY=${byMonthDay};`;
|
||||
if (byDay) rrule += `BYDAY=${byDay};`;
|
||||
if (byWeek) rrule += `BYSETPOS=${byWeek};`;
|
||||
if (until) rrule += `UNTIL=${until};`;
|
||||
|
||||
const body = {
|
||||
data: [
|
||||
{
|
||||
Owner: {
|
||||
id: hostId,
|
||||
},
|
||||
Event_Title: title,
|
||||
Start_DateTime: from,
|
||||
End_DateTime: to,
|
||||
All_day: allDay,
|
||||
$se_module: relatedModule,
|
||||
Recurring_Activity: {
|
||||
RRULE: rrule,
|
||||
},
|
||||
Remind_At: [
|
||||
{
|
||||
unit: Number(unit),
|
||||
period,
|
||||
},
|
||||
],
|
||||
Venue: location,
|
||||
Participants: allParticipants,
|
||||
Description: description,
|
||||
Tag: allTags,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const { data } = await $.http.post(`/bigin/v2/Events`, body);
|
||||
|
||||
$.setActionItem({
|
||||
raw: data,
|
||||
});
|
||||
},
|
||||
});
|
@@ -0,0 +1,4 @@
|
||||
import createContact from './create-contact/index.js';
|
||||
import createEvent from './create-event/index.js';
|
||||
|
||||
export default [createContact, createEvent];
|
@@ -1,3 +1,5 @@
|
||||
import listCompanies from './list-companies/index.js';
|
||||
import listOrganizations from './list-organizations/index.js';
|
||||
import listContactOwners from './list-contact-owners/index.js';
|
||||
|
||||
export default [listOrganizations];
|
||||
export default [listCompanies, listOrganizations, listContactOwners];
|
||||
|
@@ -0,0 +1,39 @@
|
||||
export default {
|
||||
name: 'List companies',
|
||||
key: 'listCompanies',
|
||||
|
||||
async run($) {
|
||||
const companies = {
|
||||
data: [],
|
||||
};
|
||||
|
||||
const params = new URLSearchParams({
|
||||
page: 1,
|
||||
pageSize: 200,
|
||||
fields: 'Account_Name',
|
||||
});
|
||||
|
||||
let next = false;
|
||||
do {
|
||||
const { data } = await $.http.get('/bigin/v2/Accounts', { params });
|
||||
|
||||
if (data.info.more_records) {
|
||||
params.page = params.page + 1;
|
||||
next = true;
|
||||
} else {
|
||||
next = false;
|
||||
}
|
||||
|
||||
if (data.data) {
|
||||
for (const account of data.data) {
|
||||
companies.data.push({
|
||||
value: account.id,
|
||||
name: account.Account_Name,
|
||||
});
|
||||
}
|
||||
}
|
||||
} while (next);
|
||||
|
||||
return companies;
|
||||
},
|
||||
};
|
@@ -0,0 +1,39 @@
|
||||
export default {
|
||||
name: 'List contact owners',
|
||||
key: 'listContactOwners',
|
||||
|
||||
async run($) {
|
||||
const contactOwners = {
|
||||
data: [],
|
||||
};
|
||||
|
||||
const params = {
|
||||
type: 'AllUsers',
|
||||
page: 1,
|
||||
pageSize: 200,
|
||||
};
|
||||
|
||||
let next = false;
|
||||
do {
|
||||
const { data } = await $.http.get('/bigin/v2/users', params);
|
||||
|
||||
if (data.users.length === params.pageSize) {
|
||||
next = true;
|
||||
params.page = params.page + 1;
|
||||
} else {
|
||||
next = false;
|
||||
}
|
||||
|
||||
if (data.users) {
|
||||
for (const user of data.users) {
|
||||
contactOwners.data.push({
|
||||
value: user.id,
|
||||
name: user.full_name,
|
||||
});
|
||||
}
|
||||
}
|
||||
} while (next);
|
||||
|
||||
return contactOwners;
|
||||
},
|
||||
};
|
@@ -4,6 +4,7 @@ import auth from './auth/index.js';
|
||||
import setBaseUrl from './common/set-base-url.js';
|
||||
import triggers from './triggers/index.js';
|
||||
import dynamicData from './dynamic-data/index.js';
|
||||
import actions from './actions/index.js';
|
||||
|
||||
export default defineApp({
|
||||
name: 'Bigin By Zoho CRM',
|
||||
@@ -18,4 +19,5 @@ export default defineApp({
|
||||
auth,
|
||||
triggers,
|
||||
dynamicData,
|
||||
actions,
|
||||
});
|
||||
|
@@ -1,5 +1,7 @@
|
||||
import newCalls from './new-calls/index.js';
|
||||
import newCompanies from './new-companies/index.js';
|
||||
import newContacts from './new-contacts/index.js';
|
||||
import newProducts from './new-products/index.js';
|
||||
import newTasks from './new-tasks/index.js';
|
||||
|
||||
export default [newCalls, newCompanies, newContacts];
|
||||
export default [newCalls, newCompanies, newContacts, newProducts, newTasks];
|
||||
|
@@ -0,0 +1,89 @@
|
||||
import Crypto from 'crypto';
|
||||
import defineTrigger from '../../../../helpers/define-trigger.js';
|
||||
|
||||
export default defineTrigger({
|
||||
name: 'New products',
|
||||
key: 'newProducts',
|
||||
type: 'webhook',
|
||||
description: 'Triggers when a new product is created.',
|
||||
arguments: [
|
||||
{
|
||||
label: 'Organization',
|
||||
key: 'organizationId',
|
||||
type: 'dropdown',
|
||||
required: true,
|
||||
description: '',
|
||||
variables: false,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listOrganizations',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
async run($) {
|
||||
const dataItem = {
|
||||
raw: $.request.body,
|
||||
meta: {
|
||||
internalId: Crypto.randomUUID(),
|
||||
},
|
||||
};
|
||||
|
||||
$.pushTriggerItem(dataItem);
|
||||
},
|
||||
|
||||
async testRun($) {
|
||||
const organizationId = $.step.parameters.organizationId;
|
||||
|
||||
const sampleEventData = {
|
||||
ids: ['111111111111111111'],
|
||||
token: null,
|
||||
module: 'Products',
|
||||
operation: 'insert',
|
||||
channel_id: organizationId,
|
||||
server_time: 1708426963120,
|
||||
query_params: {},
|
||||
resource_uri: `${$.auth.data.apiDomain}/bigin/v1/Products`,
|
||||
affected_fields: [],
|
||||
};
|
||||
|
||||
const dataItem = {
|
||||
raw: sampleEventData,
|
||||
meta: {
|
||||
internalId: sampleEventData.channel_id,
|
||||
},
|
||||
};
|
||||
|
||||
$.pushTriggerItem(dataItem);
|
||||
},
|
||||
|
||||
async registerHook($) {
|
||||
const organizationId = $.step.parameters.organizationId;
|
||||
|
||||
const payload = {
|
||||
watch: [
|
||||
{
|
||||
channel_id: organizationId,
|
||||
notify_url: $.webhookUrl,
|
||||
events: ['Products.create'],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
await $.http.post('/bigin/v2/actions/watch', payload);
|
||||
|
||||
await $.flow.setRemoteWebhookId(organizationId);
|
||||
},
|
||||
|
||||
async unregisterHook($) {
|
||||
await $.http.delete(
|
||||
`/bigin/v2/actions/watch?channel_ids=${$.flow.remoteWebhookId}`
|
||||
);
|
||||
},
|
||||
});
|
@@ -0,0 +1,89 @@
|
||||
import Crypto from 'crypto';
|
||||
import defineTrigger from '../../../../helpers/define-trigger.js';
|
||||
|
||||
export default defineTrigger({
|
||||
name: 'New tasks',
|
||||
key: 'newTasks',
|
||||
type: 'webhook',
|
||||
description: 'Triggers when a new task is created.',
|
||||
arguments: [
|
||||
{
|
||||
label: 'Organization',
|
||||
key: 'organizationId',
|
||||
type: 'dropdown',
|
||||
required: true,
|
||||
description: '',
|
||||
variables: false,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listOrganizations',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
async run($) {
|
||||
const dataItem = {
|
||||
raw: $.request.body,
|
||||
meta: {
|
||||
internalId: Crypto.randomUUID(),
|
||||
},
|
||||
};
|
||||
|
||||
$.pushTriggerItem(dataItem);
|
||||
},
|
||||
|
||||
async testRun($) {
|
||||
const organizationId = $.step.parameters.organizationId;
|
||||
|
||||
const sampleEventData = {
|
||||
ids: ['111111111111111111'],
|
||||
token: null,
|
||||
module: 'Tasks',
|
||||
operation: 'insert',
|
||||
channel_id: organizationId,
|
||||
server_time: 1708426963120,
|
||||
query_params: {},
|
||||
resource_uri: `${$.auth.data.apiDomain}/bigin/v1/Tasks`,
|
||||
affected_fields: [],
|
||||
};
|
||||
|
||||
const dataItem = {
|
||||
raw: sampleEventData,
|
||||
meta: {
|
||||
internalId: sampleEventData.channel_id,
|
||||
},
|
||||
};
|
||||
|
||||
$.pushTriggerItem(dataItem);
|
||||
},
|
||||
|
||||
async registerHook($) {
|
||||
const organizationId = $.step.parameters.organizationId;
|
||||
|
||||
const payload = {
|
||||
watch: [
|
||||
{
|
||||
channel_id: organizationId,
|
||||
notify_url: $.webhookUrl,
|
||||
events: ['Tasks.create'],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
await $.http.post('/bigin/v2/actions/watch', payload);
|
||||
|
||||
await $.flow.setRemoteWebhookId(organizationId);
|
||||
},
|
||||
|
||||
async unregisterHook($) {
|
||||
await $.http.delete(
|
||||
`/bigin/v2/actions/watch?channel_ids=${$.flow.remoteWebhookId}`
|
||||
);
|
||||
},
|
||||
});
|
@@ -38,6 +38,7 @@ export default defineConfig({
|
||||
collapsed: true,
|
||||
items: [
|
||||
{ text: 'Triggers', link: '/apps/bigin-by-zoho-crm/triggers' },
|
||||
{ text: 'Actions', link: '/apps/bigin-by-zoho-crm/actions' },
|
||||
{ text: 'Connection', link: '/apps/bigin-by-zoho-crm/connection' },
|
||||
],
|
||||
},
|
||||
|
14
packages/docs/pages/apps/bigin-by-zoho-crm/actions.md
Normal file
14
packages/docs/pages/apps/bigin-by-zoho-crm/actions.md
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
favicon: /favicons/bigin-by-zoho-crm.svg
|
||||
items:
|
||||
- name: Create contact
|
||||
desc: Creates a new contact.
|
||||
- name: Create event
|
||||
desc: Creates a new event.
|
||||
---
|
||||
|
||||
<script setup>
|
||||
import CustomListing from '../../components/CustomListing.vue'
|
||||
</script>
|
||||
|
||||
<CustomListing />
|
@@ -7,6 +7,10 @@ items:
|
||||
desc: Triggers when a new company is created.
|
||||
- name: New contacts
|
||||
desc: Triggers when a new contact is created.
|
||||
- name: New products
|
||||
desc: Triggers when a new product is created.
|
||||
- name: New tasks
|
||||
desc: Triggers when a new task is created.
|
||||
---
|
||||
|
||||
<script setup>
|
||||
|
Reference in New Issue
Block a user