Skip to content

Instantly share code, notes, and snippets.

@BlakeStevenson
Last active March 13, 2025 14:35
Show Gist options
  • Save BlakeStevenson/e0323256e4395752b6fea814d5e5ebcc to your computer and use it in GitHub Desktop.
Save BlakeStevenson/e0323256e4395752b6fea814d5e5ebcc to your computer and use it in GitHub Desktop.
Create an appointment at the Texas DPS at the closest location, soonest time, programatically.
const axios = require('axios');
async function getLocations() {
const locationsData = await axios.post("https://publicapi.txdpsscheduler.com/api/AvailableLocation", {
"TypeId": 71,
"ZipCode": "10001",
"CityName": "",
"PreferredDay": 0
});
return locationsData.data;
}
async function getTimes(lid) {
const timeData = await axios.post("https://publicapi.txdpsscheduler.com/api/AvailableLocationDates", {
LocationId: lid,
TypeId: 71,
SameDay: false,
StartDate: null,
PreferredDay: 0
});
return timeData.data;
}
async function createAppointment(time, site, respId) {
const appointmentData = await axios.post("https://publicapi.txdpsscheduler.com/api/NewBooking", {
"CardNumber": "",
"FirstName": "Blake",
"LastName": "Stevenson",
"DateOfBirth": "mm/dd/yyyy",
"Last4Ssn": "ssn4",
"Email": "[email protected]",
"CellPhone": "(123) 456-7890",
"HomePhone": "",
"ServiceTypeId": 71,
"BookingDateTime": time, //2020-10-16T08:00:00
"BookingDuration": 45,
"SpanishLanguage": "N",
"SiteId": site,
"SendSms": false,
"AdaRequired": false,
"ResponseId": respId
});
return appointmentData.data;
}
async function getResponseId() {
const respIdData = await axios.post("https://publicapi.txdpsscheduler.com/api/Eligibility", {
"FirstName": "Blake",
"LastName": "Stevenson",
"DateOfBirth": "mm/dd/yyyy",
"LastFourDigitsSsn": "ssn4",
"CardNumber": ""
});
return respIdData.data[0].ResponseId;
}
(async () => {
// get response id
const responseId = await getResponseId();
console.log(responseId);
// get locations
const locations = await getLocations();
console.log(locations[0]);
// get times
const times = await getTimes(locations[0].Id);
console.log(times.LocationAvailabilityDates[0]);
// create appointment
const appointment = await createAppointment(times.LocationAvailabilityDates[0].AvailableTimeSlots[0].StartDateTime, locations[0].Id, responseId);
console.log(appointment);
this.appointment = appointment;
})();
@markdjones82
Copy link

How did you find out about the api? I don't see any info on it when googling.

@BlueMoon-Suhas
Copy link

How did you find out about the api? I don't see any info on it when googling.

anything worked out so far?

@markdjones82
Copy link

How did you find out about the api? I don't see any info on it when googling.

anything worked out so far?

I'm not sure what you are asking, but the only way to find it is from reverse engineering when going to the webpage. There is a good one out there that works here https://github.com/phamleduy04/texas-dps-scheduler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment