@pipedream/salesforce_rest_api 0.3.3
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 +7 -0
- package/actions/salesforce-create-account/salesforce-create-account.mjs +374 -0
- package/actions/salesforce-create-attachment/salesforce-create-attachment.mjs +73 -0
- package/actions/salesforce-create-campaign/salesforce-create-campaign.mjs +148 -0
- package/actions/salesforce-create-case/salesforce-create-case.mjs +179 -0
- package/actions/salesforce-create-casecomment/salesforce-create-casecomment.mjs +58 -0
- package/actions/salesforce-create-contact/salesforce-create-contact.mjs +340 -0
- package/actions/salesforce-create-event/salesforce-create-event.mjs +232 -0
- package/actions/salesforce-create-lead/salesforce-create-lead.mjs +267 -0
- package/actions/salesforce-create-note/salesforce-create-note.mjs +63 -0
- package/actions/salesforce-create-opportunity/salesforce-create-opportunity.mjs +170 -0
- package/actions/salesforce-create-record/salesforce-create-record.mjs +36 -0
- package/actions/salesforce-create-task/salesforce-create-task.mjs +219 -0
- package/actions/salesforce-delete-opportunity/salesforce-delete-opportunity.mjs +37 -0
- package/actions/salesforce-get-sobject-fields-values/salesforce-get-sobject-fields-values.mjs +37 -0
- package/actions/salesforce-insert-blob-data/salesforce-insert-blob-data.mjs +70 -0
- package/actions/salesforce-make-api-call/salesforce-make-api-call.mjs +56 -0
- package/actions/salesforce-soql-search/salesforce-soql-search.mjs +29 -0
- package/actions/salesforce-sosl-search/salesforce-sosl-search.mjs +30 -0
- package/actions/salesforce-update-account/salesforce-update-account.mjs +357 -0
- package/actions/salesforce-update-contact/salesforce-update-contact.mjs +345 -0
- package/actions/salesforce-update-opportunity/salesforce-update-opportunity.mjs +171 -0
- package/actions/salesforce-update-record/salesforce-update-record.mjs +40 -0
- package/package.json +21 -0
- package/salesforce_rest_api.app.mjs +247 -0
- package/sources/common-instant.mjs +134 -0
- package/sources/common.mjs +96 -0
- package/sources/new-object/new-object.mjs +69 -0
- package/sources/new-object-instant/new-object-instant.mjs +35 -0
- package/sources/new-outbound-message/new-outbound-message.mjs +105 -0
- package/sources/object-deleted/object-deleted.mjs +52 -0
- package/sources/object-deleted-instant/object-deleted-instant.mjs +36 -0
- package/sources/object-updated/object-updated.mjs +63 -0
- package/sources/object-updated-instant/object-updated-instant.mjs +36 -0
- package/sources/updated-field-on-record/updated-field-on-record.mjs +179 -0
- package/sources/updated-field-on-record-instant/updated-field-on-record-instant.mjs +76 -0
- package/utils.mjs +27 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2020 Pipedream, Inc.
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
// legacy_hash_id: a_8Ki78k
|
|
2
|
+
import { axios } from "@pipedream/platform";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "salesforce_rest_api-salesforce-create-account",
|
|
6
|
+
name: "Create Account",
|
|
7
|
+
description: "Creates a Salesforce account, representing an individual account, which is an organization or person involved with your business (such as customers, competitors, and partners).",
|
|
8
|
+
version: "0.2.1",
|
|
9
|
+
type: "action",
|
|
10
|
+
props: {
|
|
11
|
+
salesforce_rest_api: {
|
|
12
|
+
type: "app",
|
|
13
|
+
app: "salesforce_rest_api",
|
|
14
|
+
},
|
|
15
|
+
Name: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "Name of the account. Maximum size is 255 characters. If the account has a record type of Person Account:\nThis value is the concatenation of the FirstName, MiddleName, LastName, and Suffix of the associated person contact.",
|
|
18
|
+
},
|
|
19
|
+
AccountNumber: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Account number assigned to this account (not the unique, system-generated ID assigned during creation). Maximum size is 40 characters.",
|
|
22
|
+
optional: true,
|
|
23
|
+
},
|
|
24
|
+
AccountSource: {
|
|
25
|
+
type: "string",
|
|
26
|
+
description: "The source of the account record. For example, Advertisement, Data.com, or Trade Show. The source is selected from a picklist of available values, which are set by an administrator in Salesforce. Each picklist value can have up to 40 characters.",
|
|
27
|
+
optional: true,
|
|
28
|
+
},
|
|
29
|
+
AnnualRevenue: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "Estimated annual revenue of the account.",
|
|
32
|
+
optional: true,
|
|
33
|
+
},
|
|
34
|
+
BillingCity: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "Details for the billing address of this account. Maximum size is 40 characters.",
|
|
37
|
+
optional: true,
|
|
38
|
+
},
|
|
39
|
+
BillingCountry: {
|
|
40
|
+
type: "string",
|
|
41
|
+
description: "Details for the billing address of this account. Maximum size is 80 characters.",
|
|
42
|
+
optional: true,
|
|
43
|
+
},
|
|
44
|
+
BillingCountryCode: {
|
|
45
|
+
type: "string",
|
|
46
|
+
description: "The ISO country code for the account's billing address.",
|
|
47
|
+
optional: true,
|
|
48
|
+
},
|
|
49
|
+
BillingGeocodeAccuracy: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "Accuracy level of the geocode for the billing address. See [Compound Field Considerations and Limitations](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/compound_fields_limitations.htm#compound_fields_limitations) for details on geolocation compound fields.",
|
|
52
|
+
optional: true,
|
|
53
|
+
},
|
|
54
|
+
BillingLatitude: {
|
|
55
|
+
type: "integer",
|
|
56
|
+
description: "Used with BillingLongitude to specify the precise geolocation of a billing address. Acceptable values are numbers between 90 and 90 with up to 15 decimal places. See [Compound Field Considerations and Limitations](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/compound_fields_limitations.htm#compound_fields_limitations) for details on geolocation compound fields.",
|
|
57
|
+
optional: true,
|
|
58
|
+
},
|
|
59
|
+
BillingLongitude: {
|
|
60
|
+
type: "integer",
|
|
61
|
+
description: "Used with BillingLatitude to specify the precise geolocation of a billing address. Acceptable values are numbers between 180 and 180 with up to 15 decimal places. See [Compound Field Considerations and Limitations](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/compound_fields_limitations.htm#compound_fields_limitations) for details on geolocation compound fields.",
|
|
62
|
+
optional: true,
|
|
63
|
+
},
|
|
64
|
+
BillingPostalCode: {
|
|
65
|
+
type: "string",
|
|
66
|
+
description: "Details for the billing address of this account. Maximum size is 20 characters.",
|
|
67
|
+
optional: true,
|
|
68
|
+
},
|
|
69
|
+
BillingState: {
|
|
70
|
+
type: "string",
|
|
71
|
+
description: "Details for the billing address of this account. Maximum size is 80 characters.",
|
|
72
|
+
optional: true,
|
|
73
|
+
},
|
|
74
|
+
BillingStateCode: {
|
|
75
|
+
type: "string",
|
|
76
|
+
description: "The ISO state code for the account's billing address.",
|
|
77
|
+
optional: true,
|
|
78
|
+
},
|
|
79
|
+
BillingStreet: {
|
|
80
|
+
type: "string",
|
|
81
|
+
description: "Street address for the billing address of this account.",
|
|
82
|
+
optional: true,
|
|
83
|
+
},
|
|
84
|
+
ChannelProgramName: {
|
|
85
|
+
type: "string",
|
|
86
|
+
description: "Read only. Name of the channel program the account has enrolled.\nIf this account has enrolled more than one channel program, the oldest channel program name will be displayed.",
|
|
87
|
+
optional: true,
|
|
88
|
+
},
|
|
89
|
+
ChannelProgramLevelName: {
|
|
90
|
+
type: "string",
|
|
91
|
+
description: "Read only. Name of the channel program level the account has enrolled.\nIf this account has enrolled more than one channel program level, the oldest channel program name will be displayed.",
|
|
92
|
+
optional: true,
|
|
93
|
+
},
|
|
94
|
+
CleanStatus: {
|
|
95
|
+
type: "string",
|
|
96
|
+
description: "Indicates the record's clean status as compared with Data.com. Values are: Matched, Different, Acknowledged, NotFound, Inactive, Pending, SelectMatch, or Skipped. Several values for CleanStatus display with different labels on the account record detail page.\nMatched displays as In Sync\nAcknowledged displays as Reviewed\nPending displays as Not Compared",
|
|
97
|
+
optional: true,
|
|
98
|
+
options: [
|
|
99
|
+
" Matched",
|
|
100
|
+
" Different",
|
|
101
|
+
" Acknowledged",
|
|
102
|
+
" NotFound",
|
|
103
|
+
" Inactive",
|
|
104
|
+
" Pending",
|
|
105
|
+
" SelectMatch",
|
|
106
|
+
"Skipped",
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
Description: {
|
|
110
|
+
type: "string",
|
|
111
|
+
description: "Text description of the account. Limited to 32,000 KB.",
|
|
112
|
+
optional: true,
|
|
113
|
+
},
|
|
114
|
+
DunsNumber: {
|
|
115
|
+
type: "string",
|
|
116
|
+
description: "The Data Universal Numbering System (D-U-N-S) number is a unique, nine-digit number assigned to every business location in the Dun & Bradstreet database that has a unique, separate, and distinct operation. D-U-N-S numbers are used by industries and organizations around the world as a global standard for business identification and tracking. Maximum size is 9 characters. This field is available on business accounts, not person accounts.\nThis field is only available to organizations that use Data.com Prospector or Data.com Clean.",
|
|
117
|
+
optional: true,
|
|
118
|
+
},
|
|
119
|
+
Fax: {
|
|
120
|
+
type: "string",
|
|
121
|
+
description: "Fax number for the account.",
|
|
122
|
+
optional: true,
|
|
123
|
+
},
|
|
124
|
+
HasOptedOutOfEmail: {
|
|
125
|
+
type: "boolean",
|
|
126
|
+
description: "Indicates whether the contact doesn't want to receive email from Salesforce (true) or does (false).",
|
|
127
|
+
optional: true,
|
|
128
|
+
},
|
|
129
|
+
Industry: {
|
|
130
|
+
type: "string",
|
|
131
|
+
description: "An industry associated with this account. Maximum size is 40 characters.",
|
|
132
|
+
optional: true,
|
|
133
|
+
},
|
|
134
|
+
IsCustomerPortal: {
|
|
135
|
+
type: "boolean",
|
|
136
|
+
description: "Indicates whether the account has at least one contact enabled to use the organization's Customer Portal (true) or not (false). This field is available if Customer Portal is enabled OR Communities is enabled and you have Customer Portal licenses.\nIf you change this field's value from true to false, you can disable up to 100 Customer Portal users associated with the account and permanently delete all of the account's Customer Portal roles and groups. You can't restore deleted Customer Portal roles and groups. This field can be updated in API version 16.0 and later. We recommend that you update up to 50 contacts simultaneously when changing the accounts on contacts enabled for a Customer Portal or partner portal. We also recommend that you make this update after business hours.",
|
|
137
|
+
optional: true,
|
|
138
|
+
},
|
|
139
|
+
Jigsaw: {
|
|
140
|
+
type: "string",
|
|
141
|
+
description: "References the ID of a company in Data.com. If an account has a value in this field, it means that the account was imported from Data.com. If the field value is null, the account was not imported from Data.com. Maximum size is 20 characters. Available in API version 22.0 and later. Label is Data.com Key. This field is available on business accounts, not person accounts. The Jigsaw field is exposed in the API to support troubleshooting for import errors and reimporting of corrected data. Do not modify the value in the Jigsaw field.",
|
|
142
|
+
optional: true,
|
|
143
|
+
},
|
|
144
|
+
NaicsCode: {
|
|
145
|
+
type: "string",
|
|
146
|
+
description: "The six-digit North American Industry Classification System (NAICS) code is the standard used by business and government to classify business establishments into industries, according to their economic activity for the purpose of collecting, analyzing, and publishing statistical data related to the U.S. business economy. Maximum size is 8 characters. This field is available on business accounts, not person accounts.\nThis field is only available to organizations that use Data.com Prospector or Data.com Clean.",
|
|
147
|
+
optional: true,
|
|
148
|
+
},
|
|
149
|
+
NaicsDesc: {
|
|
150
|
+
type: "string",
|
|
151
|
+
description: "A brief description of an organization's line of business, based on its NAICS code. Maximum size is 120 characters. This field is available on business accounts, not person accounts.\nThis field is only available to organizations that use Data.com Prospector or Data.com Clean.",
|
|
152
|
+
optional: true,
|
|
153
|
+
},
|
|
154
|
+
NumberOfEmployees: {
|
|
155
|
+
type: "integer",
|
|
156
|
+
description: "Number of employees working at the company represented by this account. Maximum size is eight digits.",
|
|
157
|
+
optional: true,
|
|
158
|
+
},
|
|
159
|
+
OperatingHoursId: {
|
|
160
|
+
type: "string",
|
|
161
|
+
description: "The operating hours associated with the account. Available only if Field Service Lightning is enabled.",
|
|
162
|
+
optional: true,
|
|
163
|
+
},
|
|
164
|
+
OwnerId: {
|
|
165
|
+
type: "string",
|
|
166
|
+
description: "The ID of the user who currently owns this account. Default value is the user logged in to the API to perform the create.\nIf you have set up account teams in your organization, updating this field has different consequences depending on your version of the API:\nFor API version 12.0 and later, sharing records are kept, as they are for all objects.\nFor API version before 12.0, sharing records are deleted.\nFor API version 16.0 and later, users must have the Transfer Record permission in order to update (transfer) account ownership using this field.",
|
|
167
|
+
optional: true,
|
|
168
|
+
},
|
|
169
|
+
Ownership: {
|
|
170
|
+
type: "string",
|
|
171
|
+
description: "Ownership type for the account, for example Private, Public, or Subsidiary.",
|
|
172
|
+
optional: true,
|
|
173
|
+
},
|
|
174
|
+
ParentId: {
|
|
175
|
+
type: "string",
|
|
176
|
+
description: "ID of the parent object, if any.",
|
|
177
|
+
optional: true,
|
|
178
|
+
},
|
|
179
|
+
PersonIndividualId: {
|
|
180
|
+
type: "string",
|
|
181
|
+
description: "ID of the data privacy record associated with this person's account. This field is available if you enabled Data Protection and Privacy in Setup.\nAvailable in API version 42.0 and later.",
|
|
182
|
+
optional: true,
|
|
183
|
+
},
|
|
184
|
+
Phone: {
|
|
185
|
+
type: "string",
|
|
186
|
+
description: "Phone number for this account. Maximum size is 40 characters.",
|
|
187
|
+
optional: true,
|
|
188
|
+
},
|
|
189
|
+
PhotoUrl: {
|
|
190
|
+
type: "string",
|
|
191
|
+
description: "Path to be combined with the URL of a Salesforce instance (for example, https://yourInstance.salesforce.com/) to generate a URL to request the social network profile image associated with the account. Generated URL returns an HTTP redirect (code 302) to the social network profile image for the account.\nBlank if Social Accounts and Contacts isn't enabled for the organization or if Social Accounts and Contacts is disabled for the requesting user.",
|
|
192
|
+
optional: true,
|
|
193
|
+
},
|
|
194
|
+
Rating: {
|
|
195
|
+
type: "string",
|
|
196
|
+
description: "The account's prospect rating, for example Hot, Warm, or Cold.",
|
|
197
|
+
optional: true,
|
|
198
|
+
},
|
|
199
|
+
RecordTypeId: {
|
|
200
|
+
type: "string",
|
|
201
|
+
description: "ID of the record type assigned to this object.",
|
|
202
|
+
optional: true,
|
|
203
|
+
},
|
|
204
|
+
Salutation: {
|
|
205
|
+
type: "string",
|
|
206
|
+
description: "Honorific added to the name for use in letters, etc.",
|
|
207
|
+
optional: true,
|
|
208
|
+
},
|
|
209
|
+
ShippingCity: {
|
|
210
|
+
type: "string",
|
|
211
|
+
description: "Details of the shipping address for this account. City maximum size is 40 characters",
|
|
212
|
+
optional: true,
|
|
213
|
+
},
|
|
214
|
+
ShippingCountry: {
|
|
215
|
+
type: "string",
|
|
216
|
+
description: "Details of the shipping address for this account. Country maximum size is 80 characters.",
|
|
217
|
+
optional: true,
|
|
218
|
+
},
|
|
219
|
+
ShippingCountryCode: {
|
|
220
|
+
type: "string",
|
|
221
|
+
description: "The ISO country code for the account's shipping address.",
|
|
222
|
+
optional: true,
|
|
223
|
+
},
|
|
224
|
+
ShippingGeocodeAccuracy: {
|
|
225
|
+
type: "string",
|
|
226
|
+
description: "Accuracy level of the geocode for the shipping address. See [Compound Field Considerations and Limitations](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/compound_fields_limitations.htm#compound_fields_limitations) for details on geolocation compound fields.",
|
|
227
|
+
optional: true,
|
|
228
|
+
},
|
|
229
|
+
ShippingLatitude: {
|
|
230
|
+
type: "string",
|
|
231
|
+
description: "Used with ShippingLongitude to specify the precise geolocation of a shipping address. Acceptable values are numbers between 90 and 90 with up to 15 decimal places. See [Compound Field Considerations and Limitations](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/compound_fields_limitations.htm#compound_fields_limitations) for details on geolocation compound fields",
|
|
232
|
+
optional: true,
|
|
233
|
+
},
|
|
234
|
+
ShippingLongitude: {
|
|
235
|
+
type: "integer",
|
|
236
|
+
description: "Used with ShippingLatitude to specify the precise geolocation of an address. Acceptable values are numbers between 180 and 180 with up to 15 decimal places. See [Compound Field Considerations and Limitations](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/compound_fields_limitations.htm#compound_fields_limitations) for details on geolocation compound fields.",
|
|
237
|
+
optional: true,
|
|
238
|
+
},
|
|
239
|
+
ShippingPostalCode: {
|
|
240
|
+
type: "string",
|
|
241
|
+
description: "Details of the shipping address for this account. Postal code maximum size is 20 characters.",
|
|
242
|
+
optional: true,
|
|
243
|
+
},
|
|
244
|
+
ShippingState: {
|
|
245
|
+
type: "string",
|
|
246
|
+
description: "Details of the shipping address for this account. State maximum size is 80 characters.",
|
|
247
|
+
optional: true,
|
|
248
|
+
},
|
|
249
|
+
ShippingStateCode: {
|
|
250
|
+
type: "string",
|
|
251
|
+
description: "The ISO state code for the account's shipping address.",
|
|
252
|
+
optional: true,
|
|
253
|
+
},
|
|
254
|
+
ShippingStreet: {
|
|
255
|
+
type: "string",
|
|
256
|
+
description: "The street address of the shipping address for this account. Maximum of 255 characters.",
|
|
257
|
+
optional: true,
|
|
258
|
+
},
|
|
259
|
+
Sic: {
|
|
260
|
+
type: "string",
|
|
261
|
+
description: "Standard Industrial Classification code of the company's main business categorization, for example, 57340 for Electronics. Maximum of 20 characters. This field is available on business accounts, not person accounts.",
|
|
262
|
+
optional: true,
|
|
263
|
+
},
|
|
264
|
+
SicDesc: {
|
|
265
|
+
type: "string",
|
|
266
|
+
description: "A brief description of an organization's line of business, based on its SIC code. Maximum length is 80 characters. This field is available on business accounts, not person accounts.",
|
|
267
|
+
optional: true,
|
|
268
|
+
},
|
|
269
|
+
Site: {
|
|
270
|
+
type: "string",
|
|
271
|
+
description: "Name of the account's location, for example Headquarters or London. Label is Account Site. Maximum of 80 characters.",
|
|
272
|
+
optional: true,
|
|
273
|
+
},
|
|
274
|
+
TickerSymbol: {
|
|
275
|
+
type: "string",
|
|
276
|
+
description: "The stock market symbol for this account. Maximum of 20 characters. This field is available on business accounts, not person accounts.",
|
|
277
|
+
optional: true,
|
|
278
|
+
},
|
|
279
|
+
Tradestyle: {
|
|
280
|
+
type: "string",
|
|
281
|
+
description: "A name, different from its legal name, that an organization may use for conducting business. Similar to Doing business as or DBA. Maximum length is 255 characters. This field is available on business accounts, not person accounts. This field is only available to organizations that use Data.com Prospector or Data.com Clean.",
|
|
282
|
+
optional: true,
|
|
283
|
+
},
|
|
284
|
+
Type: {
|
|
285
|
+
type: "string",
|
|
286
|
+
description: "Type of account, for example, Customer, Competitor, or Partner.",
|
|
287
|
+
optional: true,
|
|
288
|
+
},
|
|
289
|
+
Website: {
|
|
290
|
+
type: "string",
|
|
291
|
+
description: "The website of this account. Maximum of 255 characters.",
|
|
292
|
+
optional: true,
|
|
293
|
+
},
|
|
294
|
+
YearStarted: {
|
|
295
|
+
type: "string",
|
|
296
|
+
description: "The date when an organization was legally established. Maximum length is 4 characters. This field is available on business accounts, not person accounts.\nThis field is only available to organizations that use Data.com Prospector or Data.com Clean.",
|
|
297
|
+
optional: true,
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
async run({ $ }) {
|
|
301
|
+
// See the API docs here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_create.htm
|
|
302
|
+
// Account object: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_account.htm
|
|
303
|
+
|
|
304
|
+
if (!this.Name) {
|
|
305
|
+
throw new Error("Must provide Name parameter.");
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
return await axios($, {
|
|
309
|
+
"method": "post",
|
|
310
|
+
"url": `${this.salesforce_rest_api.$auth.instance_url}/services/data/v20.0/sobjects/Account/`,
|
|
311
|
+
"Content-Type": "application/json",
|
|
312
|
+
"headers": {
|
|
313
|
+
Authorization: `Bearer ${this.salesforce_rest_api.$auth.oauth_access_token}`,
|
|
314
|
+
},
|
|
315
|
+
"data": {
|
|
316
|
+
AccountNumber: this.AccountNumber,
|
|
317
|
+
AccountSource: this.AccountSource,
|
|
318
|
+
AnnualRevenue: this.AnnualRevenue,
|
|
319
|
+
BillingCity: this.BillingCity,
|
|
320
|
+
BillingCountry: this.BillingCountry,
|
|
321
|
+
BillingCountryCode: this.BillingCountryCode,
|
|
322
|
+
BillingGeocodeAccuracy: this.BillingGeocodeAccuracy,
|
|
323
|
+
BillingLatitude: this.BillingLatitude,
|
|
324
|
+
BillingLongitude: this.BillingLongitude,
|
|
325
|
+
BillingPostalCode: this.BillingPostalCode,
|
|
326
|
+
BillingState: this.BillingState,
|
|
327
|
+
BillingStateCode: this.BillingStateCode,
|
|
328
|
+
BillingStreet: this.BillingStreet,
|
|
329
|
+
ChannelProgramName: this.ChannelProgramName,
|
|
330
|
+
ChannelProgramLevelName: this.ChannelProgramLevelName,
|
|
331
|
+
CleanStatus: this.CleanStatus,
|
|
332
|
+
Description: this.Description,
|
|
333
|
+
DunsNumber: this.DunsNumber,
|
|
334
|
+
Fax: this.Fax,
|
|
335
|
+
HasOptedOutOfEmail: this.HasOptedOutOfEmail,
|
|
336
|
+
Industry: this.Industry,
|
|
337
|
+
IsCustomerPortal: this.IsCustomerPortal,
|
|
338
|
+
Jigsaw: this.Jigsaw,
|
|
339
|
+
NaicsCode: this.NaicsCode,
|
|
340
|
+
NaicsDesc: this.NaicsDesc,
|
|
341
|
+
Name: this.Name,
|
|
342
|
+
NumberOfEmployees: this.NumberOfEmployees,
|
|
343
|
+
OperatingHoursId: this.OperatingHoursId,
|
|
344
|
+
OwnerId: this.OwnerId,
|
|
345
|
+
Ownership: this.Ownership,
|
|
346
|
+
ParentId: this.ParentId,
|
|
347
|
+
PersonIndividualId: this.PersonIndividualId,
|
|
348
|
+
Phone: this.Phone,
|
|
349
|
+
PhotoUrl: this.PhotoUrl,
|
|
350
|
+
Rating: this.Rating,
|
|
351
|
+
RecordTypeId: this.RecordTypeId,
|
|
352
|
+
Salutation: this.Salutation,
|
|
353
|
+
ShippingCity: this.ShippingCity,
|
|
354
|
+
ShippingCountry: this.ShippingCountry,
|
|
355
|
+
ShippingCountryCode: this.ShippingCountryCode,
|
|
356
|
+
ShippingGeocodeAccuracy: this.ShippingGeocodeAccuracy,
|
|
357
|
+
ShippingLatitude: this.ShippingLatitude,
|
|
358
|
+
ShippingLongitude: this.ShippingLongitude,
|
|
359
|
+
ShippingPostalCode: this.ShippingPostalCode,
|
|
360
|
+
ShippingState: this.ShippingState,
|
|
361
|
+
ShippingStateCode: this.ShippingStateCode,
|
|
362
|
+
ShippingStreet: this.ShippingStreet,
|
|
363
|
+
Sic: this.Sic,
|
|
364
|
+
SicDesc: this.SicDesc,
|
|
365
|
+
Site: this.Site,
|
|
366
|
+
TickerSymbol: this.TickerSymbol,
|
|
367
|
+
Tradestyle: this.Tradestyle,
|
|
368
|
+
Type: this.Type,
|
|
369
|
+
Website: this.Website,
|
|
370
|
+
YearStarted: this.YearStarted,
|
|
371
|
+
},
|
|
372
|
+
});
|
|
373
|
+
},
|
|
374
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// legacy_hash_id: a_Mdiz3x
|
|
2
|
+
import { axios } from "@pipedream/platform";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "salesforce_rest_api-salesforce-create-attachment",
|
|
6
|
+
name: "Create Attachment",
|
|
7
|
+
description: "Creates an attachment, which represents a file that a User has uploaded and attached to a parent object.",
|
|
8
|
+
version: "0.3.1",
|
|
9
|
+
type: "action",
|
|
10
|
+
props: {
|
|
11
|
+
salesforce_rest_api: {
|
|
12
|
+
type: "app",
|
|
13
|
+
app: "salesforce_rest_api",
|
|
14
|
+
},
|
|
15
|
+
Body: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "Encoded file data.",
|
|
18
|
+
},
|
|
19
|
+
Name: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Name of the attached file. Maximum size is 255 characters.",
|
|
22
|
+
},
|
|
23
|
+
ParentId: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "ID of the parent object of the attachment. The following objects are supported as parents of attachments:\n* Account\n* Asset\n* Campaign\n* Case\n* Contact\n* Contract\n* Custom objects\n* EmailMessage\n* EmailTemplate\n* Event\n* Lead\n* Opportunity\n* Product2\n* Solution\n* Task",
|
|
26
|
+
},
|
|
27
|
+
ContentType: {
|
|
28
|
+
type: "string",
|
|
29
|
+
description: "The content type of the attachment.If the Don't allow HTML uploads as attachments or document records security setting is enabled for your organization, you cannot upload files with the following file extensions: .htm, .html, .htt, .htx, .mhtm, .mhtml, .shtm, .shtml, .acgi, .svg. When you insert a document or attachment through the API, make sure that this field is set to the appropriate MIME type.",
|
|
30
|
+
optional: true,
|
|
31
|
+
},
|
|
32
|
+
Description: {
|
|
33
|
+
type: "string",
|
|
34
|
+
description: "Description of the attachment. Maximum size is 500 characters. This field is available in API version 18.0 and later.",
|
|
35
|
+
optional: true,
|
|
36
|
+
},
|
|
37
|
+
IsPrivate: {
|
|
38
|
+
type: "boolean",
|
|
39
|
+
description: "Indicates whether this record is viewable only by the owner and administrators (true) or viewable by all otherwise-allowed users (false). During a create or update call, it is possible to mark an Attachment record as private even if you are not the owner. This can result in a situation in which you can no longer access the record that you just inserted or updated. Label is Private.Attachments on tasks or events can't be marked private.",
|
|
40
|
+
optional: true,
|
|
41
|
+
},
|
|
42
|
+
OwnerId: {
|
|
43
|
+
type: "string",
|
|
44
|
+
description: "ID of the User who owns the attachment. This field was required previous to release 9.0. Beginning with release 9.0, it can be null on create.The owner of an attachment on a task or event must be the same as the owner of the task or event.",
|
|
45
|
+
optional: true,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
async run({ $ }) {
|
|
49
|
+
//See the API docs here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_what_is_rest_api.htm
|
|
50
|
+
// Attachment object: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_attachment.htm
|
|
51
|
+
|
|
52
|
+
if (!this.Body || !this.Name || !this.ParentId) {
|
|
53
|
+
throw new Error("Must provide Body, Name and ParentId parameters.");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return await axios($, {
|
|
57
|
+
method: "post",
|
|
58
|
+
url: `${this.salesforce_rest_api.$auth.instance_url}/services/data/v20.0/sobjects/Attachment/`,
|
|
59
|
+
headers: {
|
|
60
|
+
Authorization: `Bearer ${this.salesforce_rest_api.$auth.oauth_access_token}`,
|
|
61
|
+
},
|
|
62
|
+
data: {
|
|
63
|
+
Body: this.Body,
|
|
64
|
+
ContentType: this.ContentType,
|
|
65
|
+
Description: this.Description,
|
|
66
|
+
IsPrivate: this.IsPrivate,
|
|
67
|
+
Name: this.Name,
|
|
68
|
+
OwnerId: this.OwnerId,
|
|
69
|
+
ParentId: this.ParentId,
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
// legacy_hash_id: a_52idrP
|
|
2
|
+
import { axios } from "@pipedream/platform";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "salesforce_rest_api-salesforce-create-campaign",
|
|
6
|
+
name: "Create Campaign",
|
|
7
|
+
description: "Creates a marketing campaign, such as a direct mail promotion, webinar, or trade show.",
|
|
8
|
+
version: "0.2.1",
|
|
9
|
+
type: "action",
|
|
10
|
+
props: {
|
|
11
|
+
salesforce_rest_api: {
|
|
12
|
+
type: "app",
|
|
13
|
+
app: "salesforce_rest_api",
|
|
14
|
+
},
|
|
15
|
+
Name: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "Required. Name of the campaign. Limit: is 80 characters.",
|
|
18
|
+
},
|
|
19
|
+
ActualCost: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Amount of money spent to run the campaign.",
|
|
22
|
+
optional: true,
|
|
23
|
+
},
|
|
24
|
+
BudgetedCost: {
|
|
25
|
+
type: "string",
|
|
26
|
+
description: "Amount of money budgeted for the campaign.",
|
|
27
|
+
optional: true,
|
|
28
|
+
},
|
|
29
|
+
CampaignImageId: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "ID of the campaign image. Available in API version 42.0 and later.",
|
|
32
|
+
optional: true,
|
|
33
|
+
},
|
|
34
|
+
CampaignMemberRecordTypeId: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "The record type ID for CampaignMember records associated with the campaign.",
|
|
37
|
+
optional: true,
|
|
38
|
+
},
|
|
39
|
+
CurrencyIsoCode: {
|
|
40
|
+
type: "string",
|
|
41
|
+
description: "Available only for organizations with the multicurrency feature enabled. Contains the ISO code for any currency allowed by the organization.",
|
|
42
|
+
optional: true,
|
|
43
|
+
},
|
|
44
|
+
Description: {
|
|
45
|
+
type: "string",
|
|
46
|
+
description: "Description of the campaign. Limit: 32 KB. Only the first 255 characters display in reports.",
|
|
47
|
+
optional: true,
|
|
48
|
+
},
|
|
49
|
+
EndDate: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "Ending date for the campaign. Responses received after this date are still counted.",
|
|
52
|
+
optional: true,
|
|
53
|
+
},
|
|
54
|
+
ExpectedResponse: {
|
|
55
|
+
type: "string",
|
|
56
|
+
description: "Percentage of responses you expect to receive for the campaign.",
|
|
57
|
+
optional: true,
|
|
58
|
+
},
|
|
59
|
+
ExpectedRevenue: {
|
|
60
|
+
type: "string",
|
|
61
|
+
description: "Amount of money you expect to generate from the campaign.",
|
|
62
|
+
optional: true,
|
|
63
|
+
},
|
|
64
|
+
IsActive: {
|
|
65
|
+
type: "boolean",
|
|
66
|
+
description: "Indicates whether this campaign is active (true) or not (false). Default value is false. Label is Active.",
|
|
67
|
+
optional: true,
|
|
68
|
+
},
|
|
69
|
+
NumberSent: {
|
|
70
|
+
type: "integer",
|
|
71
|
+
description: "Number of individuals targeted by the campaign. For example, the number of emails sent. Label is Num Sent.",
|
|
72
|
+
optional: true,
|
|
73
|
+
},
|
|
74
|
+
OwnerId: {
|
|
75
|
+
type: "string",
|
|
76
|
+
description: "ID of the user who owns this campaign. Default value is the user logging in to the API to perform the create.",
|
|
77
|
+
optional: true,
|
|
78
|
+
},
|
|
79
|
+
ParentCampaign: {
|
|
80
|
+
type: "string",
|
|
81
|
+
description: "The campaign above the selected campaign in the campaign hierarchy.",
|
|
82
|
+
optional: true,
|
|
83
|
+
},
|
|
84
|
+
ParentId: {
|
|
85
|
+
type: "string",
|
|
86
|
+
description: "ID of the parent Campaign record, if any.",
|
|
87
|
+
optional: true,
|
|
88
|
+
},
|
|
89
|
+
RecordTypeId: {
|
|
90
|
+
type: "string",
|
|
91
|
+
description: "ID of the record type assigned to this object.",
|
|
92
|
+
optional: true,
|
|
93
|
+
},
|
|
94
|
+
StartDate: {
|
|
95
|
+
type: "string",
|
|
96
|
+
description: "Starting date for the campaign.",
|
|
97
|
+
optional: true,
|
|
98
|
+
},
|
|
99
|
+
Status: {
|
|
100
|
+
type: "string",
|
|
101
|
+
description: "Status of the campaign, for example, Planned, In Progress. Limit: 40 characters.",
|
|
102
|
+
optional: true,
|
|
103
|
+
},
|
|
104
|
+
Type: {
|
|
105
|
+
type: "string",
|
|
106
|
+
description: "Type of campaign, for example, Direct Mail or Referral Program. Limit: 40 characters.",
|
|
107
|
+
optional: true,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
async run({ $ }) {
|
|
111
|
+
// See the API docs here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_create.htm
|
|
112
|
+
// Campaign object: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_campaign.htm
|
|
113
|
+
|
|
114
|
+
if (!this.Name) {
|
|
115
|
+
throw new Error("Must provide Name parameter.");
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return await axios($, {
|
|
119
|
+
"method": "post",
|
|
120
|
+
"url": `${this.salesforce_rest_api.$auth.instance_url}/services/data/v20.0/sobjects/Campaign/`,
|
|
121
|
+
"Content-Type": "application/json",
|
|
122
|
+
"headers": {
|
|
123
|
+
Authorization: `Bearer ${this.salesforce_rest_api.$auth.oauth_access_token}`,
|
|
124
|
+
},
|
|
125
|
+
"data": {
|
|
126
|
+
ActualCost: this.ActualCost,
|
|
127
|
+
BudgetedCost: this.BudgetedCost,
|
|
128
|
+
CampaignImageId: this.CampaignImageId,
|
|
129
|
+
CampaignMemberRecordTypeId: this.CampaignMemberRecordTypeId,
|
|
130
|
+
CurrencyIsoCode: this.CurrencyIsoCode,
|
|
131
|
+
Description: this.Description,
|
|
132
|
+
EndDate: this.EndDate,
|
|
133
|
+
ExpectedResponse: this.ExpectedResponse,
|
|
134
|
+
ExpectedRevenue: this.ExpectedRevenue,
|
|
135
|
+
IsActive: this.IsActive,
|
|
136
|
+
Name: this.Name,
|
|
137
|
+
NumberSent: this.NumberSent,
|
|
138
|
+
OwnerId: this.OwnerId,
|
|
139
|
+
ParentCampaign: this.ParentCampaign,
|
|
140
|
+
ParentId: this.ParentId,
|
|
141
|
+
RecordTypeId: this.RecordTypeId,
|
|
142
|
+
StartDate: this.StartDate,
|
|
143
|
+
Status: this.Status,
|
|
144
|
+
Type: this.Type,
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
},
|
|
148
|
+
};
|