Skip to content

Lab results

Add the member’s lab results to the request and Sunny faxes them to the office that books the visit, and to no other office.

"visit": {
"reason": "Follow-up on thyroid lab results",
"lab_results_files": [
{ "filename": "results.pdf", "content_type": "application/pdf", "data": "<base64>" }
]
}
Rule Limit Error
Files Up to 5. 422 invalid_field
Type application/pdf, image/jpeg or image/png. The bytes must match the stated type. 422 unsupported_file_type
Size 10 MB per file and 25 MB in total, decoded. 413 file_too_large
Pages 50 in total. An image counts as one page. 422 invalid_field
Readable Every file must open, and a PDF must not be password-protected. 422 invalid_field

A file that breaks a rule rejects the whole request, with the field named in the error.

Keep the total under 20 MB. A larger set is accepted but cannot be faxed in one piece, and is reported as failed.

  • Nothing is sent until an office has booked the visit.
  • The files arrive as one fax, in the order you sent them, behind a cover sheet.
  • If the office says it does not need them, or asks that the patient bring them, nothing is sent.
  • A fax line that is busy or does not answer is tried again, in the office’s opening hours.

document_delivery on the request says where it stands:

status Meaning
none There is nothing to send, or nothing was sent. When nothing was sent, detail says why.
pending An office has booked and the results are waiting to be sent.
sent Handed to the fax line.
delivered The office’s fax machine confirmed receipt.
failed The results could not be delivered. The appointment is unaffected.

A delivery that succeeds sends no webhook: read it from the request. One that fails sends request.document_delivery_failed.

  • The request never returns a file’s bytes: only its name, type and size.
  • A filename is kept for display, cleaned to letters, digits, dot, dash and underscore.
  • Nothing is resent after a reschedule.
  • In the sandbox, files are checked and then discarded. Nothing is faxed.