REST Console
Learn how to use REST Console to work with your Aidbox via REST API.
Last updated
Learn how to use REST Console to work with your Aidbox via REST API.
Last updated
REST Console is designed to work with your Aidbox via REST API. To make a request type an HTTP method (GET
, POST
, PUT
, PATCH
, DELETE
) and an operation endpoint (for example/Patient
— please pay attention to the capital letter in the resource name).
Right after the first line you can put HTTP headers. E.g. to use YAML format you can put the following header:
In case you need to send a request body (e.g., POST
requests), the request body content is passed below the resource address, separated by an empty line.
Here is an example of creating patient:
To get pretty-formatted response add _pretty=true
query string parameter:
After sending the request, we receive a response with Status - 201
and the sent data, which means that our patient has been created. Use the request GET /Patient/<id>
to see the newly created patient. Also the request GET /Patient
could be used to get the complete list of patients.
Next step is to update the patient information. For a partial update use PATCH /Patient/<id>
in the request body in order to send changed data only. For example, let's change the patient name.
UsePUT /Patient/<id>
to replace the resource.
In this case, we're updating the data entirely: data that did not get into the request body will be deleted.
Use GET /Patient/<id>/_history
to receive the version history of the patient resource.
Let's try this for the example patient.
The response contains all versions (in this case 3) of the patient resource. The first is the initial state of the resource, the second one has the name changed, and the third is an entirely updated resource.
To get a specific version of a resource use GET /Patient/<id>/_history/<versionId>
. It performs the vread operation.
As an example of using FHIR Search API use GET /Patient?name=<Patient_name>
to get all patient with matching names: