private static String GetDownloadDocumentURL(AmazonWorkDocsClient workDocs, String docId, String versionId) { GetDocumentVersionRequest request = new GetDocumentVersionRequest() { DocumentId = docId, VersionId = versionId, Fields = "SOURCE" }; var result = workDocs.GetDocumentVersion(request); return result.Metadata.Source[DocumentSourceType.ORIGINAL]; }
private async Task <Stream> GetDocumentVersionStreamAsync(String documentId, String versionId) { GetDocumentVersionRequest getDocumentVersionRequest = new GetDocumentVersionRequest() { DocumentId = documentId, VersionId = versionId, Fields = "SOURCE", AuthenticationToken = authenticationToken }; GetDocumentVersionResponse response = await client.GetDocumentVersionAsync(getDocumentVersionRequest).ConfigureAwait(false); String downloadUrl = response.Metadata.Source[DocumentSourceType.ORIGINAL.Value]; return(await httpClient.GetStreamAsync(downloadUrl).ConfigureAwait(false)); }