MENU navbar-image
bash javascript

Introduction

This documentation aims to provide all the information you need to work with our API.

Base URL

http://ilgprofile.lgerp.org

Authenticating requests

This API is authenticated by sending an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by logging in to the application.

Endpoints

Register a user

Example request:
curl --request POST \
    "http://ilgprofile.lgerp.org/api/register" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"minima\",
    \"email\": \"candido07@example.com\",
    \"password\": \"porro\"
}"
const url = new URL(
    "http://ilgprofile.lgerp.org/api/register"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "minima",
    "email": "candido07@example.com",
    "password": "porro"
}

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

Request      

POST api/register

Body Parameters

name  string  

email  string  

Must be a valid email address.

password  string  

Login a user

Example request:
curl --request POST \
    "http://ilgprofile.lgerp.org/api/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"spencer.nadia@example.org\",
    \"password\": \"et\"
}"
const url = new URL(
    "http://ilgprofile.lgerp.org/api/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "spencer.nadia@example.org",
    "password": "et"
}

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

Request      

POST api/login

Body Parameters

email  string  

Must be a valid email address.

password  string  

POST api/logout

requires authentication

Example request:
curl --request POST \
    "http://ilgprofile.lgerp.org/api/logout" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://ilgprofile.lgerp.org/api/logout"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Request      

POST api/logout

GET api/provinces

requires authentication

Example request:
curl --request GET \
    --get "http://ilgprofile.lgerp.org/api/provinces" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://ilgprofile.lgerp.org/api/provinces"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/provinces

GET api/districts

requires authentication

Example request:
curl --request GET \
    --get "http://ilgprofile.lgerp.org/api/districts" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://ilgprofile.lgerp.org/api/districts"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/districts

GET api/localbodies

requires authentication

Example request:
curl --request GET \
    --get "http://ilgprofile.lgerp.org/api/localbodies" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://ilgprofile.lgerp.org/api/localbodies"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/localbodies

GET api/district/{code}

requires authentication

Example request:
curl --request GET \
    --get "http://ilgprofile.lgerp.org/api/district/18" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://ilgprofile.lgerp.org/api/district/18"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/district/{code}

URL Parameters

code  integer  

GET api/district/province/{province_id}

requires authentication

Example request:
curl --request GET \
    --get "http://ilgprofile.lgerp.org/api/district/province/12" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://ilgprofile.lgerp.org/api/district/province/12"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/district/province/{province_id}

URL Parameters

province_id  integer  

The ID of the province.

GET api/workingPopulation

requires authentication

Example request:
curl --request GET \
    --get "http://ilgprofile.lgerp.org/api/workingPopulation" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://ilgprofile.lgerp.org/api/workingPopulation"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/workingPopulation

GET api/workingPopulationCount

requires authentication

Example request:
curl --request GET \
    --get "http://ilgprofile.lgerp.org/api/workingPopulationCount" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://ilgprofile.lgerp.org/api/workingPopulationCount"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/workingPopulationCount

GET api/workingPopulation/province/{provinceId}

requires authentication

Example request:
curl --request GET \
    --get "http://ilgprofile.lgerp.org/api/workingPopulation/province/15" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://ilgprofile.lgerp.org/api/workingPopulation/province/15"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/workingPopulation/province/{provinceId}

URL Parameters

provinceId  integer  

GET api/workingPopulation/district/{districtId}

requires authentication

Example request:
curl --request GET \
    --get "http://ilgprofile.lgerp.org/api/workingPopulation/district/7" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://ilgprofile.lgerp.org/api/workingPopulation/district/7"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/workingPopulation/district/{districtId}

URL Parameters

districtId  integer  

GET api/workingPopulation/localbody/{localbodyId}

requires authentication

Example request:
curl --request GET \
    --get "http://ilgprofile.lgerp.org/api/workingPopulation/localbody/ab" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://ilgprofile.lgerp.org/api/workingPopulation/localbody/ab"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/workingPopulation/localbody/{localbodyId}

URL Parameters

localbodyId  string  

GET api/ageRangePopulationByGender

requires authentication

Example request:
curl --request GET \
    --get "http://ilgprofile.lgerp.org/api/ageRangePopulationByGender" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://ilgprofile.lgerp.org/api/ageRangePopulationByGender"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/ageRangePopulationByGender

GET api/ageRangePopulationByGenderAndLocalbody/{localbody}

requires authentication

Example request:
curl --request GET \
    --get "http://ilgprofile.lgerp.org/api/ageRangePopulationByGenderAndLocalbody/aut" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://ilgprofile.lgerp.org/api/ageRangePopulationByGenderAndLocalbody/aut"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/ageRangePopulationByGenderAndLocalbody/{localbody}

URL Parameters

localbody  string  

GET api/workingAgePopulationByGender

requires authentication

Example request:
curl --request GET \
    --get "http://ilgprofile.lgerp.org/api/workingAgePopulationByGender" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://ilgprofile.lgerp.org/api/workingAgePopulationByGender"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/workingAgePopulationByGender

GET api/workingAgePopulationByAgeGroup

requires authentication

Example request:
curl --request GET \
    --get "http://ilgprofile.lgerp.org/api/workingAgePopulationByAgeGroup" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://ilgprofile.lgerp.org/api/workingAgePopulationByAgeGroup"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/workingAgePopulationByAgeGroup