0% found this document useful (0 votes)
48 views3 pages

BMLab API V0.2

This document summarizes the BMLab API endpoints for creating, editing, deleting, and retrieving analysis requests and patient data. It describes the JSON request bodies for analysis requests and patients. It also outlines the OAuth 2.0 authorization scheme, including obtaining an access token by making a POST request to the /TOKEN endpoint with username and password.

Uploaded by

Berkani Mohamed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views3 pages

BMLab API V0.2

This document summarizes the BMLab API endpoints for creating, editing, deleting, and retrieving analysis requests and patient data. It describes the JSON request bodies for analysis requests and patients. It also outlines the OAuth 2.0 authorization scheme, including obtaining an access token by making a POST request to the /TOKEN endpoint with username and password.

Uploaded by

Berkani Mohamed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

BMLab API

Endpoints

POST /analysisRequest
Create a new analysis request described in a JSON parameter

POST /analysisRequest/{analysisRequestId}/actions/edit
Edit an existing analysis request that has the ID {analysisRequestId} with new values described in JSON
parameter

DELETE /analysisrequest/{analysisRequestId}
Delete an existing analysis request that has the ID {analysisRequestId}

GET /analysisRequest/{analysisRequestId}/actions/preview
Preview an existing analysis request that has the ID {analysisRequestId}, this will return JSON that
contains base64 PDF

GET /analysisRequest/{analysisRequestId}/actions/state
Get the state existing analysis request that has the ID {analysisRequestId}

POST /Patient/{patientId}/actions/edit
Edit an existing patient that has the ID {patientId} with new values described in JSON parameter

GET /AnalysisRequest/{analysisRequestId}/ResultServer
get user and password to access result server

Parameters
Analysis Request JSON body:

{
Id : String //system source ID
RequestedDate: String //with format “yyyy-MM-ddTHH:mm:SS”
Remarks: String
AnalysisTypes: Array<String> //array of strings that represent
the codes of requested Analysis Types
Patient : Patient //described in json below
MoreInfo: Dictionary<string, string> // pass other information as
dictionary
}
Patient JSON body:
{
Id: string //system source ID
FirstName: string
LastName: String
BirthDate: string // “yyyy-MM-ddTHH:mm:SS”
Sexe : string // “M” or “F”
PhoneNumber: String
MoreInfo: Dictionary<string, string> // pass other information as
dictionary for example {"PatientEmail":"[email protected]"}

Authorization & authentication


BMLab API scheme of authorization is OAuth 2.0 which is a token-based authorization scheme.

To get the access token you can use this token:

POST => /TOKEN

With headers:
Content-Type: application/x-www-form-urlencoded
And body request
System: BMlabAPI
body(x-www-form-urlencoded):
grant_type: password
username: /*your username*/
password: /*your password*/

which will return the following response, (example from Mozilla).


Then access token is provided as "Authorization" header with "Bearer access_token" scheme in order to
call the REST Web API:

You might also like