File Upload Overview
To add versions to Attachments or renditions to Digital Assets in Aprimo, follow these steps:
- Upload the file using file upload routes.
- Use the file's unique identifier and name to create digital asset renditions or attachment versions.
Uploading Files
Endpoints
- Digital Assets:
/api/chunk/uploadand/api/chunk/complete - Attachments:
/api/chunk/upload/attachmentand/api/chunk/complete/attachment
Chunking (Optional)
- Recommended for large files (max upload size per call: 20MB).
- Steps:
- Split the file into chunks.
- Upload chunks to the server.
- Compile chunks using
POST api/chunk/complete.
Uploading File Chunks
Parameters
resumableFilename: Name of the file.resumableChunkNumber: Order of the chunk (starting at 1).resumableIdentifier: A unique GUID for the upload.file: The file chunk content.
Steps
- Generate a GUID for
resumableIdentifier. - For each chunk:
- Check if the chunk exists:
CallGET api/chunk/upload(or/attachmentfor attachments).200 OK: Chunk already exists.404: Chunk does not exist.
- Upload the chunk:
CallPOST api/chunk/uploadwith the required parameters and chunk content.200 OK: Chunk uploaded successfully.
- Check if the chunk exists:
- Repeat until all chunks are uploaded.
Combining File Chunks
- Call
POST api/chunk/complete(or/attachmentfor attachments). - Pass the following JSON body:
{
"FileId": "yourGeneratedGuid",
"FileName": "yourFilename"
}
- Ensure
FileNamematchesresumableFilenameandFileIdmatchesresumableIdentifier.
tip
Uploaded files are available for 8 hours. After associating with an attachment version or digital asset rendition, files are permanently stored.
Creating New Versions or Renditions
- Example: New Attachment Version
{
"isDefaultVersion": true,
"attachmentId": 1101,
"FileId": "c4669d54-4335-4d77-acca-67ed4d3142ff",
"FileName": "SampleFileChunk.txt",
"versionComments": "Original Version",
"versionType": 3
}
- Example: Internet File Version
- Use the route
/api/attachments/{{attachmentID}}/versionsand this JSON body:
{
"isDefaultVersion": true,
"attachmentId": 1101,
"filename": "myNewFile",
"downloadUri": "http://www.downloadLink.com",
"thumbnailStatus": 3,
"versionType": 1,
"annotationFileType": 0,
"versionComments": "New Internet File version via API",
"sendNotification": 0,
"versionUrl": "http://www.downloadLink.com",
"fileID": "0c62463e-6730-45d0-8701-e2ad273b52b7"
} - Use the route
Retrieving Attachments
- Get the attachment and version IDs.
- Call:
GET https://{domain}.aprimo.com/api/attachments/{attachmentId}/versions/{versionId}- The response includes a
downloadUriattribute.
- The response includes a
- Use
downloadUrito retrieve the file:- Open in a browser with an active session, or
- Perform a GET request with your authorization token.