1. Format
The API is based on REST convention and would use JSON as the default data format.
2. Authentication
All APIs described below need authentication. The client_id and From are given when registering with the Identity Provider. The signin API of Identity Provider should be used to get the auth token(To be provided in the "X-Auth-Token" header). Refer the Identity Provider page for more information on how to use the Identity Provider APIs.
3. Validations
For Validations on the API fields below and codes used refer this page.
Request : POST https://{mci_service}/api/v1/patients Headers : X-Auth-Token : {auth token returned from Identity Service Provider} client_id : {client id of requester in Identity Service Provider} From : {email_id of requester registered in Identity Service Provider} Content-Type : application/json Body (example with mandatory fields) :
Response Codes : 201 - Created 400 - Bad Request (incorrect data) 401 - Unauthorized (check X-Auth-Token, From and client_id in headers) 403 - Access Denied (check roles in identity provider service) Response :
The id field contains the health id of the patient. |
Create Patient API can be called with or without "hid" field.
|
|
Request : PUT https://{mci_service}/api/v1/patients/{health_id} Headers : X-Auth-Token : {auth token returned from Identity Service Provider} client_id : {client id of requester in Identity Service Provider} From : {email_id of requester registered in Identity Service Provider} Content-Type : application/json Body should contain fields which are to be modified (May or may not include other feilds). Example :
Response:-
Response Codes : 202 - Updated 400 - Bad Request (incorrect data) 401 - Unauthorized (check X-Auth-Token, From and client_id in headers) 403 - Access Denied (check roles in identity provider service) |
Request : GET https://{mci_service}/api/v1/patients/{health_id} Headers : X-Auth-Token : {auth token returned from Identity Service Provider} client_id : {client id of requester in Identity Service Provider} From : {email_id of requester registered in Identity Service Provider} Response Codes : 200 - ok 401 - Unauthorized (check X-Auth-Token, From and client_id in headers) 403 - Access Denied (check roles in identity provider service) |
|
Error Categories: (Application error code series)
Validation Error-
Invalid Request-
Permission Error-
100Char, space, numbers, alphabets, special characters, all accepted.