rforcecom.insertBulkAttachments: Insert Attachments via Bulk API Job

Description Usage Arguments Value References Examples

View source: R/rforcecom.insertBulkAttachments.R

Description

This function takes a file path to a structured .zip file of attachments and submits it to an already existing Bulk API Job

Usage

1

Arguments

session

a named character vector defining parameters of the api connection as returned by rforcecom.login

jobId

a character string defining the salesforce id assigned to a submitted job as returned by rforcecom.createBulkJob

file

a file path to a .zip file containing request.txt manifest formatted as CSV and any binary attachments. It should have request.txt in the top-level (aka base) directory. Attachment files can be in subdirectories if desired. See Salesforce documentation for details on how to format the .zip file.

Value

A list of parameters defining the created batch

References

https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 

# sample .zip directory structure
request.zip
  request.txt
  attachment1.gif
  subdir/
    attachment2.doc
    
# sample format of request.txt
Name,ParentId,Body
attachment1.gif,TheTargetRecordIdHere,#attachment1.gif
subdir/attachment2.doc,TheTargetRecordIdHere,#subdir/attachment2.doc

f <- 'request.zip'
batch_attachment_info <- rforcecom.insertBulkAttachments(session, jobId=job_info$id, file=f)

## End(Not run)

RForcecom documentation built on May 1, 2019, 6:31 p.m.