Customer Documents
Create
Section titled “Create”An example of a customer document is a photo of a symptom that a patient takes before an appointment. Please store the id that gets returned. You’ll be able to use it when you create the appointment.
HTTP Request
Section titled “HTTP Request”To create a customer document, make a request to:
POST {server_url}/api/v2/patients/{patient_id}/documents
Headers
Section titled “Headers”| Parameter | Default |
|---|---|
| Authorization | Bearer {jwt_token} |
| Accept | application/json |
| Content-type | application/json |
This request must include a valid User JWT token, please see our documentation.
URL Parameters
Section titled “URL Parameters”The following parameters need to be included in the URL of the request:
| Attribute | Required | Description |
|---|---|---|
| patient_id | true | MD Live ID for patient |
Request Body Parameters
Section titled “Request Body Parameters”The following parameters need to be included in the body of the request:
| Attribute | Required | Description |
|---|---|---|
| doc | true | Parent attribute for customer documents |
| ↳ document_name | true | Desired filename |
| ↳ data | true | Base64 encoded file data |
| ↳ mime_type | true | Mime type, e.g. image/png |
| ↳ record_type | true | One of the following values:
|
Example Request
Section titled “Example Request”curl -v -X POST {server_url}/api/v2/patients/{patient_id}/documents \ -H 'Authorization: Bearer {jwt_token}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -d '{ "doc": { "document_name": "INSERT_DOCUMENT_NAME_WITH_EXTENSION_HERE", "data": "INSERT_BASE64_ENCODED_DATA_HERE", "mime_type": "INSERT_MIME_TYPE_HERE", "record_type": "Patient Record" } }'RestClient::Request.new( :method => :post, :url => '{server_url}/api/v2/patients/{patient_id}/documents', :headers => { 'Authorization' => 'Bearer {jwt_token}', 'Content-type' => 'application/json', 'Accept' => 'application/json', }, :payload => { :doc => { :document_name => 'INSERT_DOCUMENT_NAME_WITH_EXTENSION_HERE', :data => 'INSERT_BASE64_ENCODED_DATA_HERE', :mime_type => 'INSERT_MIME_TYPE_HERE', :record_type => 'Patient Record' } }).executeExample Response
Section titled “Example Response”{ "doc":{ "id":1, "mime_type":"image/png", "record_type":"Patient Record", "upload_date":"2018-01-16T20:51:06+00:00", "document_name":"DOGE.png", "upload_by":"test patient", "extension":"png" }}Delete
Section titled “Delete”HTTP Request
Section titled “HTTP Request”To remove a customer document, make a request to:
DELETE {server_url}/api/v1/patients/{patient_id}/documents/{document_id}
Headers
Section titled “Headers”| Parameter | Default |
|---|---|
| Authorization | Bearer {jwt_token} |
| Content-type | application/json |
This request must include a valid User JWT token, please see our documentation.
URL Parameters
Section titled “URL Parameters”The following parameters need to be included in the URL of the request:
| Attribute | Required | Description |
|---|---|---|
| patient_id | true | MD Live ID for patient |
| document_id | true | MD Live ID for patient |
Example Request
Section titled “Example Request”curl -v -X DELETE {server_url}/api/v1/patients/{patient_id}/documents/{document_id} \ -H 'Authorization: Bearer {jwt_token}' \ -H 'Content-Type: application/json'RestClient::Request.new( :method => :delete, :url => '{server_url}/api/v1/patients/{patient_id}/documents/{document_id}', :headers => { 'Authorization' => 'Bearer {jwt_token}', 'Content-type' => 'application/json' }).executeHTTP Request
Section titled “HTTP Request”To retrieve the list of a patient’s current list of documents, make a request to:
GET {server_url}/api/v1/patients/{patient_id}/documents
Headers
Section titled “Headers”| Parameter | Default |
|---|---|
| Authorization | Bearer {jwt_token} |
| Accept | application/json |
| Content-type | application/json |
This request must include a valid User JWT token, please see our documentation.
URL Parameters
Section titled “URL Parameters”The following parameters need to be included in the URL of the request:
| Attribute | Required | Description |
|---|---|---|
| patient_id | true | MD Live ID for patient |
Example Request
Section titled “Example Request”curl -X GET {server_url}/api/v1/patients/{patient_id}/documents \ -H 'Authorization: Bearer {jwt_token}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json'RestClient::Request.new( :method => :get, :url => '{server_url}/api/v1/patients/{patient_id}/documents', :headers => { 'Authorization' => 'Bearer {jwt_token}', 'Content-type' => 'application/json', 'Accept' => 'application/json' }).executeExample Response
Section titled “Example Response”{ "documents":[ { "id":1, "mime_type":"image/png", "record_type":"Patient Record", "upload_date":"2018-01-16T20:51:06+00:00", "document_name":"DOGE.png", "upload_by":"test patient", "extension":"png", "thumbnail":"iVBORw0KGgoAAAANSUhEUgAAAG4AAABuAQAAAADuIBtWAAAABGdBTUEAALGP\nC/xhBQAAAAJiS0dEAAHdihOkAAAAB3RJTUUH4gEQCjcT4w8KOgAAABVJREFU\nOMtjYBgFo2AUjIJRMAroAQAGcgABdoTxvAAAACV0RVh0ZGF0ZTpjcmVhdGUA\nMjAxOC0wMS0xNlQxNTo1NToxOS0wNTowMG8EODEAAAAldEVYdGRhdGU6bW9k\naWZ5ADIwMTgtMDEtMTZUMTU6NTU6MTktMDU6MDAeWYCNAAAAAElFTkSuQmCC\n" } ]}HTTP Request
Section titled “HTTP Request”To retrieve a specific document, make a request to:
GET {server_url}/api/v1/patients/{patient_id}/documents/{document_id}
Headers
Section titled “Headers”| Parameter | Default |
|---|---|
| Authorization | Bearer {jwt_token} |
| Accept | application/json |
| Content-type | application/json |
This request must include a valid User JWT token, please see our documentation.
URL Parameters
Section titled “URL Parameters”The following parameters need to be included in the URL of the request:
| Attribute | Required | Description |
|---|---|---|
| patient_id | true | MD Live ID for patient |
| document_id | true | MD Live ID for document |
Example Request
Section titled “Example Request”curl -X GET {server_url}/api/v1/patients/{patient_id}/documents/{document_id} \ -H 'Authorization: Bearer {jwt_token}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json'RestClient::Request.new( :method => :get, :url => '{server_url}/api/v1/patients/{patient_id}/documents/{document_id}', :headers => { 'Authorization' => 'Bearer {jwt_token}', 'Content-type' => 'application/json', 'Accept' => 'application/json' }).executeExample Response
Section titled “Example Response”{ "id":1, "mime_type":"image/png", "record_type":"Patient Record", "upload_date":"2018-01-16T20:51:06+00:00", "document_name":"DOGE.png", "upload_by":"test patient", "extension":"png", "thumbnail":"iVBORw0KGgoAAAANSUhEUgAAAG4AAABuAQAAAADuIBtWAAAABGdBTUEAALGP\nC/xhBQAAAAJiS0dEAAHdihOkAAAAB3RJTUUH4gEQCjcT4w8KOgAAABVJREFU\nOMtjYBgFo2AUjIJRMAroAQAGcgABdoTxvAAAACV0RVh0ZGF0ZTpjcmVhdGUA\nMjAxOC0wMS0xNlQxNTo1NToxOS0wNTowMG8EODEAAAAldEVYdGRhdGU6bW9k\naWZ5ADIwMTgtMDEtMTZUMTU6NTU6MTktMDU6MDAeWYCNAAAAAElFTkSuQmCC\n"}