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.communication.send_letter(
document={
"id": "id",
"file_name": "fileName",
},
to_address={
"address": {
"city": "city",
"state": "state",
"street_lines": ["string"],
"zip_code": "zipCode",
},
"name": "name",
},
)
print(response.tracking_id){
"trackingId": "<string>"
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"details": {}
}{
"error": "<string>"
}{
"error": "<string>"
}Communication
Send a letter
Sends a physical letter. The document must be a PDF file. Returns an ID for tracking.
POST
/
api
/
v2
/
communication
/
letters
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.communication.send_letter(
document={
"id": "id",
"file_name": "fileName",
},
to_address={
"address": {
"city": "city",
"state": "state",
"street_lines": ["string"],
"zip_code": "zipCode",
},
"name": "name",
},
)
print(response.tracking_id){
"trackingId": "<string>"
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"details": {}
}{
"error": "<string>"
}{
"error": "<string>"
}Headers
A unique identifier for the request. If the same request is sent with the same idempotency key, it will be ignored.
Body
application/json
The document to send
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Whether to print the letter in color. Defaults to black and white.
Optional sender address (defaults to Sample Healthcare)
Show child attributes
Show child attributes
Optional metadata to include with the letter
Show child attributes
Show child attributes
Response
Letter sent successfully
The letter ID for tracking the mail delivery