serverless-southwest-check-in icon indicating copy to clipboard operation
serverless-southwest-check-in copied to clipboard

API Authentication Errors: 429 Rate Limiting Error & 403 Forbidden

Open ScottBishop opened this issue 2 years ago • 7 comments

Check in lambda is failing due to 429 error - Too Many Requests. I don't have a lot of users, so I think this may be related to the API auth.

status_code=429 msg="Error.": SouthwestAPIError Traceback (most recent call last): File "/var/task/handlers/check_in.py", line 40, in main resp = swa.check_in(first_name, last_name, confirmation_number) File "/var/task/swa.py", line 136, in check_in response = _make_request("post", page, body) File "/var/task/swa.py", line 48, in _make_request response.status_code, msg)) exceptions.SouthwestAPIError: status_code=429 msg="Error."

This may or may not be related -- schedule check in receives this error:

status_code=403 msg="Forbidden": SouthwestAPIError Traceback (most recent call last): File "/var/task/handlers/schedule_check_in.py", line 35, in main first_name, last_name, confirmation_number File "/var/task/swa.py", line 73, in from_passenger_info params File 

ScottBishop avatar Aug 16 '21 14:08 ScottBishop

Thanks Scott... They updated their API in the first week of August and it broke all check-ins :(. The app is generating a unique token for each request which doesn't seem easily reproducible.

On Mon, Aug 16, 2021, 10:22 AM Scott Bishop @.***> wrote:

Check in lambda is failing due to 429 error - Too Many Requests. I don't have a lot of users, so I think this may be related to the API auth.

status_code=429 msg="Error.": SouthwestAPIError Traceback (most recent call last): File "/var/task/handlers/check_in.py", line 40, in main resp = swa.check_in(first_name, last_name, confirmation_number) File "/var/task/swa.py", line 136, in check_in response = _make_request("post", page, body) File "/var/task/swa.py", line 48, in _make_request response.status_code, msg)) exceptions.SouthwestAPIError: status_code=429 msg="Error."

This may or may not be related -- schedule check in receives this error:

status_code=403 msg="Forbidden": SouthwestAPIError Traceback (most recent call last): File "/var/task/handlers/schedule_check_in.py", line 35, in main first_name, last_name, confirmation_number File "/var/task/swa.py", line 73, in from_passenger_info params File

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/DavidWittman/serverless-southwest-check-in/issues/83, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFOMLZOS3ETTQZYOYVXZT3T5ENMHANCNFSM5CH2V3SA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

DavidWittman avatar Aug 16 '21 14:08 DavidWittman

Have you been able to look into it? Do you know what changed?

Happy to help as well.

ScottBishop avatar Aug 19 '21 19:08 ScottBishop

Yeah, they now require a unique X-Dublriiu- header now which gets generated client-side and sent with every check-in request. Not quite sure how it gets generated... I'm assuming it isn't easy though.

Dave

On Thu, Aug 19, 2021 at 2:25 PM Scott Bishop @.***> wrote:

Have you been able to look into it? Do you know what changed?

Happy to help as well.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/DavidWittman/serverless-southwest-check-in/issues/83#issuecomment-902180338, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFOML7KM4GAEXPNBGBQDRTT5VLENANCNFSM5CH2V3SA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

DavidWittman avatar Aug 20 '21 00:08 DavidWittman

Looks like this one fixed the API, are you able to leverage the changes they made? https://github.com/mwynholds/southy

mastermind85 avatar Oct 13 '21 22:10 mastermind85

I tested it out with their API Key and User Agent, still see the 429 error, they still aren't using the X-Dublriiu- header

status_code=429 msg="Error.": SouthwestAPIError
Traceback (most recent call last):
  File "/var/task/handlers/check_in.py", line 40, in main
    resp = swa.check_in(first_name, last_name, confirmation_number)
  File "/var/task/swa.py", line 136, in check_in
    response = _make_request("post", page, body)
  File "/var/task/swa.py", line 48, in _make_request
    response.status_code, msg))
exceptions.SouthwestAPIError: status_code=429 msg="Error."

ScottBishop avatar Oct 14 '21 15:10 ScottBishop

@ScottBishop @mastermind85 I'm testing some changes in #84 to resolve this. If either of y'all happen to have some upcoming flights I can test it on let me know.

DavidWittman avatar Jan 02 '22 17:01 DavidWittman

I have a friend with a flight tomorrow, just sent you the details to the email listed on your github page.

ScottBishop avatar Jan 11 '22 00:01 ScottBishop