API Tester Sandbox
The MIDATA API Debugger allows you to test login and queries for your app, plugin or service. To use the API debugger please log in as developer, visit the ovewrview page of an application you have registered and click on “API Tester Sandbox”.
OAuth2 login test
Click on the “log in” button on the sandbox page to try out the login with your application. You will be shown the login page like it would look using your app. After finishing the login you will be brought back to the API tester with a valid session. (authorization token and refresh token)
Please keep in mind:
- There can by only one session running per app, user and device. So if you log in twice you terminate the first session.
- To the right of the log in button is a Device input field. Change the default content “debug” to something different (at least 4 characters long) to simulate login from another device.
- One user may use one app from at most 10 distinct devices. If you have reached this limit during testing log in as the test user on the portal, go to the “Apps” page and delete some consents with your app.
- You need to have a valid redirectURI specified to test the login although it will not be used during the login test.
Testing requests
For testing requests you may select
- The FHIR version to be used. The “Accept” and “Content-Type” headers of the requests will be changed according to the selected FHIR version.
- The HTTP request method GET, POST, PUT, DELETE. - If you select POST or PUT you may also specifiy a JSON request body to be send with the request.
- The URL for the request. The servers domain will automatically be prepended. All URLs must start with a “/”.
Click on “submit” in order to send the request to the server and display the answer.
Each request will be send with these headers:
Authorization : Bearer ....
if you used the login function before.
Accept : application/fhir+json; fhirVersion=4.0
Content-Type: application/fhir+json; fhirVersion=4.0
Content-Type is only send for POST and PUT requests.
Prefer : return=representation
for more complete FHIR results.
Login with plugin
You can also test requests as if they were send by a plugin created by you.
- From the overview page of your plugin click on API Tester Sandbox
- You need to know the credentials of a test user (Account Holder, Practitioner or Researcher) that has already used the plugin
- Enter username and password of the test user into the input fields and click the login button for a session.
- It will only work if the test user already used an instance of that plugin.
After login you can test requests with the same access rights as your plugin.