File basics
Learn about the files resource.
Last updated
Learn about the files resource.
Last updated
The Files resource represents a customer-related document that is hosted on Digital River's servers. You can use the Files API to upload, retrieve, search for, download, and delete files.
Every File object contains a unique identifier, which you can use to download a file for internal use or create a publicly-accessible link to a document.
To upload a customer's tax documents to our servers, define a file and then submit a create file request.
When defining a file, you're only required to designate a file and its purpose. Providing a name and title, along with specifying a link expiration time, are optional values.
In the request, file
should adhere to the RFC 2388 specification, which defines file transfers for the multipart/form-data protocol.
The purpose
parameter should describe the function of the file.
If you're providing Digital River with a customer's tax document, set purpose
to tax_document_customer_upload
. For details, refer to on the page.
In the request, you have the option of sending a fileName
that is suitable for saving to a filesystem as well as a user-friendly title
for the document.
If you provide a linkExpiresTime
, make sure the value adheres to the used in the Digital River APIs.
In your POST /files
requests, set the Content-Type
header to multipart/form-data
:
A 201 Created
response returns a File object:
You can use id
to retrieve, search for, and delete files. You'll also need it to create a file link to share with customers.
Files may contain an array of publicly accessible file links. If no links have been generated, however, then links[]
does not exist.
A file's size
is represented in bytes, and its type
signifies a format (e.g. pdf, jpg, or png).
The url
allows you to download a file for internal use.
Once a file is created, you can download it for internal use or create a publicly accessible link.
A request sent with the wrong key returns a 401 Unauthorized
response status code.
As a result, don't share url
with your customers. Create a public link if you'd like to provide them access to a document.
To share files with customers, create a file link.
You can use url
to download a document for internal use. But to get the file's content, you must provide your .