Downloading a file

Learn how to download a file.

Easy access to files is essential for seamless operations. Whether you're handling important documents, images, or software packages, having a straightforward method to download files can significantly enhance efficiency. The Commerce API offers a simple yet powerful endpoint that allows users to download files securely and efficiently. Using the GET /files/{fileId}/content request, where you replace {fileId} with the actual identifier of the file you wish to download, you can retrieve the content of a specific file by its unique identifier. This guide will walk you through the steps to use a cURL command to download a file using your API key and site ID, ensuring a smooth and secure file transfer process.

Here's an example CURL command to achieve this:

curl --location --request GET 'https://api.digitalriver.com/files/{fileId}/content' \
--header 'authorization: Basic YOUR_API_KEY' \
--header 'x-siteid: YOUR_SITE_ID'

Be sure to replace YOUR_API_KEY with your actual API key and YOUR_SITE_ID with your site ID. Also, replace {fileId} with the specific file ID you are trying to download.

Refer to the Downloading the invoice section for more detailed information.

Last updated