Signature

global static List<Attachment> createAttachments(
  List<Types.CreateAttachmentInput> attachmentInputs,
  String library,
  String runAs
)
Parameters
ParameterDescription
attachmentInputs requiredOne entry per attachment. See Types.CreateAttachmentInput.
library
String
requiredType of library. Example — sharepoint. You can get this value from the Content Library.
runAs
String
optionalEmail Id of the user on whose behalf the function should run. To run the action as the automation user, supply integrationUser.

Return Type

Example

List<cldfs.Types.CreateAttachmentInput> inputs = new List<cldfs.Types.CreateAttachmentInput>{
    new cldfs.Types.CreateAttachmentInput(<folder id>, 'folder', <salesforce record id>, 'b!ZfA15HRS1Uy9pH3Vw5tFjAHfP1lRYlZAvDwLnHYYq8sa-L6ejXB-TJbMYUxi1QfL')
};
List<cldfs.Attachment> attachments = cldfs.Client.createAttachments(
   inputs,
  'sharepoint',
  'integrationUser'
);