Alkaar / resy-booking-bot

🔫 Helps to snipe hard to get reservations at restaurants that use resy
409 stars 215 forks source link

Staging environment endpoint not returning response #98

Closed JadenJansz closed 1 year ago

JadenJansz commented 1 year ago

Hello, I setup the bot on intellij as mentioned in the ReadME, executed it and got the following logs

Screenshot 2023-03-15 at 9 32 36 AM

As I went through the other simillar issues, it was mentioned that a "Payment Method" should be included in our account for successful sniping.

However as I didn't want to risk adding my credit card info, I decided to run the "resy-booking-bot" using the staging environment endpoint https://staging-api.resy.com as mentioned in the Resy API documentation. Yet most of the shell commands do not return the expected response mentioned. The following is the "Reservation Glow -> Details" request and response.

curl --location --request GET 'https://staging-api.resy.com/3/details?party_size=2&day=2020-06-23&config_id=rgs://resy/1042631/209590/2/2020-06-23/2020-06-23/16:00:00/2/Dining%20Room' \
--header 'Authorization:  ResyAPI api_key="youarewhereyoueat"' \
--header 'Content-Type: application/x-www-form-urlencoded'

Screenshot 2023-03-15 at 9 39 03 AM

The documentation also says to get the config_id from an /4/find response , but it does not return a config_id

Can anyone help me to successfully run the commands on the staging environment, also to get a valid response when I run the bot on intellij as shown in the 1st screen shot.

Thank you for your time.

Alkaar commented 1 year ago

So I never tested with the staging environment. I pasted a link to it purely for reference. The documentation is also not quite 100% but it is there for those who are curious. Also the fact that usually staging and resy.com may not always be 100% aligned and I only keep the code working on resy.com. So my recommendation is to not using staging actually.

Regarding putting your credit card info in, you are putting it in on resy.com, not in the bot. The bot doesn't get the actual credit card number, only a reference to it (e.g. https://github.com/Alkaar/resy-booking-bot/blob/master/src/main/scala/com/resy/ResyClient.scala#L76)

// Searching this JSON structure...
// {"user": {"payment_methods": [{"id": 42, ...}]}}
val paymentMethodId =
   (resDetails \ "user" \ "payment_methods" \ 0 \ "id").get.toString

You can read the code yourself. It's not doing anything shady with your credit card. This is also why I wrote the bot to put in your API key and auth token instead of your user/pass as I felt people would rather not share the password on some random GitHub repo.

JadenJansz commented 1 year ago

Okay understood, Thank you for your response!