Available APIs
Choose an integration:
- eGov App SSO API - single sign-on using the eGovPH app citizen account
- eGov Partners API - partner agency data integration
eGov App SSO API v2
Follow these 3 steps to authenticate citizens with their eGovPH account using your partner code and partner secret furnished by the eGov administrator.
- 01Generate exchange code
The exchange code is derived from the eGov app and is then transferred to the agency application that will use the Single Sign-On SSO functionality. To effectively simulate the particular scenario, you can employ your registered account within the eGov app alongside the partner code and partner secret, both of which are furnished by the eGov administrator.
Step 1 - 02Generate access token
The access token is a one-time encrypted string used to gain access to a specific resource API within the eGov system. Request it at POST https://oauth.e.gov.ph/api/token with scope SSO_AUTHENTICATION.
Step 2 - POST https://oauth.e.gov.ph/api/token - 03SSO authentication
The SSO Authentication API is a powerful tool that provides single-sign-on functionality to in-app services. This API allows users to sign to a variety of different services with a single set of credentials, improving the user experience and increasing security. By utilizing the SSO Authentication API, app developers can offer their users a seamless and secure way to access multiple services without the need for multiple logins. Request it at POST https://oauth.e.gov.ph/api/partner/sso_authentication with Authorization: Bearer {{ACCESS_TOKEN}}.
Step 3 - POST https://oauth.e.gov.ph/api/partner/sso_authentication
Generate access token - request
POST https://oauth.e.gov.ph/api/token
Body is form-data.
| Parameter | Value |
|---|---|
| partner_code | {{PARTNER_CODE}} |
| partner_secret | {{SECRET_CODE}} |
| scope | SSO_AUTHENTICATION |
| exchange_code | {{EXCHANGE_CODE}} |
Generate access token - example request
Example cURL request:
curl --location 'https://oauth.e.gov.ph/api/token' \
--form 'partner_code="{{PARTNER_CODE}}"' \
--form 'partner_secret="{{SECRET_CODE}}"' \
--form 'scope="SSO_AUTHENTICATION"' \
--form 'exchange_code="{{EXCHANGE_CODE}}"'
Generate access token - example response
Example token response:
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3N0Zy1zdXBlcmFwcC1zc28ub3VlZy5pbmZvIiwiaWF0IjoxNjg4Nzk1NTc0Ljg4ODU2LCJzY29wZSI6IlNTT19BVVRIRU5USUNBVElPTiIsInBjIjoiRVZJU0EiLCJ0a2kiOjEyLCJqdGkiOiJZVlZQWFg0RVlFNUo0IiwiZXhwIjoxNjg4Nzk5MTc0fQ.YQwnVizn0jjakThzAeQZeZcNGrNGSdDeWj9qiemWQOM"
}
SSO authentication - headers
| Header | Value |
|---|---|
| Authorization | Bearer {{ACCESS_TOKEN}} |
SSO authentication - example request
Example cURL request:
curl --location \
--request POST 'https://oauth.e.gov.ph/api/partner/sso_authentication' \
--header 'Authorization: Bearer "{{ACCESS_TOKEN}}"' \
--header 'Cookie: cross-site-cookie=bar'
SSO authentication - example response
Example JSON response:
{
"status": 200,
"message": "OK",
"data": {
"uniqid": "MVPCBEUVCGPZR",
"email": "sample@email.com",
"birth_date": "08/22/1999",
"first_name": "JUAN",
"middle_name": "DELA",
"last_name": "CRUZ",
"suffix": "JR",
"gender": "MALE",
"nationality": "FILIPINO",
"photo": "https://samplephoto.com",
"mobile": "+639123123123",
"address": "123 Sample St. Quezon City",
"street": "123 Sample St.",
"barangay": "Doña Imelda",
"municipality": "QUEZON CITY",
"region": "NATIONAL CAPITAL REGION (NCR)",
"province": "NATIONAL CAPITAL REGION (NCR)",
"country": "Philippines",
"postal": 1012,
"address_line_2": "SAMPLE ADDRESS LINE 2",
"barangay_code": "137404031",
"province_code": "133900000",
"municipality_code": "137404000",
"region_code": "130000000",
"country_id": 175,
"foreign_address": "ALBERTA, CANADA",
"passport": {
"first_name": "JUAN",
"middle_name": "DELA",
"last_name": "CRUZ",
"suffix": "JR",
"gender": "Male",
"birth_date": "08/22/1999",
"passport_number": "SAMPLE-PASSPORT-NUMBER",
"place_issued": "SAMPLE PLACE ISSUED",
"expiry_date": "08/22/2024"
}
}
}
All sample values shown are placeholders.
Ready to integrate government services into your app?
Join Filipino developers building the future of digital government services with eGovPH.
Actions shown on page: Get Your API Key and Read the Docs.
