Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

412 error calling book API endpoint #168

Open
amohap2 opened this issue Dec 6, 2024 · 2 comments
Open

412 error calling book API endpoint #168

amohap2 opened this issue Dec 6, 2024 · 2 comments

Comments

@amohap2
Copy link

amohap2 commented Dec 6, 2024

Anyone getting this response?
Bot works sometimes but not when it matters.
Also I modified the keys for this post.

[DEBUG] 2024-12-06 09:00:02.671-05:00 ResyApi$:119 - Post Params: book_token=IK%7C1vOjAFs2Ayen5_JvS2mTuVmamZtUfU54HnGIReCMhfgrD3LMr3_%7Czyuruon9DGDl6%7CERfGr9OleWP85WuzFudiD6ApsiZamnR2Qqom0GOOyTQHxHakCBfnfC%7CjEDrOdZXF9bldLlJDD24SKs5lRo2i_6A1DFpXCZmzJHYnCkzP78PBTZRJKiypB%7CQhkAAmqU9RFLkzySyZFDfN8N0xEO9QLuLdqxdSwroEEIlygD2QegQVJysZRdw711or46tedMebIQk_pGARs4BUVE5FrD%7CP_mSBA0CuOMjeGGRvIDeK89J71RcSeH_EzTa0rxI0RlDBmJMXzzL4M%7CzMaOirX5rcMrNsCkmFKP8zNSMjRFnlV1VMPxaaV_0v8a%7CKIMnZPF2aeqGl4wDBe_NUR43fp0U2U9PLRAw2njWlrjzQdyCKIxwmsvScfrGm4fmguDtHrwhQm40CIvH68g%7CJR%7CRFsU6owpB01PKm_AFJc_9N%7Cix4qVciR%7CS4ey7ahDsFdiVVLY9XYaYgOZpCqWVtvV3RFbg0ZPoAn05SW9coCEaXdvEOLfWrsMuQKbxrx3td6dWC1cqaG7H1l_DLgd6k0xAEGzaOr6HXVlf4NKtZNIMeBPQPODOBrJPedWmQSGXdpef6AObmnwv8OLSxJEJIW3M9zzDRbZe0TXLXUw7N%7CuJz0gMI9MIhkXMYbXAXfIb7Q3ed1rFx0_vXPW5Sarl0vWuAnLeVaMxwEqVKr1KX7MRkC797fyt3vg8OdD53YcO5gV_KaTmv%7CJJORCmJ7Qk7kaDvNXVrmKhyh9RuF%7CW7ebIN_gtAUYl2_a424hDbWCYqmPOn3CFToDUbR%7C4dD5OJMBNZWtbZKnfZJfSoLBHSvTeVDNMr3HOD6N0cZbsitvL9ASUYoh0ksOiVnhkLeTkddv6IwgVuS1f5mVqMvSq_m7xNXpxP%7CIGsZuTOr4EqTGywFH%7CDhgsgyj1gxI5mVzC85S_at45Y42JW3eXmZk7PfQgNaw_NXf0baXcNQTuJbxN9x0XCp_Xl1ONUPGKdTCIt5%7C5IV4agzVfLGKQGo_h4INbImI_XuHxS58KHLNPGq8OcunPqg4poFyDPmnmoU547PSFIPqah8moqEI1TOHFWJiF_G8nS5L%7CJqh6rM9xKEAOQldB-14d0829ee2a0d855a9b3b75abad1e280ffca75c7735f5d0b1a50f8a5&struct_payment_method=%7B%22id%22%3A26516796%7D&
[DEBUG] 2024-12-06 09:00:02.671-05:00 ResyApi$:127 - Request Headers: (Authorization,ResyAPI api_key="xxx"), (x-resy-auth-token,eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJleHAiOjE3MzU3MDU0ODYsInVpZCI6NzA0NDIyLCJndCI6ImNvbnN1bWVyIiwiZxxxxx.ABjlcDRu14CNuyBLXPVgowHzZKByJi-G5lE10lOWa8ILHAOY1H28QlOAbz2MQq4B1DBxYEfMUtauSA6iNNnugSu3ASLK2YlD2qeQnDFla2C6N4mroM3932Fmk1v41k1-ago7g3I_eOMet_PcFwvz6rz67vhAvpD-JFrPe82B-gTN-v25), (User-Agent,Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36), (Cache-Control,no-cache), (Content-Type,application/x-www-form-urlencoded), (Origin,https://widgets.resy.com), (Referer,https://widgets.resy.com/)
[DEBUG] 2024-12-06 09:00:04.201-05:00 ResyApi$:142 - Response Status: 412
[DEBUG] 2024-12-06 09:00:04.201-05:00 ResyApi$:143 - Response Headers: Via: 1.1 884e9540b32f06547183ac58410aeea6.cloudfront.net (CloudFront); Date: Fri, 06 Dec 2024 14:00:04 GMT; Server: nginx; X-Cache: Error from cloudfront; Connection: keep-alive; X-Amz-Cf-Id: A5ygvytUKV3oLG_-HRy2Y3GCrFMSUwr87tDcTr_I1lt9ZYlfyr7mmQ==; Content-Type: text/html; charset=utf-8; X-Amz-Cf-Pop: JFK52-P10; Content-Length: 183
[DEBUG] 2024-12-06 09:00:04.201-05:00 ResyApi$:144 - Response Body: {"specs": {"day": "2024-12-20", "reservation_id": 665982460, "table_config_id": null, "time_slot": "18:00:00"}, "venue": {"id": 82175, "name": "Bricklane Curry House - East Village"}}
[I

@jamelcharouel
Copy link

@amohap2 have you been able to get past the constant internal server errors when trying to make a reservation? Maybe I'm being rate limited (which would make sense as my requests in the browser are 500-ing as well), but the bot makes hundreds of requests in the 10 seconds its active to the Resy API (ex. https://api.resy.com/4/find?venue_id=80153&party_size=2&long=0&day=2024-12-28&lat=0) and all receive a response of Internal Server Error. I haven't modified the code from the repo at all save for the config (just attempting to book a random restaurant with plenty of open tables to test the bot out first).

@henryp12345
Copy link

henryp12345 commented Jan 11, 2025

I was running into the same error. I was able to solve it by adding the User-Agent header to my get requests, as suggested by some of the other issues in this repo. The fix was to change the createHeaders function in ResyApi.scala to something like this.

  private[this] def createHeaders(resyKeys: ResyKeys): Seq[(String, String)] = {
    Seq(
      "Authorization"     -> s"""ResyAPI api_key="${resyKeys.apiKey}"""",
      "x-resy-auth-token" -> resyKeys.authToken,
      "User-Agent" -> "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
    )
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants