/login endpoint, the access_token
will be automatically updated.For every successful request with a 200 or 201 response code, the response is formatted like this:
{
"success": true (boolean),
"data": (null or an object),
"message": (string)
}
For every failed request, the response is formatted like this:
{
"success": false (boolean),
"message": (string),
"data": (null or an object)
}
200 - OK
201 - OK
429 - Too much request, try again after 30 secs
401 - Unauthorized
422 - Unprocessed request due to invalid data
Accept set to application/jsonAuthorization set to Bearer {TOKEN} where requiredAPI: http://testdrive.kompletecare.com/api
GraphQL: http://testdrive.kompletecare.com/graphql
{URL} + '/login'POST{
'email' => 'required' (can be username, email or phone),
'password' => 'required'
}
{
"success": true,
"data": {
"token": "1|xxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"message": "Logged in successfully"
}
{URL} + '/investigations'GETAuthorization: Bearer {token}{
"message": "Unauthenticated."
}
{
"success": true,
"data": [
{
"id": 1,
"title": "X-Ray",
"investigations": [
{
"id": 1,
"investigation_type_id": 1,
"title": "Chest"
},
{
"id": 2,
"investigation_type_id": 1,
"title": "Cervical Vertebrae"
},
{
"id": 3,
"investigation_type_id": 1,
"title": "Thoracic Vertebrae"
},
{
"id": 4,
"investigation_type_id": 1,
"title": "Lumbar Vartebrae"
},
{
"id": 5,
"investigation_type_id": 1,
"title": "Lumbo Sacral Vertebrae"
},
{
"id": 6,
"investigation_type_id": 1,
"title": "Wrist Joint"
},
{
"id": 7,
"investigation_type_id": 1,
"title": "Ankle"
},
{
"id": 8,
"investigation_type_id": 1,
"title": "Fingers"
},
{
"id": 9,
"investigation_type_id": 1,
"title": "Toes"
}
]
},
{
"id": 2,
"title": "Ultrasound Scan",
"investigations": [
{
"id": 10,
"investigation_type_id": 2,
"title": "Breast"
},
{
"id": 11,
"investigation_type_id": 2,
"title": "Pelvis"
},
{
"id": 12,
"investigation_type_id": 2,
"title": "Prostate"
},
{
"id": 13,
"investigation_type_id": 2,
"title": "Thyroid"
}
]
}
],
"message": "Records retrieved successfully"
}
{URL} + '/investigations'POSTAuthorization: Bearer {token}{
"message": "Unauthenticated."
}
{
'investigations' => 'required|array',
'ctscan' => 'required',
'mri' => 'required',
'developer' => 'required'
}
Note: investigations is an array of Laboratory Investigation IDs retrieved using the Get Medical Categories endpoint in this format [1, 5, 39, 2]
{
"success": true,
"data": {
"patient": {
"id": 1,
"name": "KompleteCare User",
"email": "[email protected]"
},
"ctscan": "Scan Needed In The Left Cerebral Hemisphere",
"mri": "Full Body MRI",
"created_at": "2022-05-29T22:50:34.000000Z"
},
"message": "Record saved successfully"
}
URL: http://test.kompletecare.com/graphql
Method: POST
mutation {
login(email:"[email protected]", password:"password")
}
{
"data": {
"login": "1|xxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
Authorization: Bearer {token}{
investigations {
id
title
type {
id
title
}
}
}
{
"data": {
"investigations": [
{
"id": "1",
"title": "Chest",
"type": {
"id": "1",
"title": "X-Ray"
}
},
{
"id": "2",
"title": "Cervical Vertebrae",
"type": {
"id": "1",
"title": "X-Ray"
}
},
{
"id": "3",
"title": "Thoracic Vertebrae",
"type": {
"id": "1",
"title": "X-Ray"
}
},
{
"id": "4",
"title": "Lumbar Vartebrae",
"type": {
"id": "1",
"title": "X-Ray"
}
},
{
"id": "5",
"title": "Lumbo Sacral Vertebrae",
"type": {
"id": "1",
"title": "X-Ray"
}
},
{
"id": "6",
"title": "Wrist Joint",
"type": {
"id": "1",
"title": "X-Ray"
}
},
{
"id": "7",
"title": "Ankle",
"type": {
"id": "1",
"title": "X-Ray"
}
},
{
"id": "8",
"title": "Fingers",
"type": {
"id": "1",
"title": "X-Ray"
}
},
{
"id": "9",
"title": "Toes",
"type": {
"id": "1",
"title": "X-Ray"
}
},
{
"id": "10",
"title": "Breast",
"type": {
"id": "2",
"title": "Ultrasound Scan"
}
},
{
"id": "11",
"title": "Pelvis",
"type": {
"id": "2",
"title": "Ultrasound Scan"
}
},
{
"id": "12",
"title": "Prostate",
"type": {
"id": "2",
"title": "Ultrasound Scan"
}
},
{
"id": "13",
"title": "Thyroid",
"type": {
"id": "2",
"title": "Ultrasound Scan"
}
}
]
}
}
Authorization: Bearer {token}mutation {
add_medical_record(
investigations: [8,9,5]
ctscan: "Scan needed in the left cerebral hemisphere"
mri: "Full body MRI"
developer: "Developer"
) {
id
patient {
id
name
email
}
investigations { id title type { id title } }
ctscan
mri
created_at
}
}
{
"data": {
"add_medical_record": {
"id": "16",
"patient": {
"id": "1",
"name": "KompleteCare User",
"email": "[email protected]"
},
"investigations": [
{
"id": "8",
"title": "Fingers",
"type": {
"id": "1",
"title": "X-Ray"
}
},
{
"id": "9",
"title": "Toes",
"type": {
"id": "1",
"title": "X-Ray"
}
},
{
"id": "5",
"title": "Lumbo Sacral Vertebrae",
"type": {
"id": "1",
"title": "X-Ray"
}
}
],
"ctscan": "Scan Needed In The Left Cerebral Hemisphere",
"mri": "Full Body MRI",
"created_at": "2022-05-29 23:04:42"
}
}
}