Python
import os
from samplehc import SampleHealthcare
client = SampleHealthcare(
api_key=os.environ.get("SAMPLEHC_API_KEY"), # This is the default and can be omitted
)
response = client.v2.documents.presigned_upload_url(
file_name="fileName",
mime_type="application/zip",
)
print(response.id){
"id": "<string>",
"fileName": "<string>",
"pdfPageCount": 1,
"presignedUrl": "<string>",
"size": 123
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"details": {}
}{
"error": "<string>"
}Document
Presigned URL for upload
Generates a presigned URL that can be used to directly upload a file to storage. Returns the URL and document metadata.
POST
/
api
/
v2
/
documents
/
presigned-upload-url
Python
import os
from samplehc import SampleHealthcare
client = SampleHealthcare(
api_key=os.environ.get("SAMPLEHC_API_KEY"), # This is the default and can be omitted
)
response = client.v2.documents.presigned_upload_url(
file_name="fileName",
mime_type="application/zip",
)
print(response.id){
"id": "<string>",
"fileName": "<string>",
"pdfPageCount": 1,
"presignedUrl": "<string>",
"size": 123
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"details": {}
}{
"error": "<string>"
}Body
application/json
mimeType
Option 1 · enum<string>Option 2 · enum<string>Option 3 · enum<string>Option 4 · enum<string>Option 5 · enum<string>Option 6 · enum<string>Option 7 · enum<string>Option 8 · enum<string>Option 9 · enum<string>Option 10 · enum<string>Option 11 · enum<string>Option 12 · enum<string>Option 13 · enum<string>Option 14 · enum<string>Option 15 · enum<string>
required
The MIME type of the file to be uploaded.
Available options:
application/zip, application/x-zip-compressed, multipart/x-zip, application/x-compress The name of the file to be uploaded.
Response
Successfully generated presigned URL and initial document metadata.