NAV
bash javascript php

Info

Welcome to the generated API reference. Get Postman Collection

COVID Case management

Create a case


Requires authentication [api/v3/ext/cases]

Example request:

curl -X POST \
    "http://202.45.145.25/api/v3/ext/cases" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Basic Auth" \
    -d '{"name":"RC Poudel","age":24,"age_unit":0,"sex":1,"caste":4,"province_id":3,"district_id":24,"municipality_id":293,"ward":5,"tole":"Dhumbarahi","occupation":5,"emergency_contact_one":"9*********","registered_at":"2021-01-01 10:02:20","service_for":1,"service_type":1,"sample_type":3,"sample_collected_date":"2021-01-01","infection_type":1,"lab_id":"MOB120","lab_received_date":"2021-01-01","lab_test_date":"2021-01-02","lab_test_time":"14:53:04","lab_result":3,"imu_swab_id":"1332-201201-21231","is_infected_covid_before":false,"is_received_vaccine":1}'
const url = new URL(
    "http://202.45.145.25/api/v3/ext/cases"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Basic Auth",
};

let body = {
    "name": "RC Poudel",
    "age": 24,
    "age_unit": 0,
    "sex": 1,
    "caste": 4,
    "province_id": 3,
    "district_id": 24,
    "municipality_id": 293,
    "ward": 5,
    "tole": "Dhumbarahi",
    "occupation": 5,
    "emergency_contact_one": "9*********",
    "registered_at": "2021-01-01 10:02:20",
    "service_for": 1,
    "service_type": 1,
    "sample_type": 3,
    "sample_collected_date": "2021-01-01",
    "infection_type": 1,
    "lab_id": "MOB120",
    "lab_received_date": "2021-01-01",
    "lab_test_date": "2021-01-02",
    "lab_test_time": "14:53:04",
    "lab_result": 3,
    "imu_swab_id": "1332-201201-21231",
    "is_infected_covid_before": false,
    "is_received_vaccine": 1
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://202.45.145.25/api/v3/ext/cases',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Basic Auth',
        ],
        'json' => [
            'name' => 'RC Poudel',
            'age' => 24,
            'age_unit' => 0,
            'sex' => 1,
            'caste' => 4,
            'province_id' => 3,
            'district_id' => 24,
            'municipality_id' => 293,
            'ward' => 5,
            'tole' => 'Dhumbarahi',
            'occupation' => 5,
            'emergency_contact_one' => '9*********',
            'registered_at' => '2021-01-01 10:02:20',
            'service_for' => 1,
            'service_type' => 1,
            'sample_type' => 3,
            'sample_collected_date' => '2021-01-01',
            'infection_type' => 1,
            'lab_id' => 'MOB120',
            'lab_received_date' => '2021-01-01',
            'lab_test_date' => '2021-01-02',
            'lab_test_time' => '14:53:04',
            'lab_result' => 3,
            'imu_swab_id' => '1332-201201-21231',
            'is_infected_covid_before' => false,
            'is_received_vaccine' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "message": "Data Successfully Sync",
    "status": 200
}

Example response (401):

{
    "message": "Authentication Failed",
    "status": 401
}

Example response (500):

{
    "message": "Invalid ........... Please send a valid data as mentioned in API documentation. Error at index:0",
    "status": 500
}

HTTP Request

POST api/v3/ext/cases

Body Parameters

Parameter Type Status Description
name string required The fullname of the case.
age integer required The age of the case.
age_unit integer required 0 = Year, 1 = Month, 2 = Days.
sex integer required 1=>Male, 2=>Female, 3=>Other.
caste integer required 0=>Dalit, 1=>Janajati, 2=>Madhesi, 3=>Muslim, 4=>Brahmin/Chettri, 5=>Other, 6=>Don't know.
province_id integer required The Province ID provided on Federal Info API.
district_id integer required The district ID provided on District API.
municipality_id integer required The municipality ID provided on Municipality API.
ward integer required The valid ward number.
tole string required The tole address.
occupation integer required 1=>Front Line Health Worker, 2=>Doctor ,3=>Nurse ,4=>Police/Army , 5=>Business/Industry, 6=>Teacher/Student/Education, 7=>Journalist, 8=>Agriculture, 9=>Transport/Delivery, 10=>Other
emergency_contact_one string required The valid phone number.
registered_at datetime required The date time format (yyyy-MM-dd HH:mm:ss) of your system's register/created of that case.
service_for integer required 1=>PCR Swab Collection, 2=>Anitgen Test.
service_type integer required 1=>Paid service, 2=>Free of cost service.
sample_type integer required 1=>Nasopharyngeal, 2=>Oropharyngeal, 3=>Both.
sample_collected_date date required The date time format (yyyy-MM-dd HH:mm:ss) of sample collection of that case.
infection_type integer required 1=>Symptomatic, 2=>Asymptomatic.
lab_id string required The Unique id for case in lab.
lab_received_date date required The date format (yyyy-MM-dd) of sample recieved in lab of case.
lab_test_date date required The date time format (yyyy-MM-dd HH:mm:ss) of sample test of case.
lab_test_time time required The time format (HH:mm:ss) of sample collection of that case.
lab_result integer required 3=> Positive, 4 => Negative
imu_swab_id string optional IMU generated sample ID if already registered in IMU case ( Nullable ) .
is_infected_covid_before boolean required (new) Have you been infected with COVID-19 before? .
is_received_vaccine integer required (new) 0=> No, 1 => Complete, 2=> Incomplete.

Get a case Details


Requires authentication [api/v3/ext/get-case-detail?imu_swab_id={imu_swab_id}]

Example request:

curl -X GET \
    -G "http://202.45.145.25/api/v3/ext/get-case-detail" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Basic Auth"
const url = new URL(
    "http://202.45.145.25/api/v3/ext/get-case-detail"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Basic Auth",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://202.45.145.25/api/v3/ext/get-case-detail',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Basic Auth',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "data": [
        {
            "name": "RC Poudel",
            "age": 24,
            "age_unit": "",
            "sex": "1",
            "caste": 4,
            "province_id": 3,
            "district_id": 27,
            "municipality_id": 293,
            "ward": "5",
            "tole": "Dhumbarahi",
            "emergency_contact_one": "9*********",
            "occupation": 5,
            "registered_at": "2021-01-01 10:02:20",
            "service_for": "1",
            "service_type": "1",
            "sample_type": "3",
            "sample_collected_date": "2021-01-01",
            "infection_type": "1",
            "lab_id": "",
            "lab_received_date": "2021-01-01",
            "lab_test_date": "2021-01-02",
            "lab_test_time": "14:53:04",
            "lab_result": "3",
            "imu_swab_id": "3095-211213-2756",
            "is_infected_covid_before": "",
            "is_received_vaccine": ""
        }
    ],
    "status": 200
}

Example response (401):

{
    "message": "Authentication Failed",
    "status": 401
}

HTTP Request

GET api/v3/ext/get-case-detail

URL Parameters

Parameter Status Description
imu_swab_id required The ID of the imu_swab_id.

General

Get a Federal Information

Passing your username and password to the api/v3/ext/federal-info


Requires authentication

Example request:

curl -X GET \
    -G "http://202.45.145.25/api/v3/ext/federal-info" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Basic Auth"
const url = new URL(
    "http://202.45.145.25/api/v3/ext/federal-info"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Basic Auth",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://202.45.145.25/api/v3/ext/federal-info',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Basic Auth',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

[
    {
        "id": 1,
        "province_name": "Province 1"
    },
    {
        "id": 2,
        "province_name": "Province 2"
    },
    {
        "id": 3,
        "province_name": "Bagmati Pradesh"
    },
    {
        "id": 4,
        "province_name": "Gandaki Pradesh"
    },
    {
        "id": 5,
        "province_name": "Lumbini Pradesh"
    },
    {
        "id": 6,
        "province_name": "Karnali Pradesh"
    },
    {
        "id": 7,
        "province_name": "Sudurpashchim Pradesh"
    }
]

Example response (401):

{
    "message": "Authentication Failed",
    "status": 401
}

HTTP Request

GET api/v3/ext/federal-info

Get a District Information

Passing your username and password to the /api/v3/ext/district


Requires authentication

Example request:

curl -X GET \
    -G "http://202.45.145.25/api/v3/ext/district" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Basic Auth"
const url = new URL(
    "http://202.45.145.25/api/v3/ext/district"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Basic Auth",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://202.45.145.25/api/v3/ext/district',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Basic Auth',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

[
    {
        "id": 1,
        "district_name": "Taplejung",
        "province_id": 1
    },
    {
        "id": 2,
        "district_name": "Panchthar",
        "province_id": 1
    },
    {
        "id": 3,
        "district_name": "Ilam",
        "province_id": 1
    },
    {
        "id": 4,
        "district_name": "Jhapa",
        "province_id": 1
    }
]

Example response (401):

{
    "message": "Authentication Failed",
    "status": 401
}

HTTP Request

GET api/v3/ext/district

Get a Municipality Information

Passing your username and password to the /api/v3/ext/municipality


Requires authentication

Example request:

curl -X GET \
    -G "http://202.45.145.25/api/v3/ext/municipality" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Basic Auth"
const url = new URL(
    "http://202.45.145.25/api/v3/ext/municipality"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Basic Auth",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://202.45.145.25/api/v3/ext/municipality',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Basic Auth',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

[
    {
        "id": 1,
        "province_id": "1",
        "district_id": "1",
        "district_name": "",
        "municipality_name": "Aathrai Tribeni"
    },
    {
        "id": 2,
        "province_id": "1",
        "district_id": "1",
        "district_name": "",
        "municipality_name": "Maiwakhola"
    }
]

Example response (401):

{
    "message": "Authentication Failed",
    "status": 401
}

HTTP Request

GET api/v3/ext/municipality