Skip to content

This endpoint allows you to upload a content file to be referenced by a component.

Once uploaded, Vault stores the file in a generic files staging area where they will remain until referenced by a component. Once referenced, Vault cannot access the named file from the staging area.

POST/api/mdl/files
NameDescription
Content-Typemultipart/form-data (default) or application/x-www-form-urlencoded
Acceptapplication/json (default) or application/xml
curl -X POST -H "Authorization: {SESSION_ID}" \ -H "Content-Type: multipart/form-data" \ -F 'file=@C:\Quote.pdf' https://myvault.veevavault.com/api/mdl/files
{ "responseStatus": "SUCCESS", "data": { "name__v": "4be398c32fc2ccf48adaf6ebe53782a1", "format__v": "application/pdf", "size__v": 4716, "sha1_checksum__v": "4be398c32fc2ccf48adaf6ebe53782a1" } }

Example Body: Reference Named File

Section link for Example Body: Reference Named File
RECREATE Formattedoutput my_formatted_output__c ( label(‘My Formatted Output’), active(true), root_object('Object.product__v'), root_object_type('Objecttype.product__v.base__v'), output_type('native'), template('4be398c32fc2ccf48adaf6ebe53782a1') );

On SUCCESS, the response includes the following:

NameDescription
name__vThe name of the file which can be used in MDL for referencing the component.
format__vThe format of the file.
size__vThe file size of the file.
sha1_checksum__vThe SHA-1 checksum value generated for the file. Use the checksum to ensure the file was transmitted correctly.

After uploading a content file, you can reference the file by name using the file or template attributes in your MDL statement. This example uses the template attribute.

To change a component file, you must first upload it and update the component to reference the new file.