Class ObjectRecordAttachmentFieldRequest
java.lang.Object
com.veeva.vault.vapil.api.request.VaultRequest<ObjectRecordAttachmentFieldRequest>
com.veeva.vault.vapil.api.request.ObjectRecordAttachmentFieldRequest
public class ObjectRecordAttachmentFieldRequest
extends VaultRequest<ObjectRecordAttachmentFieldRequest>
Object Record Attachment Field requests
- Vault API Coverage:
- https://developer.veevavault.com/api/25.1/#attachment-fields
-
Field Summary
Fields inherited from class com.veeva.vault.vapil.api.request.VaultRequest
HTTP_HEADER_AUTHORIZATION, HTTP_HEADER_REFERENCE_ID, HTTP_HEADER_VAULT_CLIENT_ID, referenceId, requestClientId, vaultClient
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondownloadAllAttachmentFieldFiles
(String objectName, String recordId) Download All Attachment Field FilesdownloadAttachmentFieldFile
(String objectName, String recordId, String attachmentFieldName) Download Attachment Field FilesetBinaryFile
(String filename, byte[] binaryContent) Specify source data in an input filesetInputPath
(String inputPath) Specify source data in an input filesetOutputPath
(String outputPath) Specify source data in an output fileupdateAttachmentFieldFile
(String objectName, String recordId, String attachmentFieldName) Update Attachment Field FileMethods inherited from class com.veeva.vault.vapil.api.request.VaultRequest
getBaseObjectMapper, send, send, sendReturnBinary, sendReturnBinary, sendToFile, sendToFile, setHeaderClientId, setHeaderReferenceId, setVaultClient
-
Constructor Details
-
ObjectRecordAttachmentFieldRequest
public ObjectRecordAttachmentFieldRequest()
-
-
Method Details
-
downloadAttachmentFieldFile
public VaultResponse downloadAttachmentFieldFile(String objectName, String recordId, String attachmentFieldName) Download Attachment Field FileDownload the specified Attachment field file from an object record.
- Parameters:
objectName
- The object name__v field valuerecordId
- The object record id field valueattachmentFieldName
- The name of the Attachment field from which to retrieve the file- Returns:
- VaultResponse
- Vault API Endpoint:
GET /api/{version}/vobjects/{object_name}/{object_record_id}/attachment_fields/{attachment_field_name}/file
- Vault API Help Link:
- https://developer.veevavault.com/api/25.1/#download-attachment-field-file
- Example Request:
Example 1 - Download Binary Content VaultResponse response = vaultClient.newRequest(ObjectRecordAttachmentFieldRequest.class) .downloadAttachmentFieldFile(objectName, recordId, attachmentFieldName); Example 2 - Download to File VaultResponse response = vaultClient.newRequest(ObjectRecordAttachmentFieldRequest.class) .setOutputPath(outputPath) .downloadAttachmentFieldFile(objectName, recordId, attachmentFieldName);
- Example Response:
System.out.println("Content-Type: " + response.getHeaderContentType()); System.out.println("Content-Disposition: " + response.getHttpHeaderContentDisposition());
-
updateAttachmentFieldFile
public ObjectRecordBulkResponse updateAttachmentFieldFile(String objectName, String recordId, String attachmentFieldName) Update Attachment Field File
Update an Attachment field by uploading a file. If you need to update more than one Attachment field, it is best practice to update in bulk with Update Object Records.
- Parameters:
objectName
- The object name__v field valuerecordId
- The object record id field valueattachmentFieldName
- The name of the Attachment field to update- Returns:
- ObjectRecordBulkResponse
- Vault API Endpoint:
POST /api/{version}/vobjects/{object_name}/{object_record_id}/attachment_fields/{attachment_field_name}/file
- Vault API Help Link:
- https://developer.veevavault.com/api/25.1/#update-attachment-field-file
- Example Request:
Example 1 - Upload from input path ObjectRecordBulkResponse response = vaultClient.newRequest(ObjectRecordAttachmentFieldRequest.class) .setInputPath(inputPath) .updateAttachmentFieldFile(objectName, recordId, attachmentFieldName); Example 2 - Upload bytes ObjectRecordBulkResponse response = vaultClient.newRequest(ObjectRecordAttachmentFieldRequest.class) .setBinaryFile("test_binary_file.txt", bytesArray) .updateAttachmentFieldFile(objectName, recordId, attachmentFieldName);
- Example Response:
for (ObjectRecordResponse objectRecordResponse : response.getData()) { System.out.println("Response Status: " + objectRecordResponse.getResponseStatus()); System.out.println("Record ID: " + objectRecordResponse.getData().getId()); System.out.println("Record URL: " + objectRecordResponse.getData().getUrl()); }
-
downloadAllAttachmentFieldFiles
Download All Attachment Field FilesDownload all Attachment field files from the specified object record.
- Parameters:
objectName
- The object name__v field valuerecordId
- The object record id field value- Returns:
- VaultResponse
- Vault API Endpoint:
GET /api/{version}/vobjects/{object_name}/{object_record_id}/attachment_fields/file
- Vault API Help Link:
- https://developer.veevavault.com/api/25.1/#download-all-attachment-field-files
- Example Request:
Example 1 - Download Binary Content VaultResponse response = vaultClient.newRequest(ObjectRecordAttachmentFieldRequest.class) .downloadAllAttachmentFieldFiles(objectName, recordId); Example 2 - Download to File VaultResponse response = vaultClient.newRequest(ObjectRecordAttachmentFieldRequest.class) .setOutputPath(outputPath) .downloadAllAttachmentFieldFiles(objectName, recordId);
- Example Response:
System.out.println("Content-Type: " + response.getHeaderContentType()); System.out.println("Content-Disposition: " + response.getHttpHeaderContentDisposition());
-
setBinaryFile
Specify source data in an input file- Parameters:
filename
- file name (no path)binaryContent
- byte array of the file content- Returns:
- The Request
-
setInputPath
Specify source data in an input file- Parameters:
inputPath
- Absolute path to the file for the request- Returns:
- The Request
-
setOutputPath
Specify source data in an output file- Parameters:
outputPath
- Absolute path to the file for the response- Returns:
- The Request
-