MySejahtera-PHP-Web
Retrieve MySejahtera App's data from MySejahtera API and show to users via web browser. Written in PHP.
Disclaimer
- This web app isn't affiliated with MySejahtera !
- This web app won't record user's MySejahtera username and password as this web app will just simply pass the username / password to the API and retrieve the
x-auth-token
. When requestingsemak-vaksin.php
andpdf-digital-cert.php
,x-auth-token
retrieved from login will be POST to it and they will use thex-auth-token
that receieved to retrieve the data. - I will not be responsible not be liable for any problem that will produce losses or inconveniences incurred as a result of such changes or differences.
- MySejahtera's API on this web app was grabbed via ProxyMan on iPadOS and iOS version of MySejahtera (User Agent used in this PHP Web App when making request to MySejahtera :
MySejahtera/1.0.36 (iPhone; iOS 14.4.2; Scale/2.00)
)
About this project
Inspired by nakvaksin.com.
I created a website to check vaccination record via JKJAV's API.
But their API keep returning 500 error for some reason (Seems like rate limit error , no workaround currently).
So I decided to create a web app / website that can retrieve MySejahtera API and return the data to users via broswer instead of their original app.
Parts of MySejahtera's API directly grab from nakvaksin.com , including Login , Personal Details , Vaccination Process Flow.
A big thanks to nakvaksin.com's teams here!
What can I do with this PHP Web App?
You can :
- Retrieve your personal risk status , vaccination status and your NRIC number / Passport Number.
- Retrieve your Vaccination Process , including 1st Dose Appointment and 2nd Dose Appointment.
- Retrieve your PDF version of Vaccine Digital Certificate , a new feature launched by MySejahtera.
Note : You must key in your Date of Birth first into MySejahtera Personal Details before you can generate your PDF version of Vaccine Digital Certificate.
How to retrieve login credentials on MySejahtera's API
- Login
Do a POST request to here https://mysejahtera.malaysia.gov.my/epms/login
with form and header below :
Header :
User-Agent: MySejahtera/1.0.36 (iPhone; iOS 14.4.2; Scale/2.00)
Host: mysejahtera.malaysia.gov.my
Content-Type: multipart/form-data;boundary=31
Form :
username=60XXXXXXXX
password=XXXXXXX
200 if success , 401 if username or password did not match the record in MySejahtera. Notice the x-auth-token response headers if you get 200 , the token is MySejahtera API's login credentials.
- Retrieve personal details
Do a GET request to here https://mysejahtera.malaysia.gov.my/epms/v1/mobileApp/vaccinationEmployeeInfo
with header below :
Header :
User-Agent: MySejahtera/1.0.36 (iPhone; iOS 14.4.2; Scale/2.00)
Host: mysejahtera.malaysia.gov.my
x-auth-token: <X-AUTH-TOKEN you get at Step 1>
200 if success , 500 if x-auth-token invalid.
- Retrieve vaccination process
Do a GET request to here https://mysejahtera.malaysia.gov.my/epms/v1/mobileApp/vaccination/processFlow
with header below :
Header :
User-Agent: MySejahtera/1.0.36 (iPhone; iOS 14.4.2; Scale/2.00)
Host: mysejahtera.malaysia.gov.my
x-auth-token: <X-AUTH-TOKEN you get at Step 1>
200 if success , 500 if x-auth-token invalid.
- Generate PDF version of Vaccine Digital Certificate
Do a GET request to here https://mysejahtera.malaysia.gov.my/epms/v1/mobileApp/vaccination/certificate/generate
with header below :
Header :
User-Agent: MySejahtera/1.0.36 (iPhone; iOS 14.4.2; Scale/2.00)
Host: mysejahtera.malaysia.gov.my
x-auth-token: <X-AUTH-TOKEN you get at Step 1>
200 if success , 500 / 401 / 403 if x-auth-token invalid.
- Download PDF version of Vaccine Digital Certificate
Do a GET request to here https://mysejahtera.malaysia.gov.my/epms/v1/mobileApp/vaccination/certificate/download
with header below :
Header :
User-Agent: MySejahtera/1.0.36 (iPhone; iOS 14.4.2; Scale/2.00)
Host: mysejahtera.malaysia.gov.my
x-auth-token: <X-AUTH-TOKEN you get at Step 1>
200 if success , 500 / 401 / 403 if x-auth-token invalid.
Note : for Step 4 and 5 , you must key in your Date of Birth first into MySejahtera Personal Details before you can generate and download your PDF version of Vaccine Digital Certificate or else you will get stucked on Step 4.
Requirements to deploy this PHP Web App
- PHP installed , 7.0 + is recommended
- Web server that configured properly to work with PHP
- Internet access
- reCaptcha site key (Replace the sitekey to ur own one in
index.html
)
Error code
- 401 on details.php
Your username or password did not match the record in MySejahtera. Please check your username and password.
- 403 on semak_vaksin.php / pdf-digital-cert.php
You did not provide token to check your vaccine details. Please try to login again.
- 401 on semak_vaksin.php / pdf-digital-cert.php
The x-auth-token is expired. You need to relogin at the main page.