Search code examples
amazon-web-servicesamazon-workdocs

Amazon WorkDocs - API for document download


With the Amazon WorkDocs API [1] I can list folders and files, create and delete folders, upload and delete files. But it seems there is no way to download a file.

The GetDocument API [2] returns a JSON document which includes a 'DownloadUrl' element but it is always 'null'. Also this 'DownloadUrl' element is not exposed in the SDK. I'm using the C++ SDK.

Is this by design?

[1] https://docs.aws.amazon.com/workdocs/latest/APIReference/Welcome.html

[2] https://docs.aws.amazon.com/workdocs/latest/APIReference/API_GetDocument.html


Solution

  • Here is an example of how to download a document from Amazon WorkDocs using the API. This example is implemented in Java; however, it shows you how to perform this task. As you see, an URL object plays a role in downloading the document.

    https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/javav2/example_code/workdocs/src/main/java/com/example/workdocs/DownloadUserDoc.java