This method directly sends the network request.
- Install Postman and Postman Interceptor
- Set up
Capture requests and cookeis
on Postman. Make sure to: sync and capture cookeis onicbc.com
- Now search the available test on ICBC Website. If you do it correctly, you should be able to see the
getAvailableAppointments
on Network requests. - Copy the
getAvailableAppointments
request ascURL (bash)
- Import it to Postman as
Raw text
. Send it and you will get a HTTP 200 response. - Copy the code snippet as
JavaScript - Fetch
- Paste it on the
Console
tab. You will see it returns a list of schedules - Now run my script
// get an alert when found an appointment before the date below let preferToBeBefore = new Date("2022-06-01"); let checkDate = () => fetch("https://onlinebusiness.icbc.com/deas-api/v1/web/getAvailableAppointments", requestOptions) .then(response => response.text()) .then(result => JSON.parse(result)) .then(oResult => { const foundDate = new Date(oResult[0]?.appointmentDt.date); const result = foundDate < preferToBeBefore console.log(`Earliest date: ${foundDate}; Less than ${preferToBeBefore}: ${result}`) if (result) { alert(`BOOK NOW: ${foundDate}`) } else { setTimeout(() => { checkDate(); }, 0) } }) .catch(error => console.log('error', error)); checkDate();
- Once alert is triggered, go reschedule the appointment ASAP!
- Good luck on your road test! And fuck ICBC examiners!