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.templates.generate_document_async(
slug="slug",
type="document",
)
print(response.async_result_id){
"asyncResultId": "<string>"
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"details": {}
}{
"error": "<string>"
}{
"error": "<string>"
}Document
Generate document from template (async)
Initiates an asynchronous process to generate a document from a template slug and relevant data (documentBody for document, variables for PDF). Returns an ID for tracking.
POST
/
api
/
v2
/
documents
/
templates
/
generate-document
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.templates.generate_document_async(
slug="slug",
type="document",
)
print(response.async_result_id){
"asyncResultId": "<string>"
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"details": {}
}{
"error": "<string>"
}{
"error": "<string>"
}Body
application/json
The request body, discriminated by the 'type' field ('document' or 'pdf').
Response
Default Response
The ID to track the asynchronous document generation task.