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.classify(
document={
"id": "id",
"file_name": "fileName",
},
label_schemas=[{
"label": "label"
}],
)
print(response.async_result_id){
"asyncResultId": "<string>"
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"details": {}
}{
"error": "<string>"
}{
"error": "<string>"
}Document
Classify document (async)
Initiates an asynchronous document classification process based on provided schemas. Returns an ID to track the async result.
POST
/
api
/
v2
/
documents
/
classify
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.classify(
document={
"id": "id",
"file_name": "fileName",
},
label_schemas=[{
"label": "label"
}],
)
print(response.async_result_id){
"asyncResultId": "<string>"
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"details": {}
}{
"error": "<string>"
}{
"error": "<string>"
}Body
application/json
The document to be classified.
Show child attributes
Show child attributes
An array of label schemas to classify against.
Show child attributes
Show child attributes
Priority of the classification job. Use 'background' for non-interactive, lower-priority jobs.
Available options:
interactive, background Return terminal document processing failures as results.
Response
Accepted. Document classification process initiated.
The ID to track the asynchronous classification task.