Knowledge Base
phiMail REST API Integration Message Example
EMR Direct's phiMail integration API makes it easy to deploy Direct Secure Messaging without standing up one's own Direct implementation or becoming DirectTrust accredited. The integration API includes a RESTful option as well as several example SDKs in a variety of application frameworks.
For those integrating the phiMail service into their health IT using the REST API, here is an example of what the JSON object to include in the command to send a Direct message with a text body and CCDA attachment using EMR Direct's phiMail Integrated service. The OutgoingMessage in the request body will contain up to 6 elements (3 are required and 3 are optional) according to the last page of the EMR Direct phiMail REST API documentation. An example of an OutgoingMessage object with a message body and an attached CCDA XML document would be:
{
"sender": "example@test.directproject.net",
"recipients": ["example2@test.directproject.net"],
"subject": "Test Subject Line",
"finalDeliveryNotification": true,
"messageParts": [{
"type": "text",
"dataString": "This is the body of the message"
},
{
"type": "xml",
"filename": "CCDA_example.xml",
"dataString": "
}
]
}
(The CCDA itself would be included as the value of the dataString element, replacing the series of "..."s in the above example.)
This message example happens to also request final delivery notification, which should be invoked when the sender needs to know whether a message was delivered to the other party within an hour.
Registered developers interested in receiving the REST API integration documentation should reach out to EMR Direct at support@emrdirect.com to obtain this documentation if it does not appear when signed in to the EMR Direct developer site.
Register for a complimentary EMR Direct Developer account to access phiMail and phiQuery integration documentation and sample code in a variety of application frameworks as well as REST.
Did this article answer your question? If not, please contact us.