Bryan Han
Bryan Han

Reputation: 1

Fail to enable Smartsheet webhook (502 Bad Gateway)

Django: 4.0.6

Smartsheet Python SDK: 2.105.1

Ngrok: 3.0.6

I have a Django server running on localhost, forwarded my localhost through Ngrok, have setup a callback route for accepting/responding to the Smartsheet-Hook-Challenge, and created a webhook instance using Python SDK. However, when I try to enable my webhook by running the following (documented here):

Webhook = smartsheet_client.Webhooks.update_webhook(webhook_id,smartsheet_client.models.Webhook({'enabled': True}))

Ngrok immediately returns 502 bad gateway, and my webhook instance's disabledDetails attribute becomes Request returned HTTP status code 502 (ref id: wtegm9). And I have no clue what's the cause of this 502.

PS: While I'm writing this question, I was able to successfully enable my webhook using cURL command, so I can go ahead and start working. But enabling the same webhook instance with update_webhook python method still gives 502. Since updating webhook with cURL worked, could it be a bug in the Python SDK method itself?

Upvotes: 0

Views: 292

Answers (1)

Kim Brandl
Kim Brandl

Reputation: 13500

I would suspect that an issue with Ngrok is causing the 502 error and not a problem with the Smartsheet SDK. A Google search for http 502 bad gateway ngrok returns lots of info about 502 errors with Ngrok, including this Stack Overflow post which contains multiple widely approved answers:

Ngrok errors '502 bad gateway'

I'd start there, if I were you.

Upvotes: 0

Related Questions